0

i have tried to run the script before shutdown using systemd but its not working . I have created the following service:

[Unit]
Description=test
Before=shutdown.target

[Service]
Type=oneshot
ExecStart=/bin/true
ExecStop=/usr/local/bin/test.sh
RemainAfterExit=yes
TimeoutSec=300

[Install]
WantedBy=multi-user.target

In script, I just remove the file.

Reddy Lutonadio
  • 17,120
  • 4
  • 14
  • 35
  • Please show the specific method you have used to try to run this script on shutdown, and the evidence it is not doing so. – music2myear May 06 '20 at 05:30
  • May be you can use this related answer: https://superuser.com/questions/127454/run-script-on-logout-shutdown-ubuntu?rq=1 – Juanjo Espí May 06 '20 at 06:56

0 Answers0