LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   init script not running (http://www.linuxquestions.org/questions/programming-9/init-script-not-running-454076/)

naz37 06-12-2006 02:19 PM

init script not running
 
hello everyone. iv been trying to write a init script that will run at both boot and shutdown. the script is to creat a ramdisk and copy a load of files to it at boot time and copy the files back to the harddrive at shutdown. from what i can see the script itself is working, ie if i run it on the command line with start or stop args it does what its supose to. iv saved the file in "/etc/rc.d/init" and iv added a symbolic link to "/etc/rc.d/rc5.d" called "S99ramdiskCache.sh" to call the script at boot and another link in "/etc/rc.d/rc0.d" called "K00ramdiskCache.sh" to call it at shutdown. at boot the script is being called as it should, but at shutdown it isnt being called. i cant see what can be the problem. what i want is for it to be the first script called at shutdown hence the "K00" prefix. my distro is FC4 and im using the 2.6.16-1.2108_FC4 kernal.

if anyone has any ideas of where im going wrong or need more info please write back. any help will be greatly appreciated :-)

Hko 06-12-2006 02:39 PM

Does your script check if $1 is either "stop" "start",...?

naz37 06-12-2006 02:50 PM

ye the script uses;
case "$1" in
start)
commands...
;;
stop)
commands...
;;
esac

the script works if i call it in the shell with "start" or "stop" as args. it just isnt being run when the system enters runlevel 0 during shutdown sequence.


All times are GMT -5. The time now is 03:54 AM.