LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-27-2015, 03:22 PM   #1
Jeays
LQ Newbie
 
Registered: May 2011
Location: Carleton Place, Ontario, Canada
Distribution: Ubuntu
Posts: 11

Rep: Reputation: Disabled
Question Shutdown -c does not seem to work?


On my Mint 17 machine, "shutdown -c" does not seem to do anything. Even "killall -r shutdown" doesn't prevent the shutdown from taking place (it doesn't kill the process), and I have to use "killall -r -9 shutdown" to cancel the shutdown. All these tests have been run from the root account.

Any suggestions, please?
 
Old 10-27-2015, 03:57 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,096
Blog Entries: 10

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
That seems such an odd feature which I never knew even existed for shutdown, a way to cancel it. I'd be wary of what services were already stopped as a result of the time delay between when I started it and when I decided to cancel it. Since you can stop one in progress in some manner, I'd not be so fussed why a particular form of a command doesn't work as advertised. But I'd also highly recommend that if you actually do issue a shutdown, that you let it complete and not try to cancel it.
 
Old 10-27-2015, 04:39 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
You can cancel a shutdown that has been scheduled (e.g., "shutdown +10m") but has not yet begun. Once the actual shutting down procedure has begun, you can't cancel it. It's not clear which one the OP is trying to do.
 
Old 10-27-2015, 07:39 PM   #4
Jeays
LQ Newbie
 
Registered: May 2011
Location: Carleton Place, Ontario, Canada
Distribution: Ubuntu
Posts: 11

Original Poster
Rep: Reputation: Disabled
I am trying to cancel a shutdown part way through the period specified. This is exactly what "shutdown -c" is supposed to do. I am using apcupsd, using the "onbattery" script to issue a shutdown with a delay of 5 minutes, and the "offbattery" script to cancel the shutdown if the power is restored in that period. These scripts are run as root.

If I issue "shutdown -h +5 &" from a root terminal, and then "shutdown -c" from the same terminal after, say, one minute, it works fine. So I guess it must be something to do with the apcupsd environment.
 
Old 10-27-2015, 07:52 PM   #5
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 6,403
Blog Entries: 6

Rep: Reputation: Disabled
Hi:

Code:
sudo shutdown -h now
Should do it:-
 
Old 10-28-2015, 02:43 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Quote:
Originally Posted by Jeays View Post
I am trying to cancel a shutdown part way through the period specified. This is exactly what "shutdown -c" is supposed to do. I am using apcupsd, using the "onbattery" script to issue a shutdown with a delay of 5 minutes, and the "offbattery" script to cancel the shutdown if the power is restored in that period. These scripts are run as root.
Are there any SELinux denials associated with this?
What happens if you run the "shutdown -c" manually from a terminal after apcupsd has scheduled a shutdown?
 
Old 10-28-2015, 03:01 PM   #7
diseņo de paginasweb
LQ Newbie
 
Registered: Oct 2015
Posts: 8

Rep: Reputation: Disabled
thank for you help

Quote:
Originally Posted by Ztcoracat View Post
Hi:

Code:
sudo shutdown -h now
Should do it:-
this help me in my Linux
 
  


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
Shutdown sound fails to work satimis Fedora 1 08-18-2012 11:12 PM
[SOLVED] Hibernate and automatic shutdown does not work anemone42 Linux - Newbie 8 10-06-2011 08:11 PM
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
KInternet cant work after shutdown! bin75 Linux - Wireless Networking 0 07-17-2005 10:49 AM
/etc/shutdown.allow donst seem to work ? qwijibow Linux - Newbie 1 02-07-2004 01:32 PM


All times are GMT -5. The time now is 08:33 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