[SOLVED] Restarting a service after suspend
So here's my issue:
I'm running spotifyd as a dinit user service. When I suspend my machine with loginctl, spotifyd, due to some librespot limitations (according to my research) seems to fail to notice that it crashed, making the service unable to restart itself. So what I'm trying to do is make the service restart when I resume.
I noticed that the "spotifyd-dinit" package on pacman "depends-on" network, which should work since network gets disconnected when suspended, but since I'm running the service as user the script fails.
Here's how the pacman's script looks like:
type = process
command = /usr/bin/spotifyd --no-daemon
smooth-recovery = true
logfile = /var/log/dinit/spotifyd.log
depends-on = network
On systemd the workaround looks like this:
[Unit]
Description=Restart spotifyd after resume
After=suspend.target
[Service]
Type=simple
ExecStart=/bin/systemctl --user --no-block restart spotifyd.service
[Install]
WantedBy=suspend.target
How my script currently looks like:
type = process
command = /usr/bin/spotifyd --no-daemon
smooth-recovery = true
Any clues?
Thanks in advance!