LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-20-2005, 01:55 PM   #1
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
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?
 
Old 12-20-2005, 02:25 PM   #2
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
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.
 
Old 12-20-2005, 03:55 PM   #3
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Original Poster
Rep: Reputation: 30
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."
 
Old 12-20-2005, 04:07 PM   #4
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
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
 
Old 12-20-2005, 04:56 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
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.
 
Old 12-20-2005, 05:17 PM   #6
ringwraith
Senior Member
 
Registered: Sep 2003
Location: Indiana
Distribution: Slackware-current
Posts: 1,244

Rep: Reputation: 47
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
 
Old 12-20-2005, 05:27 PM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
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.
 
Old 12-21-2005, 03:17 AM   #8
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
poweroff and shutdown with own user jaakkop Linux - General 6 12-29-2005 10:07 PM
Can't "shutdown -a -r now" as a normal user, though shutdown.allow exists mnemonic Linux - Software 5 08-15-2005 06:49 PM
Using shutdown as user bluesmanu Linux - General 1 05-25-2005 08:40 AM
shutdown user alaios Linux - General 14 07-09-2004 08:49 AM
can't shutdown as user InK Linux - General 1 07-02-2003 04:15 PM


All times are GMT -5. The time now is 10:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration