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.
|
|
|
05-09-2014, 02:44 PM
|
#122
|
Member
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465
Original Poster
Rep:
|
Quote:
Originally Posted by sycamorex
.... It's the same with Windows or any other OS. Windows does not come with it either.
|
Very true! I was actually thinking that when I wrote my last reply. Only thing is, with Windows, you expect to be in a helpless daze!
|
|
|
05-09-2014, 02:53 PM
|
#123
|
LQ Guru
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
|
Adding your primary user account to the "wheel" group should give you enough permissions to do reboot and shutdown sequences.
|
|
|
05-09-2014, 03:03 PM
|
#124
|
Member
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465
Original Poster
Rep:
|
Quote:
Originally Posted by wigry
|
Funny thing is: I had already added my user account to "power" [and I just checked it again, to make sure...) and I had set-up sudo....and still...no matter what shutdown command I type (shutdown; shutdown -h now; poweroff; halt; etc.) when in my user account, I get "command not found"- even when I use sudo.
Do these things only happen to me?
|
|
|
05-09-2014, 03:04 PM
|
#125
|
Member
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465
Original Poster
Rep:
|
Quote:
Originally Posted by ReaperX7
Adding your primary user account to the "wheel" group should give you enough permissions to do reboot and shutdown sequences.
|
Did that too- last week.
And I could even see if I were getting the message "only root can do that"- but I get "command not found"...until I log in as root. Is that weird or what???
|
|
|
05-09-2014, 03:05 PM
|
#126
|
Member
Registered: Sep 2012
Distribution: Slackware
Posts: 185
Rep:
|
Quote:
Hey guys, how come in Slackware, I have to switch to root in order to poweroff? (sudo, which I enabled for my regular user account, doesn't even work for that)
|
Make sure you use full paths to the commands; you can also add the NOPASSWD option. E.g. In my 'sudoers' file I have this line so I can run "sudo /usr/sbin/pm-suspend" (via the 'sleep' key):
Code:
myuser ALL=NOPASSWD: /usr/sbin/pm-suspend
For shutdown, just push the power button once I have yet to find a computer that doesn't shutdown cleanly if you do that.
The only thing more powerful than root access is physical access..
|
|
|
05-09-2014, 05:04 PM
|
#127
|
Member
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465
Original Poster
Rep:
|
Quote:
Originally Posted by Loomx
Make sure you use full paths to the commands; you can also add the NOPASSWD option. E.g. In my 'sudoers' file I have this line so I can run "sudo /usr/sbin/pm-suspend" (via the 'sleep' key):
Code:
myuser ALL=NOPASSWD: /usr/sbin/pm-suspend
|
No password sounds a little risky, even for me! (And I'm the guy who ran Windows for 9 years without updating or using AV...) (Never had a problem)
Quote:
Originally Posted by Loomx
For shutdown, just push the power button once I have yet to find a computer that doesn't shutdown cleanly if you do that.
The only thing more powerful than root access is physical access..
|
Hehe, I don't know why...but it pains me to do that. (Back when I first started with Linux, I must have spent an hour once, trying to figure out how to get out of console mode without hitting the power button...but finally had to.)
I suspect, like most of my computer habits and taboos, it's probably something ingrained from my Windows daze/days.
|
|
|
05-09-2014, 06:09 PM
|
#128
|
Member
Registered: Sep 2011
Posts: 925
|
Quote:
Originally Posted by Sumguy
Hey guys, how come in Slackware, I have to switch to root in order to poweroff?
|
That is the traditional Unix multi-user philosophy. Only the superuser can shut down and reboot the machine, because that affects other users, so a regular user cannot do that.
Still there is a RedHat/Fedora/freedesktop.org way to do this as a user (from the guys who brought you systemd). On Slackware 13.37 and earlier you do
Code:
dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Restart
and on 14.0 and above it is
Code:
ck-launch-session; dbus-send -–system –-print-reply -–dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
ck-launch-session; dbus-send -–system –-print-reply -–dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Of course, the command will change every 18 months, as the people designing these interfaces have no stability in mind.
Last edited by jtsn; 05-09-2014 at 06:30 PM.
|
|
|
05-09-2014, 07:14 PM
|
#129
|
Member
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465
Original Poster
Rep:
|
Thanks, JTSN,
Well...at least I know it's normal then- and not that I've configured something wrong. I feel better now!
Seems easier just to switch to root, than to do all that other stuff- but sheesh! Ya'd think that they wouldn't make it so hard just to turn something off! (As you say though, I can see why- maybe like someone has a server running- and an employee is doing maintenance, and the owner doesn't want him to be able to just turn it off one day if the guy is mad or something, eh?)
Darn! If you can't count on Slackware for stability, what can ya count on?!
Continuing my Slack adventures: I just LSed into /sbin.... Wow, there's a ton of cool stuff in there! I even know what some of it is for! (Can you tell? I'm coming along nicely. 2 weeks ago, I would have started X and opened a file browser to look in /sbin...noiw I LSed from the console! Woo-hoo!)
_____
Re: Shutting down:
O-K.....just tried "sudo /sbin/poweroff" (a la Loomx) and it worked! (/sbin/shutdown" returned an error saying that it must include a time argument, and to try "now"- but for some reason, even with "now" I'd get the same message!)
If I use the XFCE desktop, I can shutdown through there via the GUI thingy.....
Seems like a lot of trouble just to turn the darn computer off! (But I'll get used to it)
______
Yet ANOTHER question:
I noticed that some of the same files in /sbin are also in /bin- only the /sbin versions seem to be symbolic links, while the /bin versions seem to be executable (?)- could anyone briefly explain what the purpose of that is? (I tried out a few of the interesting-sounding things in those directories....and I will Google some, to find out what they are!)
And...why is it that you have to type the full path to use some...and yet others can be run just by typing their name? Sheesh! The more I think I'm beginning to get a handle on this stuff...the more it seems I don't know!
|
|
|
05-09-2014, 07:44 PM
|
#130
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
|
Quote:
Originally Posted by Sumguy
Yet ANOTHER question:
I noticed that some of the same files in /sbin are also in /bin- only the /sbin versions seem to be symbolic links, while the /bin versions seem to be executable (?)- could anyone briefly explain what the purpose of that is? (I tried out a few of the interesting-sounding things in those directories....and I will Google some, to find out what they are!)
And...why is it that you have to type the full path to use some...and yet others can be run just by typing their name? Sheesh! The more I think I'm beginning to get a handle on this stuff...the more it seems I don't know!
|
Hope that explains it:
http://linuxtroubleshoot.blogspot.co...s-sbin-vs.html
Symbolic links are used for efficiency. There is no need to store the same file in 2 places.
If you need type the full path as a standard user (and you're running a login shell), it means that the command is not in your path, which, in turn, means that probably it's not meant to be run as that particular user. For example, a lot of administrative commands are inaccessible to standard users as they are mean to be run as root.
|
|
|
05-09-2014, 07:47 PM
|
#131
|
Member
Registered: Sep 2011
Posts: 925
|
Quote:
Originally Posted by Sumguy
If I use the XFCE desktop, I can shutdown through there via the GUI thingy.....
|
The GUI thingy does ConsoleKit D-Bus "messaging", too. The crap is just hidden behind a fancy click button there.
BTW: You don't have to type stuff like that every time, you just learn how to script things and how to use shell aliases.
|
|
|
05-09-2014, 08:03 PM
|
#132
|
Member
Registered: Sep 2012
Distribution: Slackware
Posts: 185
Rep:
|
Quote:
Code:
myuser ALL=NOPASSWD: /usr/sbin/pm-suspend
No password sounds a little risky, even for me! (And I'm the guy who ran Windows for 9 years without updating or using AV...) (Never had a problem)
|
Note that this `/etc/sudoers' line only allows that specific command without asking for a password, so hopefully not too much of a security hole..
The `ALL' means you can run it from any host.
|
|
|
05-09-2014, 09:04 PM
|
#133
|
Member
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528
|
Quote:
Originally Posted by Sumguy
(/sbin/shutdown" returned an error saying that it must include a time argument, and to try "now"- but for some reason, even with "now" I'd get the same message!)
|
See man shutdown.
|
|
|
05-09-2014, 09:11 PM
|
#134
|
Member
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528
|
Quote:
Originally Posted by Sumguy
And...why is it that you have to type the full path to use some...and yet others can be run just by typing their name? Sheesh!
|
As a normal user print the PATH variable with
Then login as root print the PATH variable using the same command.
Note the difference? /sbin is in the execution path for root but not a normal user.
EDIT: Experiment with the commands as a regular user and as root. Try becoming root with the command "su" and as "su -" (hyphen).
which <program>
whereis <program>
type <program>
alias
You want to learn more about the commands above and tried the man pages but nothing was found? Try the type command (type type).
Last edited by TracyTiger; 05-09-2014 at 09:21 PM.
Reason: Extra stuff to confuse the innocent
|
|
|
05-12-2014, 09:52 AM
|
#135
|
Member
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: BunsenLabs Linux
Posts: 465
Original Poster
Rep:
|
Hmmmm..... Since installing Slack on my newly-acquired used laptop, I haven't been having any problems with LILO. Wonder iffin' the previous problems could have had something to do with my 'puter?
Quote:
Originally Posted by jtsn
BTW: You don't have to type stuff like that every time, you just learn how to script things and how to use shell aliases.
|
Oooo! That opens up a whole new world of possibilities, doesn't it?! It's been on agenda to learn some scripting. I think I can start soon, now that I seem to have using the terminal figured out.
|
|
|
All times are GMT -5. The time now is 10:42 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
|
|