I would like some help getting a script to run on shutdown and restart.
Following advice I found online, I created the script and placed it in /etc/rc0.d and /etc/rc6.d.
Unfortunately, the scripts are not running and when I run Aptitude, I see the following error appear:
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc0.d/K99-CreateSuccessfulPowerOffFile
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/K99-CreateSuccessfulPowerOffFile
Here are the contents of the script:
#!/bin/sh
echo success > /etc/poweroffsuccess.txt
exit 0
And here are the permissions:
user@hostname:~$ ls -l /etc/rc0.d/K9*
-rwxrwxrwx 1 root root 58 Sep 24 11:11 /etc/rc0.d/K99-CreateSuccessfulPowerOffFile
user@hostname:~$ ls -l /etc/rc6.d/K9*
-rwxrwxrwx 1 root root 50 Aug 18 21:09 /etc/rc6.d/K99-CreateSuccessfulPowerOffFile