I have a systemd script that works correctly if I call it directly or if I call if via systemd like:
systemctl stop XXX.service
But the script fails to work when the system is rebooted or shutdown.
Here is the systemd script:
[Unit]
Description=Run Scripts at Start and Stop
After=syslog.target network.target
[Service]
Type=oneshot
User=root
Group=root
RemainAfterExit=true
ExecStart=/usr/bin/echo start
ExecStop=/usr/bin/killall -u xxx
ExecStopPost=/bbb/stop_back.sh
TimeoutStopSec=5min 35s
[Install]
WantedBy=multi-user.target