LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-17-2003, 07:47 PM   #1
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
can normal user do shutdown?


while it is no problem for me, the rest of the family finds that having to open a terminal and remember to type su - and then do halt to do shutdown really annoys them

can i get it so that when i select logoff from the menu i get an option to shutdown/reboot (as user)

i boot into runlevel 4 so this should be do-able
 
Old 10-17-2003, 08:05 PM   #2
187807
Member
 
Registered: Oct 2003
Location: North Carolina, USA
Distribution: Slackware 11
Posts: 174

Rep: Reputation: 30
Re: can normal user do shutdown?

Quote:
Originally posted by TheOneAndOnlySM
while it is no problem for me, the rest of the family finds that having to open a terminal and remember to type su - and then do halt to do shutdown really annoys them

can i get it so that when i select logoff from the menu i get an option to shutdown/reboot (as user)

i boot into runlevel 4 so this should be do-able

I make the robust assumption that you are using Gnome when I ask you to check

this post

and

this post.


I tried both (Slack 9.1 w/Gnome 2.4.0) to the extent that the options for the appearance of the shutdown/reboot options do seem to exist (although I did not actually TRY them as I boot into a text login...I'll leave it up to you to try the suggestions in those posts).

This may get you what you're looking for.
 
Old 10-17-2003, 09:39 PM   #3
Bluesuperman
Member
 
Registered: Nov 2002
Distribution: Slackware
Posts: 155

Rep: Reputation: 30
Well - I have never used X to shutdown my system. But I have setup "sudo" to allow some regular users to shutdown or reboot the system.

%loginloc roadwarrior = NOPASSWD: /sbin/reboot,/sbin/shutdown -h now

I added the above line to my sudoers file in /etc/, it allows any member of the loginloc (local login) group to run the commands /sbin/shutdown and reboot with not needing the root password on the machine called roadwarrior.
 
Old 10-17-2003, 10:18 PM   #4
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Original Poster
Rep: Reputation: 30
hmm, cool idea, but still the family insists on using a graphical shutdown and not need to type anything

i looked at my gdm.conf in /etc/X11/gdm and did not find the specified line system_menu_disabled

other suggestions?
 
Old 10-17-2003, 10:43 PM   #5
187807
Member
 
Registered: Oct 2003
Location: North Carolina, USA
Distribution: Slackware 11
Posts: 174

Rep: Reputation: 30
Did you look for this?

Quote:
Originally posted by TheOneAndOnlySM
hmm, cool idea, but still the family insists on using a graphical shutdown and not need to type anything

i looked at my gdm.conf in /etc/X11/gdm and did not find the specified line system_menu_disabled

other suggestions?


SystemMenu=false


and set it to

SystemMenu=true

?

Did you try using:

gdmconfig


from a console (logged as root) within X?
 
Old 10-19-2003, 01:44 PM   #6
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Original Poster
Rep: Reputation: 30
ok, the systemmenu=true thing worked, but i now need to log out and then from there click system and shutdown

here's something bad i did
i logged in as root with gui and when i click logout from there, i actually right there get a dialog asking to logout, reboot, or shutdown

why can't i get the user accounts to have this?

(yes, my family is that picky)
 
Old 11-30-2003, 03:29 PM   #7
laydros
Member
 
Registered: Jun 2003
Location: Raleigh, NC, US
Distribution: Slackware
Posts: 63

Rep: Reputation: 15
bump^^^^


id really like to see the answer to that, ive been searching here for quite a while, and i keep seeing people say gdm.

the quick answer for slack is to get dropline, by default it lets users logout the way mentioned above, and also gives the x sudo thing, where if you try to run something that can only be run by root in x (like gdmconfig) it pops up a prompt for password.

im now using arch, and would like to know how to enable both of those things

thanks if anyone can help
 
Old 12-12-2003, 07:54 PM   #8
Berto
Member
 
Registered: Sep 2003
Location: Stevenson, WA, USA
Distribution: Slackware
Posts: 232

Rep: Reputation: 30
You could just put a shortcut on their toolbars to "sudo /sbin/halt"
 
Old 12-12-2003, 08:46 PM   #9
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Original Poster
Rep: Reputation: 30
hmmm, didn't expect to see this post again

but hey, that's not a bad idea

i haven't tried sudo yet, i'll give it a shot
 
Old 12-12-2003, 08:56 PM   #10
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
With KDM you can ( you get all the options) - under KDE if you want to use KDM just make sure the GDM entry in /etc/rc.d/rc.4 is commented out... ie

# Try to use GNOME's gdm session manager:
#if [ -x /usr/bin/gdm ]; then
#exec /usr/bin/gdm -nodaemon
#fi
 
Old 12-12-2003, 10:56 PM   #11
e1000
Member
 
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582

Rep: Reputation: 30
heres my answer (never tried it on shutdown or halt, but it seems to work with ppp-on and ppp-off for me)

Code:
chmod 750 /usr/sbin/*command*
ln -s /usr/sbin/*command* /usr/bin/
this allows normal users to have read access to the file and not have to type out its full path

then add the command to the menu of whatever WM/enviroment you use, for fluxbox one would need to add this to their "~/.fluxbox/menu"
Code:
      [exec] (shutdown) {halt}
 
Old 12-17-2003, 08:55 PM   #12
slightcrazed
Member
 
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Rep: Reputation: 30
OK.... ready?

First, make sure you have sudo installed. IF you do, as root:

# visudo

and add the line:

username ALL=NOPASSWD: /sbin/shutdown -h now, /sbin/shutdown -r now

at the bottom near the examples. Substitute username with your normal user's name (duh!).

Now, make sure you have the program xdialog (do a google for it and install if necessary). Xdialog allows you to make a nifty little GUI for any bash script you could write. I have made a simple one that mimics the windows style shutdown/restart menu. make a file in your $HOME dir called shtdwn.sh (or whatever) and put this in it:

Code:
#!/bin/sh
DIALOG=Xdialog
 
$DIALOG --title "SHUTDOWN" \
        --radiolist "choose:" 0 0 3\
        "-h"    "Shutdown" off \
        "-r"    "Restart" on 2>/tmp/checklist.tmp.$$
 
retval=$?
choice=`cat /tmp/checklist.tmp.$$`
rm -f /tmp/checklist.tmp.$$
 
case $retval in
  0)
    sudo /sbin/shutdown $choice now ;;
  1)
    echo "Cancel pressed.";;
  255)
    echo "Box closed.";;
esac
now, chmod the shtdwn.sh file:

chmod 777 shtdwn.sh

Now test it. In your $HOME dir as your normal user you should be able to:

./shtdwn.sh

and a little box will popup and ask if you want to shutdown or restart. pick one and hit OK. Your system should shutdown or reboot depending on your choice.

Now, just add a shortcut/icon on your desktop or a menu item that points to the shtdwn.sh script, and voila! instant GUI shutdown.

enjoy!

slight
 
Old 12-17-2003, 11:10 PM   #13
e1000
Member
 
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582

Rep: Reputation: 30
DUDE!! awesome, i can tell you put your fair share of time into that post, im deffinitely going to try that soon as im not studying for a forign language final.
 
  


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
Can't "shutdown -a -r now" as a normal user, though shutdown.allow exists mnemonic Linux - Software 5 08-15-2005 06:49 PM
can normal user use shutdown command? sorno Linux - Newbie 2 07-30-2005 06:11 AM
normal user running shutdown cblamer Slackware 6 12-21-2003 08:44 PM
Disable reboot/halt/shutdown as normal user carstenbjensen Mandriva 4 09-09-2003 11:42 AM
Normal User Restart and Shutdown InsaneBob Linux - Software 2 08-23-2003 05:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration