It's /lib/systemd/system-sleep/
and not "/lib/systemd/systemd-sleep
" ... Your scriptfile's contents can look like this:
#!/bin/sh
# "/lib/systemd/system-sleep/" template script
case "${1}" in
pre)
# Command(s)/script(s) to execute before system goes to sleep/hibernate
# nothing
;;
post)
# Command(s)/script(s) to execute after system wakes up from sleep/hibernate
/bin/pulseaudio --kill && /bin/pulseaudio --start
# To run a command as a certain user, use the example below instead ...
# Changing "username" to the actual desired invoking user name like:
# /bin/su username -c '/bin/pulseaudio --kill && /bin/pulseaudio --start'
;;
esac
Yo need to specify full real path to executables and in case of user services like PulseAudio, you might need to specify the invoking user as well.
You'll obviously need to create the script file, edit and save it first with e.g.:
sudo nano /lib/systemd/system-sleep/script-file-name
Then, make it executable like so:
sudo chmod +x /lib/systemd/system-sleep/script-file-name
You might need to read these related posts as well: