You are not logged in.

#1 2008-10-24 02:53:12

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,545

Power off / reboot as normal user

I find it a little odd/disturbing that while I can't turn off my PC or reboot it cleanly without using sudo or similar (and I'm okay with this), DEs like KDE or GNOME can. How are they turning off the system? They're obviously not using the traditional /usr/sbin/poweroff and reboot apps/scripts... I know I can make it so normal users can power off the system by way of sudo without ever having to explicity use sudo or type in a password again, I'm just curious as to how the DEs are doing it without all that.

Thanks!

Offline

#2 2008-10-24 04:17:40

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Power off / reboot as normal user

I think that they relay on login managers for this functionality (login managers are running with root privileges).  Try running Gnome without a login manager (using startx instead) and you'll notice that all the power off/reboot/etc. options disappear from the end session menu.

Offline

#3 2008-10-24 08:12:49

phisphere
Member
From: Tallinn, Estonia
Registered: 2007-03-05
Posts: 136
Website

Re: Power off / reboot as normal user

chmod +s /sbin/halt

this command allows running commands like halt and reboot with normal user.

Offline

#4 2008-10-24 10:13:55

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,545

Re: Power off / reboot as normal user

@phisphere: I don't want to know how I can enable normal users to perform those operations, I want to know how Gnome, KDE, etc. are already doing it smile

@fwojciec: Good idea, I'll check into that. Awesome avatar, BTW.

Offline

#5 2008-10-24 13:05:42

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Power off / reboot as normal user

be sure that you have hal in daemons and your username is in power group


Give what you have. To someone, it may be better than you dare to think.

Offline

Board footer

Powered by FluxBB