I have something similar on this.
I want a python script to run before poweroff, halt and on
it works in "bullseye" not in "bookworm".
owner of script is root/root mode 0644
I want a python script to run before poweroff, halt and on
Code:
[Unit]Description=python script to run on all kinds of offBefore=poweroff.target shutdown.target reboot.target halt.target[Service]Type=oneshotUser=rootGroup=rootExecStart=/bin/trueExecStop=python3 /pathtoscript/script.pyRemainAfterExit=yes[Install]WantedBy=multi-user.target
owner of script is root/root mode 0644
Statistics: Posted by PieterG — Tue Feb 06, 2024 6:53 pm