LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 02:22 PM   #1
Jeays
LQ Newbie
 
Registered: May 2011
Location: Carleton Place, Ontario, Canada
Distribution: Mint, Ubuntu, Linux lite
Posts: 16

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, 02:57 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,877
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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, 03:39 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,770

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
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, 06:39 PM   #4
Jeays
LQ Newbie
 
Registered: May 2011
Location: Carleton Place, Ontario, Canada
Distribution: Mint, Ubuntu, Linux lite
Posts: 16

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, 06:52 PM   #5
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Hi:

Code:
sudo shutdown -h now
Should do it:-
 
Old 10-28-2015, 01:43 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,770

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
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, 02: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 10:12 PM
[SOLVED] Hibernate and automatic shutdown does not work anemone42 Linux - Newbie 8 10-06-2011 07:11 PM
User shutdown - 'cp -i -p shutdown /usr/sbin/shutdown2 - why does this not work, can? mitchellray Linux - Desktop 4 03-20-2009 09:31 PM
KInternet cant work after shutdown! bin75 Linux - Wireless Networking 0 07-17-2005 09:49 AM
/etc/shutdown.allow donst seem to work ? qwijibow Linux - Newbie 1 02-07-2004 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:38 PM.

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
Open Source Consulting | Domain Registration