I'm familiar with making startup scripts in other unix platforms, but redhat 6.1 and 6.2 want to pass a start or stop command to the startup script. I have loaded a program that does not need the start and stop sent to it. The passing of the start kills the program. I just want to have a symbolic link to the programs executable run when the runlevel is reached. Any suggestions?
|
First put a file in /etc/rc.d/init.d that looks like the following:
Code:
#!/bin/sh [Edited by jeremy on 08-30-2000 at 08:17 AM] |
Thanks
Thanks I will try it soon!
|
startup works but kill doesn't seem to work..
Hello,
I used your script and it works on startup just fine. I now have a problem with the kill scripts. I made a ln -s to rc3.d, rc0.d, and rc6.d and the target was K??programname. ?? being like 01. I want to kill my application before the machine kills the rest of the scripts.Nothing depends on them. I want the script to kill the program on halt, reboot. The startup is obviously only in rc3.d because runlevel 3 is my default. I don't see any thing on the screen saying it killed my program when I halt or reboot. I do see messages on startup. Do you have any ideas? Is linux wierd about using particular numbers in startup and kill scripts in the rc directories? I appreciate your help. Thank You Tom :) |
When the system changes runlevels it goes into the appropriate dir (we'll say /etc/rc.d/rc0.d for shutdown) and calls each script. If the filename is K99program it will call it with stop (./K99program stop). If the filename is S99program it will call it with start. The files are called in ascending order (starting with x00, ending with x99). You may want to change the echo in the stop case to "Shutting down programname" to make it more noticable.
|
Run level 0 is halt and runlevel 6 is reboot. You will need to put your link to kill your program in the appropriate directory for these two runlevels to get it to work for both halt and reboot. Putting the kill link in runlevel 3 will not do anything for you. Also if you want the program to run while in X, you will need to put the start link in runlevel 5 also.
|
All times are GMT -5. The time now is 09:33 PM. |