-   Linux - General (
-   -   During Shutdown instead of powering off Server gets stuck on...?? (

helptonewbie 01-03-2008 05:09 PM

During Shutdown instead of powering off Server gets stuck on...??
Hello all,
My server which does and should power off automatically doesn't seem to do so anymore. All it does is just sit there at:-
INIT: no more processes left in this runlevel
but doesn't actually power off.

I have to admit i did edit the '/etc/init.d/halt' script so that after a message is sent to the user at the top of the script like, echo's out Server is shutting down, i have a script that i've poked in for running but it doesn't have anything to do with the server shutting down as far as i can see. Perhaps a better thing is o ask is there something that runs like rc.local does but to run scripts as the server begins to shutdown rather than editing the halt script, this would be a much improved method. Perhaps a script in rc6.d would do it??? However if there's somthing similar to rc.local that runs on boot but instead of it being on boot it runs on shutdown i'm all ear's

Thanks Regards

Brian1 01-03-2008 07:01 PM

So if you restored the /etc/init.d/halt script back to the orginal setting does it turn off?


helptonewbie 01-04-2008 04:38 AM

it most certainly does, if i pull the halt file back from one of the other servers, it works fine (shutsdown A ok). I have a script that automatically add's in the lines required in the halt file via using 'sed'. So it should only be editing specific parts.

Brian1 01-05-2008 05:56 PM

Post the changes that are done to the halt script. No idea what is going on unless seeing the code.


helptonewbie 01-06-2008 06:24 AM

Hi Brian,
I've sorted that part out now, because my script that was putting entries into the halt file made use of tempory file of course when the temp file was created its created with normal file creation permissions ie. not execute bit therefore the file didn't have execute permission, i'm such a wally.
I also now don't want to change the halt file, i would like to be able to run my script before any of the services shutdown, is there a better way to do this rather than creating a K00.... inside the rc0.d and rc6.d folders with my script in it?? To make Sure on restart or shutdown of the server my script is one of the first things run??


Brian1 01-09-2008 04:50 PM

If you logout of a gui there is some scripts in KDE that stuff can be placed but cannot remember off the top of my head. Probably Gnome and others as well. If not using gui then I would say the best is the way you described. Done many that way to do things at start and shutdown.


helptonewbie 01-09-2008 05:00 PM

Cheers Brain, yes its all sorted now with the K00..., all working fine now. Thanks for your replies


All times are GMT -5. The time now is 10:09 AM.