At Fri, 26 Jun 2015 22:01:27 +0300, Andrei Borzenkov wrote:
В Fri, 26 Jun 2015 20:46:30 +0200 Takashi Iwai <tiwai@suse.de> пишет:
At Fri, 26 Jun 2015 19:49:05 +0200, Wolfgang Bauer wrote:
Am Freitag, 26. Juni 2015, 18:39:34 schrieb Carlos E. R.:
Please allow for local script on each action, where we can still add our own actions. In pm-utils, this means directory "/etc/pm/sleep.d/". It doesn't need to be the exact same syntax, but if it is that would allow us (users) to just drop our scripts into the new location.
Systemd does allow this, see "man systemd-sleep": Immediately before entering system suspend and/or hibernation systemd-suspend.service (and the other mentioned units, respectively) will run all executables in /usr/lib/systemd/system-sleep/ and pass two arguments to them. The first argument will be "pre", the second either "suspend", "hibernate", or "hybrid-sleep" depending on the chosen action. Immediately after leaving system suspend and/or hibernation the same executables are run, but the first argument is now "post". All executables in this directory are executed in parallel, and execution of the action is not continued until all executables have finished.
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.
I think a few things missing there.
1. Serialized execution of scripts
Yes, that needs some driver which is called from systemd and controls further script execution. Sounds suspiciously familiar to what pm-utils does :)
2. Some easy interface for common workarounds such as unloading / reloading modules. This is still needed occasionally, and writing the full unit file from scratch at each time is a waste of man hours.
Programs under systemd-sleep are not units, they are just arbitrary executables.
Ah right. But the argument is same. If we have something like $SUSPEND_MODULE in /etc/sysconfig/suspend, it's easier to manage, for example. Takashi -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org