Sample Header Ad - 728x90

RHEL6 Can't make my script run on shutdown and reboot

4 votes
3 answers
10825 views
I'm trying to execute a script in each shutdown and reboot but the script never runs. 1. I created the script baseRhel64 and save it to /etc/rc.d/init.d 2. I did chkconfig --add baseRhel64 3. I included in the script #chkconfig --list # chkconfig: 06 10 10 4. I verified that the S10 script where created under /etc/rc0.d/S10baseRhel64 and /etc/rc6.d/S10baseRhel64 The following is my script: #!/bin/sh #chkconfig --list # chkconfig: 06 10 10 start(){ echo "basename $0 start" touch /root/installscripts/test1 } stop(){ echo "basename $0 stop" touch /root/installscripts/test2 touch /root/installscripts/"basename $0" } case "$1" in start) start;; stop) stop;; *) echo $"Usage: $0 {start|stop}" RETCAL=1 esac exit 0
Asked by Gidi Kern (41 rep)
Jul 8, 2014, 08:06 AM
Last activity: Nov 7, 2018, 01:54 PM