Click to See Complete Forum and Search --> : individual shutdowns: help please


katanastab
11-19-2001, 11:00 PM
Hello,
I set up a little linux box for my dad to type up his work on an old Pentium lying around.
So far it works great, I had him set up using KDE and it runs smooth.
Yet, i'm pretty new to linux myself.
The problem I'm having is I need to go in to root before I can shut down the system.
Is there any way I can allow a user, instead of root to shut down?
And i don't want to use the su command.
I have Caldera OpenLinux 1.3 if that's any help, thanks in advance.

error27
11-19-2001, 11:38 PM
a lot of distros seem to set it up so if users press ctrl-alt delete the computer shuts down.

couldn't hurt to try.

Jinx
11-19-2001, 11:43 PM
Greetings,

Well there might be an easier way than this, but this is how I would do it.

If you go into console and change to the /sbin directory, you should find shutdown listed in here.

If you run a:

ls -l shutdown (list properties of shutdown)

This should bring up something as follows:

-rwxr-xr-x 1 root root <date info>

I am not sure how much you know about permissions, but basically on the left you have the permissions for the user,group and everyone else... here it is rwx for the user, r-x and r-x for the group and everyone else (confused you yet?).

In the middle you have your user and group, which happen to be root and root. So translated to english:

The user root has read, write, execute to the file, where the group root and everyone else only have read and execute.

I think to be able to execute the shutdown command you need read,write execute to it... so what you need to do is either change the permissions on the file using chmod, add your dad into the root group (not advisable) or change the group ownership of the file using chgrp to a user group that your dad is part of, then chmod the file for the group to be able to read,write and execute (just like the root user).

As I said before, this might not be the correct way to go about it, and it is alot to take in just to be able to shutdown in usermode.

My advise is to read up a bit on permissions and changing them as it is handy to know, test it on some other files that are not located in your system bin (sbin) directory and give it a go. I am not sure whether it is advised that ya stuff around with files in /sbin. I would, but it doesn't make it right. :P

Someone else might have a better answer? ;)

Otherwise you could always try alt+ctrl+del and turn off the machine at the BIOS boot. Works to the same effect and anyone can do it.

Hope that helped...

Cya round
Jinx

camelrider
11-20-2001, 04:11 AM
In /etc/inittab look for the line like this:

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

Change the "-r" (reboot) to "-h" (halt).

That will give you a fairly safe shutdown. It is probably better to logout of X before running cntrl-alt-del because your window manager may do a better job of closing X apps and may prompt to save working files. Also, Netscape should be closed manually as otherwise it leaves behind a lock file in ~/.netscape/ that interferes with reopening it.

MarkLeong
11-20-2001, 04:26 AM
I am not sure about KDE but in GNOME (Redhat 7.1), I click on logout (from the footprint) and it will prompt me if I want to logout to terminal or halt the system. I select halt to bring the system down.

Hena
11-20-2001, 07:24 AM
If you are using KDE. Go to KDE control center. In there System -> Login Manager. Then you get a list of tabs on the right side, choose sessions. In there you have "allow shutdown". Take your pick in what you want in there.