Reboot init script doesn't work
Hello-
I'm having trouble getting a shell script to work that I want to call whenever the system is re-booted (init 6) or shutdown (init 0). I put the script in /etc/rc.d/init.d, make sure it is executable, and put a link to it in both /etc/rc.d/rc6.d and rc0.d. For now, to test, all the script does is print a line on the console using echo. I assign it a symbolic link name starting with "K" as required. The script is self-executing, ie: it starts with #!/bin/sh What am I missing here?? (I'm running RedHat 9) Thanks in advance for any help! |
can you call it from the command line & have it execute?
|
Yes - I tested that it is executable from the command line, and also that its permissions include "execute"
|
Might be helpfull if you posted the code, otherwise sounds like it should work. Also, try doublechecking that the script is actually being executed, by putting your code in an existing script that you know runs.
|
Here it is (it's really simple, just to see if it executes):
#!/bin/sh echo "Hi there - I'm here!" exit 0 --------------------------------------------- I just wanted to see the Hi There line when I started an init 6. Instead, I got nothing. Just for fun, I inserted a similar echo statement into a script that I know is running from rc6.d, and it appeared nicely on the console after I typed init 6. Thanks |
You could try making it an executable script called /sbin/halt.local. I think that is the file designated by Red Hat for use as a user shutdown script.
___________________________________ Be prepared. Create a LifeBoat CD. http://users.rcn.com/srstites/LifeBo...home.page.html Steve Stites |
Ok, I will try that. I've gone home now, so I'll do it tomorrow.
Thanks |
All times are GMT -5. The time now is 01:37 AM. |