scripts - How to add commands to be run after a systemd-controlled system service? - Ask Ubuntu


i made service following guide did: created systemd service unit created startup shell script configured , installed service

now, script this one. basically, @ startup did depending if laptop charging or not, , every x minutes check again , set cpus frequencies etc..

now, happens want stop reobtain full power laptop, stop it, should set again cpus frequencies etc. possible that, when systemctl stop battery-script.service execute script or lines of code before stopping? in advance

according documentation have use execstop= in battery-script.service. looks like:

[unit]   [service] execstart=/usr/local/bin/battery.sh execstop=/usr/local/bin/battery-stop.sh  [install] wantedby=default.target 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User