(IceWM) shutdown

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

(IceWM) shutdown

Postby isilia » 2007-11-16 20:16

Yesterday I decided to do a minimal installation on a 128 mb RAM, 7-year-old PC. By now I got everything working (thank you, google!), except for that I can't shutdown the PC from within iceWM.

Basically all I need is shutdown to work for non-root users (with minimal security loss)
Cult of the sitting penguin!
User avatar
isilia
 
Posts: 112
Joined: 2007-11-10 15:31
Location: The Netherlands

Postby Silenus » 2007-11-17 03:08

Icewm should have a shutdown script in the menu, if not create one that uses sudo.

sudo shutdown -h now

Omit the h option if you don't want it to halt, but I am sure you know that.
Silenus
 
Posts: 98
Joined: 2007-08-31 22:10

Postby llivv » 2007-11-17 05:53

if you installed lenny you could take a look at qingy
I just checked and it's not in etch :cry:
User avatar
llivv
 
Posts: 5586
Joined: 2007-02-14 18:10
Location: willo the tree

Postby Azriel » 2007-11-17 12:25

If you do not use any login manager, i think you can't shutdown without tweaking a bit.

In your /etc/inittab there is a way to shutdown your computer without being root. The passage about "# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now"

You just have to change the -r flag by -h, so your computer halt instead of rebooting. AFAIK, you need to be in console mode in order for the ctrl-alt-del command to work, so you'll need to kill your X server before... That's not the best way i guess, but that's still not bad.

A "good" way to do it would be to halt using your terminal, but if i understand you right, you want to halt using the GUI way. Then i guess than you have to create your own script, either by putting a sudo halt in it, or by killing X and then make it reboot using the /etc/inittab options.


[EDIT]: i also found that by googling around. Not sure what's it's worth, but it should work: http://ubuntuforums.org/showthread.php?t=134968
Azriel
 
Posts: 150
Joined: 2007-07-01 19:03

Postby isilia » 2007-11-17 13:21

Silenus wrote:Icewm should have a shutdown script in the menu, if not create one that uses sudo.

sudo shutdown -h now

Omit the h option if you don't want it to halt, but I am sure you know that.


I rather not use sudo, as that would require using the root password.

llivv wrote: if you installed lenny you could take a look at qingy
I just checked and it's not in etch Crying or Very sad


I use Lenny, Quingy looks nice - although I still prefer not using any log in manager at all (as autologin works already)

Azriel wrote: In your /etc/inittab there is a way to shutdown your computer without being root. The passage about "# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now"

You just have to change the -r flag by -h, so your computer halt instead of rebooting. AFAIK, you need to be in console mode in order for the ctrl-alt-del command to work, so you'll need to kill your X server before... That's not the best way i guess, but that's still not bad.


Well, that isn't really an option as I won't be using the PC myself, my dad will.

[EDIT]: i also found that by googling around. Not sure what's it's worth, but it should work: http://ubuntuforums.org/showthread.php?t=134968


I'll try that in a bit, I'll let you know if it worked - thanks everyone!
Cult of the sitting penguin!
User avatar
isilia
 
Posts: 112
Joined: 2007-11-10 15:31
Location: The Netherlands

Postby 987687 » 2007-11-17 13:22

Sometimes computers will just shut down when you press the power button. Or if you go to a terminal and press CTRL+ALT+DEL it will reboot.
Desktop - 3.2GHz core2 quad
Laptop - 2.4GHz core2 duo ancient macbook
Bring back the penguin!! http://tinyurl.com/d57jwv
User avatar
987687
 
Posts: 2118
Joined: 2007-06-11 10:58
Location: Vacation Land

Postby Lou » 2007-11-17 13:56

If you check the HOWTO: IceWM Basic Configuration on this site, in the Documentation section of howtos, tips and tricks:

viewtopic.php?t=5450

there is no need to go to ubuntu forums :)
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Re: (IceWM) shutdown

Postby Lou » 2007-11-17 14:21

isilia wrote:
Basically, all I need is shutdown to work for non-root users (with minimal security loss)


Go to /etc/sudoers and add this line using the name for the user you want to be able to shutdown or reboot.

username ALL = NOPASSWD: /sbin/halt, /sbin/reboot

Add these lines to your .icewm/preferences:

ShutdownCommand="sudo halt"
RebootCommand="sudo reboot"

save/exit/
restart (ctrl+alt+delete+r)

From now on the 'user' presses the Windows key + spacebar to make the taskbar a Run box, and types:

sudo halt or
sudo reboot

Note: if the user does not have a Windows key, ctrl+alt will do.

voilà!
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Postby Azriel » 2007-11-17 14:44

Lou wrote:there is no need to go to ubuntu forums :)


Actually almost everytime i'm looking for doing something without being root, i end up in ubuntu forums :lol:
Last edited by Azriel on 2007-11-17 16:08, edited 1 time in total.
Azriel
 
Posts: 150
Joined: 2007-07-01 19:03

Postby isilia » 2007-11-17 15:41

Thanks Lou (and everyone else), that worked.
Cult of the sitting penguin!
User avatar
isilia
 
Posts: 112
Joined: 2007-11-10 15:31
Location: The Netherlands

Postby llivv » 2007-11-18 16:40

Sorry, I should have done a bit more looking into qingy myself before posting it.
Bug # 447512
User avatar
llivv
 
Posts: 5586
Joined: 2007-02-14 18:10
Location: willo the tree


Return to General Questions

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable