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

Hello,
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?
Regards

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:


[Unit]
Description=Local system resume actions
After=suspend.target


[Service]
Type=simple
ExecStart=/path-to/your-bash-script


[Install]
WantedBy=suspend.target

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: