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.
|
|
01-22-2009, 09:50 PM
|
#1
|
Member
Registered: Dec 2008
Distribution: Ubuntu and Debian
Posts: 36
Rep:
|
How do users shutdown or reboot in slackware?
Hello
As a user, how do I shutdown or reboot slack?
I added a group
shutdown:x:102:root,crusader
As root I added halt, shutdown, and reboot to the shutdown group.
Quote:
12K -rwxr-xr-x 1 root shutdown 9.2K 2008-04-02 19:40 halt
0 lrwxrwxrwx 1 root shutdown 4 2008-12-30 13:03 reboot -> halt
20K -rwxr-xr-x 1 root shutdown 17K 2008-04-02 19:40 shutdown
|
In sudoers I added the following lines
%shutdown localhost=/sbin/shutdown -h now
%shutdown localhost=/sbin/reboot
Still for some reason I am not able to reboot or shutdown as a user.
Any suggestions
|
|
|
01-22-2009, 09:59 PM
|
#2
|
Member
Registered: Aug 2007
Location: McBride, BC, Canada
Distribution: Slackware, OpenBSD, Edubuntu
Posts: 53
Rep:
|
The shutdown executable is in /sbin, which is not in a regular users path. Also you might need to prefix the command call with sudo, since you add the permission in the sudoers file. So try calling sudo /sbin/shutdown -r now; if that works then you can add an alias in your .bashrc files to call the commands with the full path and options you want, and all will be good. That's what I did - I shutdown and reboot with the aliased commands poweroff and reboot.
|
|
|
01-23-2009, 02:03 AM
|
#3
|
Member
Registered: Jul 2004
Distribution: Slackware
Posts: 615
Rep:
|
Anyone know if "merely add user to a certain group" will do it?
If is both a KDE user and run level 4 (GUI logon), you can easily use the control center in KDE to set up a user with both sys halt and reboot rights/permissions/ability for that user to then utilize/partake_of while from within KDE
Next is a run level 3 method/way for halt
al@G33T-M2:~$ alias
alias adf='df --human-readable'
alias ahalt='sudo /sbin/halt'
Code:
al@G33T-M2:~$ su
Password:
fortune: cpu time/usefulness ratio too high -- core dumped.
root@G33T-M2:/home/al# cat /etc/sudoers
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
User_Alias TRUSTED = al
# Cmnd alias specification
Cmnd_Alias SRVC = /usr/sbin/apachectl,/sbin/arp,/usr/bin/slrnpull,/sbin/halt
Cmnd_Alias TOOLS = /sbin/mount,/sbin/umount,/home/al/bin/cdrecordeasy,/usr/local/bin/samba_do
Cmnd_Alias FIREW = /usr/local/bin/firehol, /usr/local/bin/rc.vmware
Cmnd_Alias PRNT = /usr/local/bin/cups.sh,/usr/bin/ethereal,/usr/local/bin/kqemu_do
# Defaults specification
Defaults:TRUSTED !lecture
Defaults:al !authenticate
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
TRUSTED ALL = NOPASSWD:SRVC,TOOLS,FIREW,PRNT
root@G33T-M2:/home/al#
|
|
|
01-23-2009, 07:54 AM
|
#4
|
Moderator
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,947
|
Hi,
Most of my systems are up 24/7 so I really don't shutdown that often. When I do then I use either 'shutdown -r now' or 'shutdown -h now'. But as I stated there generally is no need to shutdown.
|
|
|
01-23-2009, 10:20 AM
|
#5
|
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
|
As an option, you can simply use the init utility (instead of shutdown); e.g.,
shuts down the operating system and turns off the power.
reboots the system.
shuts down to single-user mode; I use this to install software patches, for example bind, openssl and the like followed by
to reboot to multi-user.
Maybe a little simpler...
|
|
|
01-23-2009, 12:58 PM
|
#6
|
Member
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 15;
Posts: 451
Rep:
|
You can always use the old 'thre fingered' salute. The action of control, alt, delete is handled by /etc/inittab. By default it is set to a reboot, but if you change the ctrlaltdelete entry, it can halt.
|
|
|
01-23-2009, 01:13 PM
|
#7
|
LQ Newbie
Registered: Oct 2005
Distribution: Slackware
Posts: 3
Rep:
|
If you add the user account to the "power" group they should be able to shutdown the machine. I used this for Xfce.
Rob
|
|
|
01-24-2009, 09:25 PM
|
#8
|
Member
Registered: Dec 2008
Distribution: Ubuntu and Debian
Posts: 36
Original Poster
Rep:
|
Thanks a bunch
I added to .bashrc as Istamm suggested.
alias off='sudo /sbin/shutdown -h now'
alias reboot='sudo /sbin/reboot'
I also did as stated in the first post.
That seemed to work for me.
Last edited by crusader7; 01-24-2009 at 09:33 PM.
|
|
|
01-24-2009, 09:38 PM
|
#9
|
Member
Registered: Dec 2008
Distribution: Ubuntu and Debian
Posts: 36
Original Poster
Rep:
|
Quote:
Originally Posted by sxtytwofrd
If you add the user account to the "power" group they should be able to shutdown the machine. I used this for Xfce.
Rob
|
halt, poweroff, reboot, etc ... in /sbin were all in root:root owner/group respectively, so I am not sure how adding myself to the power group would work. It makes alot of sense though.
|
|
|
01-24-2009, 09:46 PM
|
#10
|
Member
Registered: Dec 2008
Distribution: Ubuntu and Debian
Posts: 36
Original Poster
Rep:
|
Quote:
Originally Posted by onebuck
Hi,
Most of my systems are up 24/7 so I really don't shutdown that often. When I do then I use either 'shutdown -r now' or 'shutdown -h now'. But as I stated there generally is no need to shutdown.
|
I have a dell 5150 notebook which is notorious for heating issues. I installed dellfand and set the temp for the fan to run on high at 49C. At times the fan throttles even when in standby mode. Also the screen back light never shuts off. Therefore, I usually turn my computer off at the end of the day. I never figured out what to do with those issues.
|
|
|
01-24-2009, 10:45 PM
|
#11
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,318
|
Personally, I just do "su -c 'poweroff'".
Adding a user account to the power group allows that user to shut down via HAL, which works in Xfce (and probably KDE).
Are you setting up an account for someone who needs to shut down, but shouldn't have the root password and doesn't use Xfce or KDE?
Last edited by dugan; 01-24-2009 at 11:00 PM.
|
|
|
01-27-2009, 06:23 PM
|
#12
|
LQ Newbie
Registered: Jan 2009
Distribution: Slackware
Posts: 24
Rep:
|
I generally use "halt", simply because it's quicker than "shutdown". Just a thought, if you want everybody to be able to shutdown and reboot, then why not just change the permissions of the two commands so that everybody can, instead of using more long-winded methods? I guess that's the beauty of Linux. So many different ways to do the same thing.
|
|
|
01-27-2009, 10:02 PM
|
#13
|
LQ Newbie
Registered: Jan 2009
Posts: 4
Rep:
|
I'm new to linux but...
on my slacktop i usually ctrl+ALT+delete to reboot or just press my power off button to shutdown. but this in when i'm out of the gui. in slack 12.2 it never says i have done something wrong. even when i boot up there is no error so that's my 2 cents. hope it helps. god bless.
|
|
|
01-31-2009, 10:08 PM
|
#14
|
LQ Newbie
Registered: Jan 2009
Distribution: Slackware
Posts: 24
Rep:
|
Quote:
Originally Posted by $lackn00b
on my slacktop i usually ctrl+ALT+delete to reboot or just press my power off button to shutdown. but this in when i'm out of the gui. in slack 12.2 it never says i have done something wrong. even when i boot up there is no error so that's my 2 cents. hope it helps. god bless.
|
CTRL+ALT+DELETE is a perfectly clean way to shutdown. It does exactly the same as more formal methods, but then you do have to press the "off" switch to prevent it from rebooting.
Pressing the "off" button could be perfectly ok or incredibly stupid depending how your computer is configured. With some configurations, it will simply tell the OS to do a clean shutdown. With others, it could be a brutal and potentially file-corrupting "hard reset". I'm still using the non-journalling ext2 file system, so I haven't the courage to try the "off" button for fear of loads of file-system errors and lots of fscking around. (Pun intended)
Be aware that if you're using a journalling file system, for example, ext3, reiserfs, XFS, you wouldn't get many error message even with an unsafe shutdown, and they would pass up the screen without you noticing, yet still not be exactly ideal. Journalled file-systems should be used as a failsafe for when you really can't shutdown cleanly, not just an excuse for laziness.
|
|
|
All times are GMT -5. The time now is 07:38 AM.
|
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
|
|