shutdown

If none of the more specific forums is the right place to ask

shutdown

Postby sylvesterk » 2006-12-27 20:30

How can I shutdown my PC without going to the root?


Before I upgrade my kernel to 2.4.8, my pc was able to turn the power off automatically, now I have to turn off the power manually, how can I have it auto power off? Thanks
sylvesterk
 
Posts: 27
Joined: 2006-12-23 01:05

Postby Dargor » 2006-12-28 01:37

upgraded to 2.4.8 thats kind of out of date to be an UPgrade, the power of function is a kernel thing your kernel needs to know how tell the pc to power off, im not sure but that kernel may not support that feature. try with a more UP to date kernel, try for a 2.6 kernel if you can.
User avatar
Dargor
 
Posts: 671
Joined: 2006-08-14 08:54
Location: New Zealand, Hamilton

shutdown

Postby sylvesterk » 2006-12-28 06:41

Excuse me for the miss-typing.

I actually upgrade the kernel from 2.4.27.to 2.6.8 in order to make my sound card works.


How can I shutdown without going to root? Why it didn't power down automatically after upgrade? Thanks
sylvesterk
 
Posts: 27
Joined: 2006-12-23 01:05

Re: shutdown

Postby Lou » 2006-12-28 20:28

sylvesterk wrote:How can I shutdown without going to root?


You have to be ROOT to shutdown, or USER if you use 'sudo'. Homework=google

Why it didn't power down automatically after upgrade? Thanks


No idea. In my old box,
1. I installed the package apmd and rebooted.
2. Started the installation with the parameters:
noapic nolapic
3. Added this line to the file /etc/modules:

apm power_off=1

I shutdown the box with:

$ sudo halt
or
# shutdown -h now

You're gonna have to play with it and google a bit.
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Postby mzilikazi » 2006-12-29 02:21

Yep you need sudo. One way to do it is to add this to /etc/sudoers:
Code: Select all
USERS   ALL = NOPASSWD: SHUTDOWN
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby sylvesterk » 2006-12-29 04:18

The purpose of being able to shutdown without going to root is when you have a guest, you don't want want him to be an administrator and able able to mess up your OS. Thanks
sylvesterk
 
Posts: 27
Joined: 2006-12-23 01:05

Postby Lou » 2006-12-29 12:21

sylvesterk wrote:The purpose of being able to shutdown without going to root is when you have a guest, you don't want want him to be an administrator and able able to mess up your OS. Thanks


Yeah, but you didn't say that in your initial post. :)

there is an option for it, man or google sudo.
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

shutdown

Postby pl@yer » 2006-12-29 18:21

check out /etc/shutdown.allow and the shutdown -a switch should allow non root user to shutdown.
User avatar
pl@yer
 
Posts: 350
Joined: 2006-07-15 01:35
Location: next cubicle

Postby plugwash » 2006-12-30 00:21

sylvesterk wrote:The purpose of being able to shutdown without going to root is when you have a guest, you don't want want him to be an administrator and able able to mess up your OS. Thanks

the reason that only root can use the shutdown commnds is because of *nix's background as a multiuser OS, you don't wan't anyone who can get a shell on your server to be able to shut it down.

kdm by default allows shutdown from the login dialog which is a reasonable setup for most desktops imo (since someone with physical access to the box also likely has access to the power switch ;) ), i didn't see any such options on debians default gdm or xdm setups but they may be able to be configured to offer it.

sudo is another soloution though i'd wan't it rather more locked down than the setup suggested here which allows anyone who can get a shell on your box by any means to shut it down.
plugwash
 
Posts: 2508
Joined: 2006-09-17 01:10

Postby sylvesterk » 2007-01-02 17:14

I see the point that when used as a server, we don't want any user to shutdown as he wishes. When used as an ordinary desktop pc, we should give another user to shutdown after he is done. Thanks for all the input.
sylvesterk
 
Posts: 27
Joined: 2006-12-23 01:05


Return to General Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable