How to execute after.local after resume from suspend/hibarnate

At startup I set some (hdparm) config via /etc/init.d/after.local.
This works well at startup, but not after suspend and hibernation.
My question is, how it is possible to execute the contents of the after.local automatically after suspend and hibernation?

I’d put the in a separate bash script, and call that script from after.local
Next I’d create a systemd service “root-resume.service” with content:

Description=Local system resume actions



and enable the newly created service:

systemctl enable root-resume.service

Knurpht, thank you, i will implement your approach.

Question to Knurpht:
What’s your opinion of the “/usr/lib/systemd/system-sleep/” method mentioned in the “systemd-suspend.service” man page?Yes, yes, I know: “Note that scripts or binaries dropped in /usr/lib/systemd/system-sleep/ are intended for local use only and should be considered hacks.:wink: