Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

You just drop a script into a "special" directory, and the scripts are run in alphabetical order with arguments that tell them if they are being called for a suspend or resume, and the type of suspend. Non-systemd, it is part of the acpi stuff. Systemd has its own special dir '/usr/lib/systemd/system-sleep' (there is no equivalent under /etc; and creating one yourself will not work). I don't recall the directory the acpi hook scripts used (it has been a while... ?something like /etc/acpid/hooks.d?), but it worked pretty much the same way. Supposedly you can use systemd targets to accomplish the same, but when I tried that, it was very unreliable-- apparently unreliable for others too since the special systemd dir exists, and the distribution is using it for its own hooks (Poettering has said it might go away at some point, though :/).

The original dumb version (written in anger, after the first time the laptop crashed on resume post installing the Intel card, and a bit of testing to isolate it to the iwlwifi module) was just a few lines-- literally a couple minutes to write. It has grown since to about 10X the size to handle some details specific to my network setup more intelligently.



view as:

Legal | privacy