Ticket #456 (new enhancement)
need some way to execute scripts upon suspend/resume
| Reported by: | arne.anka | Owned by: | mickey |
|---|---|---|---|
| Priority: | major | Milestone: | cornucopia-0.13 |
| Component: | cornucopia/fsousage | Version: | |
| Keywords: | Cc: |
Description
apm and acpi both have an infrastructure for scripts to be executed upon suspend or resume. in both cases a running apmd or acpid is required -- since acpi is not avaliable on the fr, only apmd remains. i am really missing something equivalent for fso, since it does suspend and resume on its own, no apmd is necessary. what's more, having apmd running considerably slows down resume (which takes already several rings when waking up from a call).
atm my problem is most notably bluetooth not always surviving suspend/resume -- i have to to hid2hci -q and restart bluetoothd to make it work again -- here a script run on resume comes in really handy, but there are probably a lot of other scnearios justifying two hooks.
Change History
comment:1 Changed 4 years ago by mickey
- Component changed from framework/general to cornucopia/fsousage
comment:2 Changed 4 years ago by arne.anka
for location, calling and invocation i'd say it should follow the apm/acpi conventions. a lot of packages create/expect /etc/apm/ resp /etc/acpi/. here at my debian host i got both /etc/apm/ and /etc/acpi/, see listing below. i guess, we need only suspend.d/ and resume.d/ -- maybe scripts.d/ to hold scripts to be linked into the two other folders. since fso substitutes both apm and acpi it maybe should use both folders (apm and acpi)? but otoh it's kind of overhead.
for suspend/resume: inhowfar exactly? of course, because it has to be looked into it to check for existence of scripts at all (and execute in case), but else? at least the impact on resume could be limited when checking for scripts upon suspend and set a flag, if there are any/none to be executed on resume. and it would probably be a good idea to have a config option to disable the whole thing -- i don't know, how many people actually will use it and i for one need it so far mostly for hacks and workarounds.
here's the structure of /etc/apm/ and /etc/acpi/:
$ ls -R /etc/apm/ /etc/apm/: event.d resume.d scripts.d suspend.d
/etc/apm/event.d: 20hdparm anacron gpm ppp
/etc/apm/resume.d: 20alsa
/etc/apm/scripts.d: alsa
/etc/apm/suspend.d: 80alsa
$ ls -R /etc/acpi/ /etc/acpi/: events powerbtn-acpi-support.sh resume.d
/etc/acpi/events: fglrx-ac-aticonfig fglrx-lid-aticonfig powerbtn-acpi-support
/etc/acpi/resume.d:

Ok, I'm willing to implement what you ask for in fsousaged. Be aware that this will affect suspend/resume speed though, there's no way around it. Some questions: