Shutdown script not working

Hello,
I need to execute a script during shutdown. The script is below:

root@hosto:/etc/init.d# cat whatstop 
#!/bin/sh /etc/rc.common
STOP=10
stop() {
touch /tmp/stopped.txt
}
shutdown(){
touch /tmp/shut.txt
}

I have created the link: /etc/rc.d/K10whatstop -> /etc/init.d/whatstop by executing the command: /etc/init.d/whatstop enable
The script works when ran manually (/etc/init.d/whatstop stop) or (/etc/init.d/whatstop shutdown). However, it doesn't work when reboot.
Any help is appreciated.

The /tmp folder resides in RAM.

4 Likes

oops...!
Thank you very much.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.