Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-17-2003, 07:47 PM
|
#1
|
Member
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987
Rep:
|
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
|
|
|
10-17-2003, 08:05 PM
|
#2
|
Member
Registered: Oct 2003
Location: North Carolina, USA
Distribution: Slackware 11
Posts: 174
Rep:
|
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.
|
|
|
10-17-2003, 09:39 PM
|
#3
|
Member
Registered: Nov 2002
Distribution: Slackware
Posts: 155
Rep:
|
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.
|
|
|
10-17-2003, 10:18 PM
|
#4
|
Member
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987
Original Poster
Rep:
|
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?
|
|
|
10-17-2003, 10:43 PM
|
#5
|
Member
Registered: Oct 2003
Location: North Carolina, USA
Distribution: Slackware 11
Posts: 174
Rep:
|
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?
|
|
|
10-19-2003, 01:44 PM
|
#6
|
Member
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987
Original Poster
Rep:
|
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)
|
|
|
11-30-2003, 03:29 PM
|
#7
|
Member
Registered: Jun 2003
Location: Raleigh, NC, US
Distribution: Slackware
Posts: 63
Rep:
|
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
|
|
|
12-12-2003, 07:54 PM
|
#8
|
Member
Registered: Sep 2003
Location: Stevenson, WA, USA
Distribution: Slackware
Posts: 232
Rep:
|
You could just put a shortcut on their toolbars to "sudo /sbin/halt"
|
|
|
12-12-2003, 08:46 PM
|
#9
|
Member
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987
Original Poster
Rep:
|
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
|
|
|
12-12-2003, 08:56 PM
|
#10
|
Senior Member
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104
Rep:
|
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
|
|
|
12-12-2003, 10:56 PM
|
#11
|
Member
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582
Rep:
|
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}
|
|
|
12-17-2003, 08:55 PM
|
#12
|
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:
|
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
|
|
|
12-17-2003, 11:10 PM
|
#13
|
Member
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 10:14 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|