[solved] custom sleep.d scripts suddenly stop running

Archived topics about LMDE 1 and LMDE 2
Locked
ddurdle
Level 3
Level 3
Posts: 153
Joined: Sat Dec 17, 2011 10:03 am

[solved] custom sleep.d scripts suddenly stop running

Post by ddurdle »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
ddurdle
Level 3
Level 3
Posts: 153
Joined: Sat Dec 17, 2011 10:03 am

Re: custom sleep.d scripts suddenly stop running

Post by ddurdle »

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: 153
Joined: Sat Dec 17, 2011 10:03 am

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

Post by ddurdle »

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.
Locked

Return to “LMDE Archive”