
On 2016-12-29 13:02, Andrei Borzenkov wrote:
On Thu, Dec 29, 2016 at 2:34 PM, Carlos E. R. <robin.listas@telefonica.net> wrote:
Hi,
I see scripts in "/usr/lib/systemd/system-sleep/". What would be the right place to add my own scripts?
It depends on what this script does.
For example, send pending nntp messages before going into hibernation. This is because there is a cron job that does it, but I might write a message and go into hibernation immediately, before the cron job runs. If I awake the machine a day later, the upstream server rejects the post because it is too old. For example, abort hibernation if vmware is running, or if there is an active nfs share. The reason is because I have seen crashes in both circumstances. Another thing I did was stop and start ntp. On the laptop, instead, I trigger ntptimeset on restore, I do not use the daemon. These are things I did with "pm" I hoped for /etc/systemd/system-sleep/
A pointer to reading about them?
"man systemd-sleep" and "man bootup" would be a good start
I want to know the available parameters that the scripts in "/usr/lib/systemd/system-sleep/" can use. I know, by looking at the current scripts, that $2 can be "suspend", "hibernate", or "hybrid-sleep", that $1 can be "pre" or "post"... but the man page does not explain. And I need to know how to abort hibernation. Previously a flag file did the trick: {backup}/usr/lib/pm-utils/pm-functions: INHIBIT="${STORAGEDIR}/inhibit" -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)