LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-09-2014, 02:12 PM   #121
wigry
Member
 
Registered: Jul 2004
Distribution: slackware
Posts: 218

Rep: Reputation: 52

About powering off the computer, look here:

http://www.linuxquestions.org/questi...3/#post3418902

There are also other groups that your regular user should be part of to be able to do "normal" things like plugging in the USB mass storage, mound CD-s etc:

http://docs.slackware.com/slackbook:users
http://alien.slackbook.org/dokuwiki/...lackware:fixes

Last edited by wigry; 05-09-2014 at 02:22 PM.
 
Old 05-09-2014, 02:44 PM   #122
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: Slackware; Crunchbang.
Posts: 396
Blog Entries: 2

Original Poster
Rep: Reputation: 92
Quote:
Originally Posted by sycamorex View Post
.... 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!
 
Old 05-09-2014, 02:53 PM   #123
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, FreeBSD 10.0
Posts: 3,276
Blog Entries: 15

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
Adding your primary user account to the "wheel" group should give you enough permissions to do reboot and shutdown sequences.
 
Old 05-09-2014, 03:03 PM   #124
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: Slackware; Crunchbang.
Posts: 396
Blog Entries: 2

Original Poster
Rep: Reputation: 92
Quote:
Originally Posted by wigry View Post
About powering off the computer, look here:

http://www.linuxquestions.org/questi...3/#post3418902

There are also other groups that your regular user should be part of to be able to do "normal" things like plugging in the USB mass storage, mound CD-s etc:

http://docs.slackware.com/slackbook:users
http://alien.slackbook.org/dokuwiki/...lackware:fixes
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?
 
Old 05-09-2014, 03:04 PM   #125
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: Slackware; Crunchbang.
Posts: 396
Blog Entries: 2

Original Poster
Rep: Reputation: 92
Quote:
Originally Posted by ReaperX7 View Post
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???
 
Old 05-09-2014, 03:05 PM   #126
Loomx
LQ Newbie
 
Registered: Sep 2012
Distribution: Slackware
Posts: 24

Rep: Reputation: Disabled
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..
 
Old 05-09-2014, 05:04 PM   #127
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: Slackware; Crunchbang.
Posts: 396
Blog Entries: 2

Original Poster
Rep: Reputation: 92
Quote:
Originally Posted by Loomx View Post
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 View Post
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.
 
Old 05-09-2014, 06:09 PM   #128
jtsn
Member
 
Registered: Sep 2011
Location: Europe
Distribution: Slackware
Posts: 805

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by Sumguy View Post
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.
 
Old 05-09-2014, 07:14 PM   #129
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: Slackware; Crunchbang.
Posts: 396
Blog Entries: 2

Original Poster
Rep: Reputation: 92
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!
 
Old 05-09-2014, 07:44 PM   #130
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,564
Blog Entries: 1

Rep: Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026Reputation: 1026
Quote:
Originally Posted by Sumguy View Post
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.
 
Old 05-09-2014, 07:47 PM   #131
jtsn
Member
 
Registered: Sep 2011
Location: Europe
Distribution: Slackware
Posts: 805

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by Sumguy View Post
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.
 
Old 05-09-2014, 08:03 PM   #132
Loomx
LQ Newbie
 
Registered: Sep 2012
Distribution: Slackware
Posts: 24

Rep: Reputation: Disabled
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.
 
Old 05-09-2014, 09:04 PM   #133
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 271

Rep: Reputation: 63
Quote:
Originally Posted by Sumguy View Post
(/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!)
Code:
shutdown -h now
See man shutdown.
 
Old 05-09-2014, 09:11 PM   #134
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 271

Rep: Reputation: 63
Quote:
Originally Posted by Sumguy View Post
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
Code:
echo $PATH
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
 
Old 05-12-2014, 09:52 AM   #135
Sumguy
Member
 
Registered: Jul 2010
Location: Rural Kentucky, USA.
Distribution: Slackware; Crunchbang.
Posts: 396
Blog Entries: 2

Original Poster
Rep: Reputation: 92
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 View Post
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.
 
  


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
[SOLVED] MySQL & Slack 12.2 problems with getting the thing to run... lpallard Linux - Server 2 03-03-2010 07:10 PM
LXer: Are You Afraid...? You Will Be... LXer Syndicated Linux News 0 07-17-2009 04:00 AM
Why I am afraid to use Linux (some help please) old6598 General 1 04-07-2007 05:45 AM
about KDE i'm afraid ;) yoron Slackware 2 01-18-2006 01:04 PM
Afraid I Have Been Compromised robpom Linux - Security 12 03-31-2005 12:50 AM


All times are GMT -5. The time now is 03:43 AM.

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