Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to lock the screen when my computer is waken up from memory suspend,

So I tried to put the following script to /usr/lib/pm-utils/sleep.d and /etc/pm/sleep.d, but it never got executed,

#!/bin/sh

case "$1" in
    hibernate|suspend)
        ;;
    thaw|resume)
        vlock -ans
        ;;
    *) exit $NA
        ;;
esac

P.S It's pm-suspend not pm-hibernate.

EDIT

Tried systemd service as well, no luck:

# /etc/systemd/system/resume@.service
[Unit]
Description=User resume actions
After=suspend.target

[Service]
User=root
Type=simple
ExecStart=vlock -ans

[Install]
WantedBy=suspend.target

And I called systemctl enable resume@.service too, vlock wasn't called still.

share|improve this question
1  
Are you sure it will not get executed? Can you try to just log it or do something like echo executed script >> /tmp/resume – Ulrich Dangel Dec 26 '12 at 13:50

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.