You are not logged in.

#1 Yesterday 19:34:15

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,699
Website

Systemd-native method to have a running service restart on resume?

Is there a systemd-native method to have a running service restart when the machine resumes from suspend? I am not seeing anything in the man pages and finding references to having a separate service call systemctl to restart bit that just feels a bit hacky. For example:

# cat /usr/lib/systemd/system/kodi-gbm-restart-on-resume.service
[Unit]
Description=Restart Service After Suspend
After=suspend.target network-online.target

[Service]
Type=oneshot
ExecStart=/bin/systemctl restart kodi-gbm.service

[Install]
WantedBy=suspend.target

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 Yesterday 21:01:04

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,232

Re: Systemd-native method to have a running service restart on resume?

Does Combined sleep/resume unit not work in your case?

Online

#3 Yesterday 21:29:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,699
Website

Re: Systemd-native method to have a running service restart on resume?

I did not see that section of the wiki. I will explore it, thank you.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB