Author Topic: "shutdown now && poweroff" working without root password  (Read 458 times)

Offline aguila

  • Hero Member
  • *****
  • Posts: 1210
  • soaring high = no Windows here :-D
"shutdown now && poweroff" working without root password
« on: May 20, 2011, 08:14:05 AM »
Hi,

I thought
Code: [Select]
shutdown now && poweroff was only possible as root, at least that's what I'm told when I enter it in a terminal as user.

In another thread bicol_willem gave me a hint that he places a desktop icon for shutdown, command: "halt"

As my parents already had the issue of the shutdown widget not working three times, I thought this might work. So I created a menu icon, but entered the command
Code: [Select]
shutdown now && poweroff.

When I click the entry, a window pops up asking me for the root password. After entering the computer shuts down.

If I click "abort" the system shuts down the same way without asking for the password.

I wasn't able to find out if it really performs the same procedure in both cases.

Is there anyone more knowlagable than me who could explain what is going on? Shouldn't "Abort" bring me back to the desktop?
All that is is good. PCLinuxOS is.

Thinkpad X61 Tablet, Core2Duo 1.66 MHz, 4 GB Ram, Intel onboard Graphics, Plextor PX-256M3 256 GB SSD; Thinkpad R61i, Core2Duo 1.66 MHz, 2 GB Ram, Intel onboard graphics, 120 GB HDD

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6377
  • I'm going South
Re: "shutdown now && poweroff" working without root password
« Reply #1 on: May 20, 2011, 09:59:14 AM »
I haven't tested it but I think it's the shutdown command that asks for your root password. And when you abort, you just abort shutdown, after which poweroff is run -- shutting down and powering off.

Try just using "poweroff".
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline aguila

  • Hero Member
  • *****
  • Posts: 1210
  • soaring high = no Windows here :-D
Re: "shutdown now && poweroff" working without root password
« Reply #2 on: May 20, 2011, 10:06:37 AM »
Thank you for the explanation Bald Brick.

But now I'm completely confused... when should I use "shutdown" if "poweroff" includes "shutdown"? And is there a difference between "poweroff" and "halt"?

Could you point me to a reference where I can read up on this?

TIA
« Last Edit: May 20, 2011, 10:09:55 AM by aguila »
All that is is good. PCLinuxOS is.

Thinkpad X61 Tablet, Core2Duo 1.66 MHz, 4 GB Ram, Intel onboard Graphics, Plextor PX-256M3 256 GB SSD; Thinkpad R61i, Core2Duo 1.66 MHz, 2 GB Ram, Intel onboard graphics, 120 GB HDD

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3791
Re: "shutdown now && poweroff" working without root password
« Reply #3 on: May 20, 2011, 10:21:24 AM »
info poweroff | less

This will give you a scrollable version of the info pages. You can put any command in place of poweroff, if there is an info page for it.

Galen

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6377
  • I'm going South
Re: "shutdown now && poweroff" working without root password
« Reply #4 on: May 20, 2011, 10:22:52 AM »
Thank you for the explanation Bald Brick.

But now I'm completely confused... when should I use "shutdown" if "poweroff" includes "shutdown"? And is there a difference between "poweroff" and "halt"?

Could you point me to a reference where I can read up on this?

TIA

Well, /sbin/poweroff is just a symlink to /sbin/halt.

There's also a /usr/bin/poweroff, which is a link to /usr/bin/consolehelper, as is /usr/bin/halt. I haven't checked what either command actually starts.

A few years ago halt used to be an alias of shutdown -h now. But not anymore.
« Last Edit: May 20, 2011, 10:39:25 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D