Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

(IceWM) shutdown

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
isilia
Posts: 112
Joined: 2007-11-10 15:31
Location: The Netherlands
Contact:

(IceWM) shutdown

#1 Post by isilia »

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!

Silenus
Posts: 98
Joined: 2007-08-31 22:10

#2 Post by Silenus »

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.

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

#3 Post by llivv »

'
Last edited by llivv on 2019-02-16 20:51, edited 1 time in total.

Azriel
Posts: 150
Joined: 2007-07-01 19:03

#4 Post by Azriel »

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

User avatar
isilia
Posts: 112
Joined: 2007-11-10 15:31
Location: The Netherlands
Contact:

#5 Post by isilia »

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
987687
Posts: 2110
Joined: 2007-06-11 10:58
Location: Vacation Land

#6 Post by 987687 »

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

Lou
Posts: 1739
Joined: 2006-05-08 02:15

#7 Post by Lou »

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

http://forums.debian.net/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: 1739
Joined: 2006-05-08 02:15

Re: (IceWM) shutdown

#8 Post by Lou »

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

Azriel
Posts: 150
Joined: 2007-07-01 19:03

#9 Post by Azriel »

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.

User avatar
isilia
Posts: 112
Joined: 2007-11-10 15:31
Location: The Netherlands
Contact:

#10 Post by isilia »

Thanks Lou (and everyone else), that worked.
Cult of the sitting penguin!

Post Reply