Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19th July 2005, 04:40 AM
aab45 Offline
Registered User
 
Join Date: Feb 2005
Posts: 3
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?
Reply With Quote
  #2  
Old 19th July 2005, 01:29 PM
jtang613's Avatar
jtang613 Offline
Registered User
 
Join Date: Apr 2004
Location: Ottawa, Canada
Posts: 1,932
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.
Reply With Quote
Reply

Tags
poweroff, reboot, shutdown

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
F8 : No Shutdown in menu, Login Screen is weird, Can't Shutdown only reboot megat Using Fedora 5 19th November 2007 11:00 AM


Current GMT-time: 16:26 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat