Red Hat Bugzilla – Bug 161540
RFE: Add "sleep" and "wake" arguments to standard.
Last modified: 2014-03-16 22:54:42 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Description of problem:
Consider adding "sleep" and "wake" arguments to the standards for init scripts so we can call them in ACPI actions. Got the idea after having to enter the 'dbus-send' command to properly notify NetworkManager of the events.
How about something like `service sleep` that would iterate through all the enabled systems at the current run-level and run `service <foo> sleep`? The stock ACPI action scripts could then call this on sleep and wake events.
May need to define a new comment header (i.e. 'sleepnotify: 1' or a new flag in the 'chkconfig:' entry) until legacy scripts actually added the new "sleep" and "wake" options for the 'service sleep' idea to work.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Expected Results: A way for package maintainers to indicate whether their subsystem has additonal requirements before and after a suspend/restore cycle.
A single command to call from ACPI scripts to notify all interseted subsystems of such events.
Realistically, it's probably better that they expose those methods via d-bus,
along the ideas of:
Moreover, I'd think most services that would supposedly need 'sleep' and
'resume' should actually be triggering on something else. For example, they
should be catching changing networks, or changes from AC to battery.
I'm no init or Dbus guru here so bear with me. I don't understand the "expose
those methods via d-bus" comment. My /etc/acpi/actions/sleep script is calling
a rather long dbus-send command to tell NetworkManager that we're going down and
coming back up. Are you suggesting that someone else needs to be notifying
NetworkManager rather than an ACPI script?
See the hooks in /etc/pm/hooks; that's probably the best place to integrate
these sorts of things.