LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How can I shutdown as a user from KDE? (https://www.linuxquestions.org/questions/slackware-14/how-can-i-shutdown-as-a-user-from-kde-394960/)

vasudevadas 12-20-2005 01:55 PM

How can I shutdown as a user from KDE?
 
I have found the instructions on how to shutdown as a regular user by using sudo here:

http://www.linuxquestions.org/questi...t=kde+shutdown

and I have edited my /etc/sudoers.tmp as instructed. This takes me halfway there; I can now tell people how to turn my machine off without telling them the root password (or logging them in myself).

However, all other distros I have tries give me a "shutdown" option in KDE, which is really what I want, but a Slackware installation never seems to have this facility. How may I sort this out for myself?

Finlay 12-20-2005 02:25 PM

you need to change the run level at boot to go into X
then you will have a shutdown option at the KDE menu.
if you system boots to command prompt then that is where you will go after you close KDE.

vasudevadas 12-20-2005 03:55 PM

No, if I close X and then do "init 4" there is still no shut down option in the KDE menu. If I choose "Log out..." the only choices are "end current session" and "cancel."

Finlay 12-20-2005 04:07 PM

i found this googling:
http://gnuru.org/index.pl?node_id=854

if you edited your sudo file then i would just make a button on the panel that runs shutdown -h now

Woodsman 12-20-2005 04:56 PM

Quote:

How can I shutdown as a user from KDE?
Perhaps I'm missing the big picture of your actual problem, but when you exit KDE you will see two different dialog boxes depending upon the runlevel from which you started KDE.

If you start KDE from runlevel 3, and start KDE from the command line with startx (which runs the appropriate xinitrc script), then when you exit KDE all you will see is a simple exit dialog box and you'll be returned to the command line. From the command line you need root privileges to run the halt command. In that case you need to modify the sudo list to allow non-root users to shutdown the box, or you can su -c.

If you start KDE from runlevel 4 the KDM login manager controls your KDE session, shutdown, and rebooting. In that mode the shutdown options for KDE are controlled in the Control Center (KControl). The following modifications affect the KDM login manager only, which is run from runlevel 4.

1. Open the Control Center.
2. Select System Administration.
3. Select Login Manager.
4. Select the Administrator Mode button.
5. Enter the root password.
6. Select the Shutdown tab.
7. For local shutdown select Everybody.

If you want to shutdown the box from within KDE, then you should modify the default runlevel from 3 to 4:

1. Obtain root privileges.

2. Use a text editor to open the /etc/inittab configuration file.

3. Near the beginning of the configuration file, just after the initial comments section, look for two lines that looks like this:

# Default runlevel. (Do not set to 0 or 6)
id:3:initdefault:


4. The second line instructs the init command to boot into runlevel 3.

5. Modify that second line to the following:

id:4:initdefault:

6. The second line will now instruct the init command to boot into runlevel 4.

7. Save and exit the file.

By default the system now will now boot into runlevel 4.

I hope this helps.

ringwraith 12-20-2005 05:17 PM

Very well done Woodsman. You ought to try putting together some other instructional FAQs. I thought they were working on something like that here but haven't seen anything about it in some months.

If you don't want to use sudo you can also change the permissions on halt so they don't have your root password but can still shutdown. chmod +s /sbin/halt

Woodsman 12-20-2005 05:27 PM

Quote:

Very well done Woodsman.
Thank you!

Quote:

You ought to try putting together some other instructional FAQs.
In progress! I've been working on a personal web site for the past few weeks. That danged time domain tends to get in the way, however. :) Actually, I hope to go live soon---. The link then will be included in my LQ signature.

vasudevadas 12-21-2005 03:17 AM

Woodsman, if you were to turn that into a howto, one thing you should add. A Slackware installation by default uses GDM.

That was my problem. Once I had modified my /etc/rc.d/rc.4 script to try KDM first, I can now shut down my machine as a user without needing to type any commands in.

Now, when my friend comes to visit I can create a user for him so that he can use my computer and shut it down without needing to know any shell commands. :)

Thanks all.


All times are GMT -5. The time now is 09:58 PM.