How to stop a reboot after init 6 is given by mistake?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to stop a reboot after init 6 is given by mistake?
# 1  
Old 05-13-2014
How to stop a reboot after init 6 is given by mistake?

Hi, I recently had an issue and by mistake a script of mine has initiated init 6 command,

Is there a way to stop the reboot manually after init 6 is given,


Your response is highly appreciated.
Thanks in advance !!
# 2  
Old 05-13-2014
I am not aware of any means to stop a reboot. Also, you would only have a few seconds or even less before your shell is killed by the shutdown process.
# 3  
Old 05-13-2014
I wonder if you could do "pf -ef | grep 'init 6'" then get the pid and do "kill -9 <pid>". The real question is can you do the above before you session is killed. When typing something that could cause harm, you can always pause for a moment before hitting enter and make sure that what you are doing is really what you wanted to do.
# 4  
Old 05-13-2014
Quote:
Originally Posted by gandolf989
I wonder if you could do "pf -ef | grep 'init 6'" then get the pid and do "kill -9 <pid>".
This would not work, because 'init 6' does nothing but send a signal of some sort to the real init process, the one which started when the computer booted. You'd have a fraction of a millisecond to catch 'init 6' before it sends that signal and quits.

Killing the real init process would make things worse.
# 5  
Old 05-13-2014
Quote:
Originally Posted by Corona688
This would not work, because 'init 6' does nothing but send a signal of some sort to the real init process, the one which started when the computer booted. You'd have a fraction of a millisecond to catch 'init 6' before it sends that signal and quits.

Killing the real init process would make things worse.
That is good to know in case I do type init 6 as root on a unix system. The other problem with someone accidentally doing init 6, is that even if you can stop the shutdown from happening, the OS will start killing processes. Processes that would need to be restarted. Either way doing init 6 or shutdown on a running production server by accident is going to cause issues.
# 6  
Old 05-14-2014
Quote:
Originally Posted by Corona688
Killing the real init process would make things worse.
Fortunately, modern unix versions protect the init process.

Solaris 10:
Code:
# kill -9 1
kill: 1: permission denied

RHEL 6 does not even print an error message, it just discards the nonsense.

Long time ago, it was possible to kill init, which usually caused a
Code:
kernel panic: init died.

This User Gave Thanks to hergp For This Post:
# 7  
Old 05-21-2014
If you really want to kill init, I'd bet this would work on Solaris:
Code:
dd if=/dev/zero of=/proc/1/as

Anyone care to try? Smilie

Not sure offhand what the equivalent Linux /proc/1 entry would be.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

init-script failing because of /etc/rc.d/init.d/functions

I encountered a problem on one of our database servers. OS: CentOS 5.5 final Kernel: 2.6.18-238.5.1.el5.028stab085.2 (OpenVZ kernel) We wrote some DB-Start/Stop-scripts ("/db2/admin/scripts_dba/start_services.ksh" and ".../stop_services.ksh") to start the database instances. (Database... (1 Reply)
Discussion started by: bakunin
1 Replies

2. Solaris

What is the diffe b/w init s and init S

i did my research in finding the answer but couldn't find right one. Please give your inputs. (6 Replies)
Discussion started by: ranumala
6 Replies

3. UNIX for Advanced & Expert Users

Problem on init 0, execution is the same with init 6

Hi, I am experiencing a weird thing on my SUNFIRE machine with Solaris 9 OS. When I do init 0 to shutdown the machine to go to ok prompt, what it did was shutdown and reboot like an init 6 command do. I did check the corresponding rc scripts that were involved with init 0 and compared with rc... (2 Replies)
Discussion started by: Yenthanh
2 Replies

4. Shell Programming and Scripting

How to stop monitoring of servers at the time of reboot through shell scripting?

We have number of servers which belongs to platforms Solaris, AIX,HP-UX and LINUX. Monitoring tool 'Patrol Agent' process run on the servers to check for the server health and communicate with the Patrol server through the port 5181. During scheduled reboot and maintenance of servers we do receive... (1 Reply)
Discussion started by: subharai
1 Replies

5. Red Hat

Difference between 'init s' and 'init 1'

What is the difference between 'init s' and 'init 1'. I know that both will work to change the current run level to single user mode. Is there any difference in those two commands? (5 Replies)
Discussion started by: praveen_b744
5 Replies

6. Linux

How to I change init levels after typing init 1

Dear all, I typed in init 1 on my redhat box as root and according to wikipedia (http://en.wikipedia.org/wiki/Runlevel): 1 Single-User Mode Does not configure network interfaces, start daemons, or allow non-root logins So now I can't connect back to it. How do I change the init back to 3?... (8 Replies)
Discussion started by: z1dane
8 Replies

7. Solaris

diff between reboot and init 6 in solaris

Hi All, Does anyone tell me , is there any difference between solaris "reboot " and init 6 ...bcos in case of reboot for a system ..can i use init 6 for that instead. Thanks in advance, J (6 Replies)
Discussion started by: jegaraman
6 Replies

8. UNIX for Advanced & Expert Users

how to stop others users to stop viewing what i am doing ?

Hi , I have one question, suppose i am a normal user and when i use 'w' command , it shows who is logged on and what they are doing . Now i want to stop others users to know what i am doing accept the root ? can i do this ? thanks (5 Replies)
Discussion started by: mobile01
5 Replies

9. Solaris

different between soft reboot and hard reboot

Hi Guru's Can any want here could explain to me the different between soft reboot and hard reboot . Best Regards Seelan (3 Replies)
Discussion started by: seelan3
3 Replies

10. UNIX for Advanced & Expert Users

Init 6 & Init 0 problem

Hi Expert, I have encountered some problem with my SUN system. Everytime when i issue command #init 6 OR #init 0 it just logout and prompt for login again instead of rebooting the server when run init 6 and system shutdown when run init 0.. I can only reboot the system using reboot ... Was... (6 Replies)
Discussion started by: sc2005
6 Replies
Login or Register to Ask a Question