On Fri, 25.09.15 22:17, Łukasz Stelmach (stl...@poczta.fm) wrote: > Hi, > > systemd-sleep(8) states > > Note that scripts or binaries dropped in /usr/lib/systemd/system-sleep/ > are intended for local use only and should be considered hacks. If > applications want to be notified of system suspend/hibernation and > resume, there are much nicer interfaces available. > > What is the right way to hook some oneshot services like battery status > monitor[1] into systemd so they get executed as pre-sleep and > post-resume (or more specifically (pre|post)-(suspend|hibernate|hybrid-sleep) > if possible) hooks?
Applications should use suspend delay inhibitors in logind so that they get a certain amount of time to whatever they want to do before the system goes to sleep. https://wiki.freedesktop.org/www/Software/systemd/inhibit/ > Then, does any part of systemd (package) react to plugging and > unplugging DC jack into a laptop? I think you get an uevent for this, hence you could do it via udev rules, no? Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel