Hello guys,
I would like to run a command before shutdown, reboot on centos to send a: /usr/bin/systemctl kill -s SIGUSR1 service-name.service.
have tried something like:
[Unit]
Description=Gracefully terminate the slave
DefaultDependencies=no
Before=shutdown.target reboot.target halt.target kexec.target
[Service]
Type=oneshot
ExecStart=/usr/bin/echo 'start' >> /root/worked.txt
ExecStop=/usr/bin/echo 'stop' >> /root/worked.txt
RemainAfterExit=yes
[Install]
WantedBy=shutdown.target reboot.target halt.target kexec.target
It doesn't seem to be working, I cant write anything in /usr/lib/systemd/system-shutdown/ due to the nature of CoreOS partitions.
Any way I can achieve this ?