View previous topic :: View next topic |
Author |
Message |
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Fri Jan 16, 2015 12:13 pm Post subject: Can only shutdown as root [SOLVED] |
|
|
I've installed a regular user and xfce desktop.
When I boot up and login as a regular user I can't logout unless I login as root first.
The shutdown option in xfce is grayed out.
If I exit from xfce and go back to the command line and try "shutdown -h now" I get a message "-bash: shutdown: command not found.
The regular user was given the "Wheel" rights when I created it.
How can I check and adjust the user rights so that I can shutdown without using root? _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB
Last edited by catchpole on Wed Jan 28, 2015 7:07 am; edited 1 time in total |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Jan 16, 2015 12:35 pm Post subject: Re: Can only shutdown as root |
|
|
catchpole wrote: | When I boot up and login as a regular user I can't logout unless I login as root first. The shutdown option in xfce is grayed out. |
catchpole ... that quite {ab}normal :) ... wild guess on my part, xfce probably uses pm-utils and this requires that the particular use is in some group (probably 'power') so as to have the privilages to 'shutdown'. Check your user is in this group (again, I assume its called 'power')
Code: | % whoami
% groups
% su -
# usermod -a -G power <your_username> |
best ... khay |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
|
Back to top |
|
|
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Fri Jan 16, 2015 3:02 pm Post subject: |
|
|
Hi khayyam,
I get these results as root from your command line input: Quote: | usermod -a -G power myusername
usermod: group 'power' does not exist |
Quote: | groups
root bin daemon sys adm disk wheel floppy tape video |
Hi Hypnos,
I don't know if I have the "consolkit" flag enabled. I don't know where to look for it.
Edit:
I've just checked what consolkit is and I don't have it.
I use the command line to start with "startx". _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Jan 16, 2015 8:23 pm Post subject: |
|
|
catchpole wrote: | I get these results as root from your command line input:
Code: | usermod -a -G power myusername
usermod: group 'power' does not exist
groups
root bin daemon sys adm disk wheel floppy tape video |
|
catchpole ... ok, but its not the root user who's of concern here, but your user. So, there is no 'power' group ... as I said this was a "wild guess", its more likely that as hypos suggested xfce has a requirement for consolekit ... can't help in that regard.
best ... khay |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Sat Jan 17, 2015 1:40 am Post subject: |
|
|
Read here: http://wiki.gentoo.org/wiki/Handbook:AMD64/Working/USE
To find out what USE flags you have enabled currently, run
Code: | # emerge --info | grep ^USE |
If "consolekit" is not in the output, you need to enable it for XFCE to have a shutdown button. XFCE uses consolekit to grant certain root privileges, like access to power management and audio features, to only those normal users who are logged in at the physical console. _________________ Personal overlay | Simple backup scheme |
|
Back to top |
|
|
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Sat Jan 17, 2015 5:14 am Post subject: |
|
|
Hi Hypnos,
Consolekit is present in the output of: "emerge --info | grep ^USE"
I do have a shutdown button but its grayed out and ineffective.
Edit:
I have an error message on boot up. Is this connected?
Quote: | mount: /etc/fstab: parse error: ignore entry at line 18.
[ ok ]
* Enabling numlock on ttys ...
[ ok ]
* Starting sshd ...
[ ok ]
ERROR: Your XDM value is invalid.
No xdm executable could be found on your system.
ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm,
or install x11-apps/xdm package
[ !! ]
* Setting up xdm ...
* start-stop-daemon: /usr/bin/xdm does not exist
* ERROR: could not start the Display Manager
[ ok ]
* Starting local
[ ok ]
rc default logging stopped at Sat Jan 17 05:00:52 2015 | I know about line 18. Its because of a dual boot situation and not relevant. _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Sat Jan 17, 2015 1:56 pm Post subject: |
|
|
How do you launch XFCE when you do startx ?
If you invoke "startxfce4" that should set up the console session for you; if not, you have to do it yourself with "ck-launch xfce4-session" . _________________ Personal overlay | Simple backup scheme |
|
Back to top |
|
|
davidm Guru
Joined: 26 Apr 2009 Posts: 557 Location: US
|
Posted: Sat Jan 17, 2015 4:03 pm Post subject: |
|
|
catchpole wrote: | Hi Hypnos,
Consolekit is present in the output of: "emerge --info | grep ^USE"
I do have a shutdown button but its grayed out and ineffective.
Edit:
I have an error message on boot up. Is this connected?
Quote: | mount: /etc/fstab: parse error: ignore entry at line 18.
[ ok ]
* Enabling numlock on ttys ...
[ ok ]
* Starting sshd ...
[ ok ]
ERROR: Your XDM value is invalid.
No xdm executable could be found on your system.
ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm,
or install x11-apps/xdm package
[ !! ]
* Setting up xdm ...
* start-stop-daemon: /usr/bin/xdm does not exist
* ERROR: could not start the Display Manager
[ ok ]
* Starting local
[ ok ]
rc default logging stopped at Sat Jan 17 05:00:52 2015 | I know about line 18. Its because of a dual boot situation and not relevant. |
Hi, I would probably fix the problem relating to xdm first.
Code: |
ERROR: Your XDM value is invalid.
No xdm executable could be found on your system.
ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm,
or install x11-apps/xdm package
[ !! ]
* Setting up xdm ...
* start-stop-daemon: /usr/bin/xdm does not exist
* ERROR: could not start the Display Manager
|
So you don't even have xdm installed, right? But you don't want to use a Display manager at all, right? So then it seems maybe you have one configured. Check 'rc-update show'. If you see something like:
then that means you have it in there to be started at boot. So maybe run:
Code: |
rc-update delete xdm default
|
To delete it from the default runlevel and boot to the CLI without the error. Also see the Handbook entry about the init system for a great introduction to it: http://wiki.gentoo.org/wiki/Handbook:AMD64/Working/Initscripts
Regarding consolekit maybe see http://wiki.gentoo.org/wiki/ConsoleKit#Troubleshooting to help debug it and perhaps get some clues as to what is happening. |
|
Back to top |
|
|
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Sun Jan 18, 2015 10:35 am Post subject: |
|
|
Hi Hypnos,
I did what is suggested in the Gentoo HowTo for xfce4
Quote: | user $echo "exec startxfce4" > ~/.xinitrc |
Hi davidm,
I removed the xdm error using your suggestion.
Quote: | rc-update delete xdm default |
As the only user of the computer, do I need consolekit at all?
I just want to be able to use the computer as a user and then shut it down without logging in as root.
I'll keep reading through the literature links that you posted. _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Sun Jan 18, 2015 10:00 pm Post subject: |
|
|
I use sudo to shutdown. /etc/sudoers has the entries:
Code: |
# Wheel group can run sudo. (*** Risky ***)
%wheel ALL=(ALL) PASSWD: /bin/su
# Shutdown or reboot or fsck the system.
%wheel sixpence= NOPASSWD: /sbin/shutdown -h now
%wheel sixpence= NOPASSWD: /sbin/shutdown -r now
%wheel sixpence= NOPASSWD: /sbin/shutdown -r -F now
|
and my standard login is in the wheel group.
Not an ideal answer, but it simplifies things a bit.
Will |
|
Back to top |
|
|
Hans-25 n00b
Joined: 06 Jan 2015 Posts: 7
|
Posted: Mon Jan 19, 2015 10:54 am Post subject: |
|
|
I have the same circumstance in a newly installed Gentoo 64 without any desktop or windowing. So I conclude this is NOT a problem related to higher level packages but a very basic issue.
I would have thought the user has to be in a specific group but I lack knowledge in which!
I tried "su shutdown now" but I wasn't able to enter the (correctly typed) password successfully (looks like a bug to me!)
So I'm still not happy about this behaviour. This is good for a concurrent multi-user system, but most environments will not need it. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Jan 19, 2015 11:10 am Post subject: |
|
|
Hans-25 wrote: | I would have thought the user has to be in a specific group but I lack knowledge in which! I tried "su shutdown now" but I wasn't able to enter the (correctly typed) password successfully (looks like a bug to me!) So I'm still not happy about this behaviour. This is good for a concurrent multi-user system, but most environments will not need it. |
Hans-25 ... firstly, your jumping on someone elses thread, your respective problems are not the same and so you are drawing away attention from the OP. Anyhow, your user will need to be in the 'wheel' group to 'su' ... this is covered in the handbook, the following should resolve it ..
Code: | # usermod -a -G wheel <your_username> |
best ... khay |
|
Back to top |
|
|
Hans-25 n00b
Joined: 06 Jan 2015 Posts: 7
|
Posted: Mon Jan 19, 2015 8:05 pm Post subject: |
|
|
You appear to be the type of "Advocates" that every forum would be proud of, Mr. Khayam!
From "wild guess"-ing to superstitious jumping on other forum members. If you don't like my contributions, which you have shown in various threads, I strongly suggest you don't answer them until perhaps you happen to be a Moderator!
My problem is exactly the same, namely "Can only shutdown as root". My non-root user is in the "wheel" group but he can't shutdown; what is more, the "shutdown" command is not visible to him at all. The command "su shutdown x now" does not help, although the "su" part may be partially functioning (asking for a password).
Any guessing about xfce appears superfluous at this point. |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Mon Jan 19, 2015 8:47 pm Post subject: |
|
|
Hans-25,
A few things.- First of all, I don't see any posts where you've interacted with khayyam before. Are you perhaps operating a duplicate account? Should we know you by a different name? If so, I need to let you know that that's against the Forum Guidelines.
- Second, there's a kink in your cable, so to speak. The correct command is not as you've written, but instead
Code: | sudo shutdown -h now | That's "sudo" and not "su". Try that and report back. You may indeed not have the same issue as the OP (or any technical issue at all).Finally, your tone is not really consistent with the Forum Guidelines, either. Please give 'em a review before proceeding.- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Tue Jan 20, 2015 12:51 pm Post subject: |
|
|
Hi cwr,
Please excuse my ignorance, can you explain the "ALL=(ALL) PASSWD" in:
Quote: | %wheel ALL=(ALL) PASSWD: /bin/su |
Am I correct to assume the the "sixpence" is a username?
Also would I be correct in assuming that the "sudoers" would be restricted to only the commands stated?
This would be an acceptable solution but it would be nice to be able to shut down from the xfce GUI.
Its a shame that the facility is there but I can't use it. (Yet).
The installation documentation suggested that the Server installation option was best for configuration. (If my memory serves me well)
It seems sensible to have these restrictions for a server.
Its a steep learning curve!
Whenever I go down a blind alley I need to clean up afterwards. That's not easy for a noob. _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Tue Jan 20, 2015 1:07 pm Post subject: |
|
|
No, sixpence is the local system name. The line in /etc/sudoers permits anyone in the wheel
group to run /bin/su on sixpence without a password.
The user cwr is in the group file, which has the entry:
wheel:x:10:root,build,cwr
The system then shuts down with the command: "sudo shutdown -h now"
Will
(And yes, sudo is intended to permit specific commands. However, some distros uses "sudo su"
to get a root login. The setup is done in /etc/sudoers - use visudo to edit it, since it also checks
the file format so you don't lock yourself out.) |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Tue Jan 20, 2015 10:17 pm Post subject: |
|
|
It seems most people want to choose to head down the road of using sudo to attain root privileges to shutdown - it works just fine, but if anyone wants the shutdown button to work:
When I select "logout" or use the user applet on my systems, the "shutdown" "hibernate" "suspend" "restart" buttons show up fine and can be clicked. Xfce uses Consolekit to be able to use these functions (and the kernel must have hibernate/shutdown enabled to use those). There's some information on that page about how to setup (ck-launch-session) and test (ck-list-sessions) CK there. Consolekit itself needs to be running, the 'xdm' init script should start consolekit if it's set up properly - you should see console-kit-daemon running in your process list.
You can use
# equery uses xdm
to check if xdm has consolekit enabled for Gentoo. Xfce appears to autodetect the availability of Consolekit sessions and does not require rebuild to use it.
My regular user account, though I do belong to 'wheel', does not have any other system groups to access audio, shutdown, or removable media on my xfce machines. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Wed Jan 21, 2015 5:59 am Post subject: |
|
|
Hi eccerr0r,
I had an error on boot up with xdm. Quote: | ERROR: Your XDM value is invalid.
No xdm executable could be found on your system.
ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm,
or install x11-apps/xdm package
[ !! ]
* Setting up xdm ...
* start-stop-daemon: /usr/bin/xdm does not exist
* ERROR: could not start the Display Manager
[ ok ]
* Starting local
[ ok ] |
I assumed that I didn't need xdm because it was connected with OpenBox which I discarded as too basic.
Therefore I took advice from this thread to remove it from the run level: Quote: | rc-update delete xdm default |
It seems that its needed for consolekit to work.
The result of equery uses xdm: Quote: | equery uses xdm
+consolekit
+ipv6
+pam
-xdm-auth |
It may be that I don't have "hybernate/shutdown" enabled in the kernel. I seem to remember that I wouldn't need it because its not a laptop and therefore unnecessary. (a mistake I guess)
How can I check? _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Wed Jan 21, 2015 2:24 pm Post subject: |
|
|
Shutdown and Reboot should always be available if Consolekit is enabled with xfce - but hibernate and suspend depend on kernel setup. (Apologies, typoed "hibernate/shutdown" instead of "hibernate/suspend". Also having hibernate/suspend on a desktop isn't completely useless, though personally I rather shutdown as my systems are fast enough on startup. It's kind of a pity that machines' firmware finally work for suspend/resume once I got ssds...)
As the error message says, you should look at the file /etc/conf.d/xdm - Edit it and make sure it has DISPLAYMANAGER="xdm" though it probably does. However the other message indicates /usr/bin/xdm doesn't exist indicating you unmerged it, which makes sense.
The display manager presents you with the graphical login screen. If you get the graphical login screen, xdm is working and will set up your consolekit session automatically.
On the other hand if you don't want the graphical login screen and rather use the getty/login console method, you still need consolekit for xfce power buttons. As in that page I linked, you need to start a consolekit session so I won't repeat that here. Either way you need consolekit running before you can start a consolekit session:
# rc-update add consolekit default
And to manually start it without reboot: /etc/init.d/consolekit start (or rc-service consolekit start)
You don't need to add this if you use xdm as xdm's initscript will do this for you automatically if it starts up correctly. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Thu Jan 22, 2015 5:48 am Post subject: |
|
|
Hi eccerr0r,
I have re-emerged xdm.
The file "/etc/conf.d/xdm" has DISPLAYMANAGER="xdm" in it. (uncommented)
When I re-boot I get a login window which I believe to be "consolekit" because of the icon at the right hand side which seems to represent a "K".
The Header for this window says "Welcome to GentooBox"
Also below that in the bottom right hand corner of the screen is a basic white window which says: Quote: | Console log for GentooBox | GentooBox is the name of my computer.
When I input a login name either "root" or my regular user, it asks for a password.
After inputting the password and hitting enter, I get a blank screen for a couple of seconds and then it goes back to the login screen again.
I can't get out of the loop and have to switch off the computer by pressing and holding the start button for a few seconds.
This is the situation I had before I started this thread.
I had installed "SLIM" Display Manager and tried to fix it by removing it and also unmerging xdm.
I think I've got myself into a bit of a mess! _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Thu Jan 22, 2015 8:49 am Post subject: |
|
|
xdm seemed to work fine for me, I've not really liked SLiM because it doesn't seem to select sessions automatically properly, but when it does, it works with consolekit fine. Recently I've simply used LightDM which works very well. I even use it with one of my Gnome boxes over gdm because it doesn't crash fglrx.
Consolekit has no GUI actually, it works completely behind the scenes. What you're seeing is the old fashioned xdm login screen. The lower right hand corner is just an 'xconsole' that tries to display all console messages to help debug (but it's simply crap IMHO, it does not work well for Linux - it was more designed for old Unix that does not have virtual terminals.)
I think you may have run across one of the problems with Gentoo - sometimes after merging and unmerging packages, configuration sometimes is not restored back to what it was before. Try merging xfce again and etc-update/dispatch-conf, hopefully it will set up the display manager properly, there's a whole bunch of scripts dealing with Xsession and Chooser that I haven't totally figured out myself (as xdm, SLiM, LightDM, gdm, and others all do something slightly different...) _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
catchpole Tux's lil' helper
Joined: 03 Sep 2014 Posts: 103 Location: Leeds UK
|
Posted: Thu Jan 22, 2015 1:06 pm Post subject: |
|
|
I've managed to get the login screen to let me login at last.
It was merely trial and error.
I went back to the xfce "How To" and under the heading "Graphical Login" I entered the suggested commands: Quote: | root #echo XSESSION=\"Xfce4\" > /etc/env.d/90xsession
root #env-update && source /etc/profile | Now I can login as root or my regular user and it takes me into the xfce desktop.
Also the "Suspend" and "Shutdown" icons are working but the "Switch user" is greyed out.
Now I'm heading for my next unknown problem.
Don't worry folks I'll be back to keep you all amused with my constant mistakes!!
Thanks again to everyone on this wonderful forum. _________________ Noob
With experience of Mint and trying to learn more by intalling Gentoo
Motherboard = MS-7211- MICRO-STAR INTERNATIONAL CO., LTD
CPU = Intel(R) Celeron(R) CPU 2.80GHz version: 15.4.9
Memory = 2GB |
|
Back to top |
|
|
|