Results 1 to 4 of 4

Thread: abort shutdown

  1. #1
    Join Date
    Feb 2012
    Beans
    81

    abort shutdown

    Is it possible to abort a shutdown using a shutdown script based on a certain condition?

    eg rc.local script

    if conition = true

    abort shutdown command here

    fi

    what would the command be? Or is it just a paticular exit number??

  2. #2
    Join Date
    Apr 2012
    Beans
    6,930

    Re: abort shutdown

    you mean like shutdown -c ?

    Code:
    NAME
           shutdown - bring the system down
    
    SYNOPSIS
           shutdown [OPTION]...  TIME [MESSAGE]
    
    DESCRIPTION
           shutdown  arranges  for the system to be brought down in a safe way.  All logged-in users are notified that the system is going down and, within
           the last five minutes of TIME, new logins are prevented.
    .
    .
    .
    
    OPTIONS
           -r     Requests that the system be rebooted after it has been brought down.
    
           -h     Requests  that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the sysâ
                  tem.
    
           -H     Requests that the system be halted after it has been brought down.
    
           -P     Requests that the system be powered off after it has been brought down.
    
           -c     Cancels a running shutdown.  TIME is not specified with this option, the first argument is MESSAGE.
    
           -k     Only send out the warning messages and disable logins, do not actually bring the system down.

  3. #3
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: abort shutdown

    You mean like a basic terminal command? I generally use:

    Code:
    shutdown -h -P now
    I imagine at least one of those flags is not required in Ubuntu, but it won't throw up an error, and I like to be verbose for the practice.

  4. #4
    Join Date
    Feb 2012
    Beans
    81

    Re: abort shutdown

    if shutdown -c does it that would be great.

    I'll try it out.

    In my sleep.d suspend script the script just exits if the condition is met rather than issuing a counter command and the machine does not suspend. I though there may be somethine like this.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •