[solved] custom sleep.d scripts suddenly stop running

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

[solved] custom sleep.d scripts suddenly stop running

Postby ddurdle on Fri Aug 17, 2012 12:07 am

I don't know what to make out of this one. I have been using this machine that has Linux Mint Debian UP3 installed for 6+ months. I haven't made any changes recently.

I an encfs to store some files. I have a routine in a sleep.d file that unmounts the encfs if I hibernate or suspend the computer. I know it was working for 6+ months because I recall always having to remount the encfs constantly, especially after I resume the machine.

Suddenly today it's no longer executing this sleep.d script. I haven't done any updates or changes. For good measure, I rebooted the computer a few times. I've been testing both sleep and hibernate the way I always have been, and the sleep.d script doesn't appear to be getting called anymore.

Here are the particulars:


durdle@x61t-2 [68C] [0] /var/log $ ls /usr/lib/pm-utils/sleep.d/
000kernel-change 00unmount_enc 60_wpa_supplicant 95led
00copyram 01laptop-mode 75modules 98video-quirk-db-handler
00logging 49bluetooth 90clock 99video

durdle@x61t-2 [60C] [0] /etc/pm/sleep.d $ ls
10_unattended-upgrades-hibernate 20_unmount_enc 99-x61-docking
15_copyram 98powersave


If i look into the pm-suspend.log, I only see 4 of the sleep.d scripts being called:

durdle@x61t-2 [60C] [0] /etc/pm/sleep.d $ cat /var/log/pm-suspend.log
enabled, active

/usr/lib/pm-utils/sleep.d/01laptop-mode resume suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/00powersave resume suspend:

/usr/lib/pm-utils/sleep.d/00powersave resume suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/00logging resume suspend:

/usr/lib/pm-utils/sleep.d/00logging resume suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change resume suspend:

/usr/lib/pm-utils/sleep.d/000kernel-change resume suspend: success.

The script:
#!/bin/sh
. "${PM_FUNCTIONS}"


case "$1" in
hibernate)
/usr/bin/fusermount -u /projects/_SECURE/DropBox
;;
thaw|resume)
;;
*) exit $NA
;;
esac


Any idea where to start looking? How do these sleep.d scripts get invoked?


If I run the command manually, it unmounts as expected.
Last edited by ddurdle on Fri Aug 31, 2012 8:16 pm, edited 1 time in total.
ddurdle
Level 3
Level 3
 
Posts: 106
Joined: Sat Dec 17, 2011 10:03 am

Linux Mint is funded by ads and donations.
 

Re: custom sleep.d scripts suddenly stop running

Postby ddurdle on Fri Aug 17, 2012 9:34 am

I really can't figure this one out. I was testing this call day, going into suspend and hibernate many times. Also tried rebooting the system to make sure there wasn't an issue there.

Even before I went to bed, I reboot and did a hibernate, and still didn't work. So I posted here and then hibernated and went to bed. This morning I turn on the system and I see the hibernation scripts worked that last time because my encfs was unmounted (and a touch file I put into a script for checking if the scripts were being called actually worked).

Is there a good way to troubleshoot this?
ddurdle
Level 3
Level 3
 
Posts: 106
Joined: Sat Dec 17, 2011 10:03 am

Re: custom sleep.d scripts suddenly stop running [solved]

Postby ddurdle on Fri Aug 17, 2012 4:32 pm

I discovered the problem. Somehow the permissions of my custom sleep.d scripts got their ownership changed to my user account instead of root. Although I would normally expect this not to be a problem since the root user would have access, perhaps the sleep scripts run under an account that has root membership but is not root itself (my knowledge is limited on the inner workings of sleep). As soon as I toggled the ownership to root:root, the sleep scripts were being executed consistently once again.
ddurdle
Level 3
Level 3
 
Posts: 106
Joined: Sat Dec 17, 2011 10:03 am


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 5 guests