LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-03-2008, 05:09 PM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Question 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

Last edited by helptonewbie; 01-03-2008 at 05:16 PM.
 
Old 01-03-2008, 07:01 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

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

Brian
 
Old 01-04-2008, 04:38 AM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
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.
 
Old 01-05-2008, 05:56 PM   #4
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

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

Brian
 
Old 01-06-2008, 06:24 AM   #5
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
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??

Cheers
 
Old 01-09-2008, 04:50 PM   #6
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
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.

Brian
 
Old 01-09-2008, 05:00 PM   #7
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Cheers Brain, yes its all sorted now with the K00..., all working fine now. Thanks for your replies

Cheers
Mark
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Powering off when powering off, how hard can it be? Ian_Hawdon Slackware 14 01-19-2006 04:19 PM
system stuck in loop after improper shutdown dr_zayus69 Linux - General 8 08-21-2005 03:30 PM
Shutdown stuck at PCMCIA mysticsound Linux - Laptop and Netbook 2 03-18-2005 03:40 AM
Stuck on Shutdown frkstein Linux - General 3 01-15-2002 10:43 PM
how can I remote shutdown other WinNT server from Linux Server? adelel Linux - Networking 2 01-06-2002 01:21 AM


All times are GMT -5. The time now is 05:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration