Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

The problem I am facing is that, when I try to restart "code" server using command sudo init 6, the server Shuts down.I could'nt even connect the server.How can I overcome this issue?

share|improve this question
1  
What does /etc/init.d/apache2 status return? Also please describe your problem in more detail. Your post is not written in a way we can understand what the problem is. –  Thomaschaaf Nov 2 '12 at 10:18
    
On many OSes, init 6 is designed to reboot the OS. The server going down is a feature, not a bug. If you don't want the server to reboot, it's probably best to stop rebooting it. –  MadHatter Nov 2 '12 at 10:20
    
@MadHatter so how can I stop the rebooting process? –  Sujathan R Nov 2 '12 at 10:21
    
In general, don't do init 6. If you mean "Now I've done init 6, how do I get the server back?", you will need to wait for it to reboot. Why it's not rebooting properly is a different question entirely. If it's local, put a console on it and see what it's doing; if it's remote, the question probably need to be addressed to the hosting company and/or colo facility where the server is. –  MadHatter Nov 2 '12 at 10:23

1 Answer 1

If you want to restart your system, try reboot command.

And to troubleshoot the reason of the problem, you need to check the log messages, that what happens at the end,when the system actually needs to reboots, but it shuts down. Logs will give you a clue.

Here is an interesting article on difference of reboot command and "init 6"

In Linux, the init 6 command gracefully reboots the system running all the K* shutdown scripts first, before rebooting. The reboot command does a very quick reboot. It doesn’t execute any kill scripts, but just unmounts filesystems and restarts the system. The reboot command is more forceful.

So, should I use reboot or init 6? – neither! My advice is to use the shutdown command. shutdown will do a similar job to init 6, but it has more options and a better default action. Along with kicking off an init 6, the shutdown command will also notify all logged in users (logged in at a tty), notify all processes the system is going down and by default will pause for a set time before rebooting (giving you the chance to cancel the reboot if you realize that you made a mistake).

http://www.vreference.com/2009/09/23/reboot-is-not-the-same-as-init-6/

share|improve this answer
1  
Second the "use shutdown". Do not use reboot or init 6. You want programs to close to prevent corrupted databases or worse. –  Hennes Nov 2 '12 at 10:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.