[systemd-devel] suspend hook as user service

Michael Hirmke mh at mike.franken.de
Mon Feb 20 18:41:00 UTC 2017


Hi Simon,

>On Fri, 17 Feb 2017 at 19:41:00 +0100, Michael Hirmke wrote:
>> A much better approach is to write a script or program listening for the
>> according signals "PrepareForSleep" and "PrepareForShutdown" on the dbus
>> interface "org.freedesktop.login1".

>This is the thing to do. It allows your program to delay suspend until
>it is ready for suspend to happen, or prevent suspend altogether.

not really "until it is ready", but for a maximum of 5 seconds ;)

>For instance, Telepathy delays suspend so it can try to take instant
>messaging connections offline first:
>https://cgit.freedesktop.org/telepathy/telepathy-mission-control/tree/src/con
>nectivity-monitor.c

>    S

Bye.
Michael.
-- 
Michael Hirmke


More information about the systemd-devel mailing list