-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 El 2017-01-07 a las 14:58 +0100, Carlos E. R. escribió:
On 2017-01-07 11:04, Michael Hirmke wrote:
Hi Carlos,
[...]
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.
I tried to put things like that into the NetworkManager dispatcher scripts in /etc/NetworkManager/dispatcher.d, but even here sometimes it is too late, because NM stops the interfaces faster than my dispatcher scripts finished. And: It works only with NM versions > 1.2.2. At the moment in Leap 42.2 I use 1.4.4 from the Tumbleweed repo. You might be lucky, if the actions to be performed don't last too long.
It appears that the best option for me is to create a wrapper script that does the needed tasks, and when done, calls systemd to perform the hibernation, or aborts with a message if not possible. Some things could go to the systemd directory.
It appears that it is possible to abort hibernation. See this: cer@minas-tirith:~> systemctl hibernate User root is logged in on sshd. Please retry operation after closing inhibitors and logging out other users. Alternatively, ignore inhibitors and users with 'systemctl hibernate -i'. cer@minas-tirith:~> So, the question now is to find out what those "inhibitors" are. - -- Cheers Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAliZVHkACgkQja8UbcUWM1zWbAD/Wp3z+MqR7MlVtdQaaEYxnWAo wqWGxxcXl2bfO6PdbyUA/3Nu5mVtE9vEFhPJApFmzgPxfacrnL3dLMni5dMmbSLT =3WMt -----END PGP SIGNATURE-----