LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2011, 12:49 PM   #1
aggrishabh
Member
 
Registered: Nov 2010
Posts: 87

Rep: Reputation: 1
Lightbulb How to cancle shutdown


Hi All,

I am having a situation, if some have to fire some command after firing shutdown or init 0.
is there any possibilities to cancel shutdown process if yes then how?

one more question: how a computer know that i have to shutdown if a user fire shutdown or init 0(just want to know the actual shutdown process what files the shutdown process calls and how it prevents a user to login (over the network)while shutting down.)
 
Old 01-12-2011, 01:01 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 7,565

Rep: Reputation: 696Reputation: 696Reputation: 696Reputation: 696Reputation: 696Reputation: 696
(never tried this)try
sudo pkill -9 init
 
Old 01-12-2011, 01:08 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Better
Code:
shutdown -c
 
Old 01-13-2011, 12:06 PM   #4
aggrishabh
Member
 
Registered: Nov 2010
Posts: 87

Original Poster
Rep: Reputation: 1
Hi business_kid,

you mean to say instead of init 0 or shutdown command we must fire sudo pkill -9 init.
can you please elaborate this command i am afraid that this command is safe to use this will kill the init process abruptly leaving system in no state.

Please correct me if i am wrong.
 
Old 01-13-2011, 01:23 PM   #5
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 872

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by bathory View Post
Better
Code:
shutdown -c

I agree with this post

"# shutdown -c" is what I always use to cancel any shutdown
 
Old 01-13-2011, 01:54 PM   #6
aggrishabh
Member
 
Registered: Nov 2010
Posts: 87

Original Poster
Rep: Reputation: 1
Hi bathory,

where to give this command, after firing the shutdown command the shell is no longer exist.
i am trying to say that how can we cancel the on going shutdown process and how much time we have? means is there any particular process, this cancelling command works before that process get killed.
 
Old 01-13-2011, 02:28 PM   #7
cin_
Member
 
Registered: Dec 2010
Posts: 277

Rep: Reputation: 24
shutdown -c

You will want to move to another terminal or tty instance.
If in X, just open another terminal and type...
Code:
# shutdown -c
Or if you are on the command line, you can hit Ctrl-Alt-F#, be it F2, F3... to open another instance, log in, and type your command...
Code:
# shutdown -c
..to cancel the shutdown.

Last edited by cin_; 01-13-2011 at 02:53 PM.
 
Old 01-14-2011, 10:00 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Quote:
Originally Posted by aggrishabh View Post
Hi bathory,

where to give this command, after firing the shutdown command the shell is no longer exist.
i am trying to say that how can we cancel the on going shutdown process and how much time we have? means is there any particular process, this cancelling command works before that process get killed.
shutdown -c works only if you've used the time option to shudown, like shutdown -h +1. Otherwise it's not possible to stop it.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where I can locate Shutdown log for Linux Shutdown (RHL 5.1-2.6.18-53.el5PAE) msmallya Linux - General 2 04-23-2010 02:56 AM
Unable to shutdown/reboot server, no shutdown process running dctw Linux - Server 5 03-31-2010 06:46 AM
User shutdown - 'cp -i -p shutdown /usr/sbin/shutdown2 - why does this not work, can? mitchellray Linux - Desktop 4 03-20-2009 10:31 PM
My Linux box does not shutdown i do when i do /sbin/shutdown -h now yawe_frek Linux - Hardware 6 09-14-2007 08:48 AM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 07:21 PM


All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration