FedoraForum.org - Fedora Support Forums and Community
Results 1 to 2 of 2
  1. #1
    aab45 Guest

    Shutdown -h vs. Poweroff / Shutdown -r vs. Reboot

    Does anyone know what the differences are between these commands?

    shutdown -r vs. reboot

    shutdown -h vs. poweroff

    I know that poweroff actually turns off power to the system while 'shutdown -h' does not.

    Are there any other differences between the above commands?

  2. #2
    Join Date
    Apr 2004
    Location
    Ottawa, Canada
    Posts
    1,930
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The reboot and poweroff commands in the /usr/bin directory are symbolic links to /usr/bin/consolehelper. These are the default commands for normal users.

    Quote Originally Posted by consolehelper manpage
    consolehelper is a tool that makes it easy for console users to run
    system programs, doing authentication via PAM (which can be set up to
    trust all console users or to ask for a password at the system adminis-
    trator’s discretion). When possible, the authentication is done graph-
    ically; otherwise, it is done within the text console from which con-
    solehelper was started.

    It is intended to be completely transparent. This means that the user
    will never run the consolehelper program directly. Instead, programs
    like /sbin/shutdown are paired with a link from /usr/bin/shutdown to
    /usr/bin/consolehelper. Then when non-root users (specifically, users
    without /sbin in their path, or /sbin after /usr/bin) call the "shut-
    down" program, consolehelper will be invoked to authenticate the action
    and then invoke /sbin/shutdown. (consolehelper itself has no priv-
    iledges; it calls the userhelper(8) program do the real work.)

    consolehelper requires that a PAM configuration for every managed pro-
    gram exist. So to make /sbin/foo or /usr/sbin/foo managed, you need to
    create a link from /usr/bin/foo to /usr/bin/consolehelper and create
    the file /etc/pam.d/foo, normally using the pam_console(8) PAM module.
    The root user, by default, executes those commands from /sbin. The poweroff and reboot commands in /sbin are symbolic links to the 'halt' executable. Which itself is really just a wrapper for the 'shutdown program.

    Quote Originally Posted by halt manpage
    Halt notes that the system is being brought down in the file
    /var/log/wtmp, and then either tells the kernel to halt, reboot or
    poweroff the system.

    If halt or reboot is called when the system is not in runlevel 0 or 6,
    in other words when it’s running normally, shutdown will be invoked
    instead (with the -h or -r flag). For more info see the shutdown(8)
    manpage.
    All this tangled mess is setup to allow normal users (with proper permission) to poweroff or reboot the system without being root.

    hth,
    Jason
    There is no 'CTRL' button on Chuck Norris's computer. Chuck Norris is always in control.

Similar Threads

  1. Replies: 5
    Last Post: 19th November 2007, 12:00 PM

Tags for this Thread

Posting Permissions

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