SlackwareThis 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.
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.
I recently switched from runlevel 3 to runlevel 4. I can't exit X. Restart, & Power off are a bit grey and don't work off the menus anymore, & suspend & hibernate have disappeared off the menu.
I'm not set up for hibernate; I did occasionally suspend. But I did restart & power off. I presume it's permissions, but where?
It would be helpful to know if by "runlevel 4" you mean your default location is just a display manager like SDDM, or if you have also called for a default login for a particular User into a WM or DE. Whichever you do should still respond to Ctrl-Alt-Backspace or Ctrl-Alt-F1. Differernt WM/DEs have different locations to set those but just for consistency and safety sake I specify Ctrl-Alt-Backspace ion xorg.conf
There is also a location for permission for Users to be allowed to restart of which I forget because iirc by default it is allowed in Slackware rules. One has to willfully change that to disallow it.
It's dbus and logind that lets you restart/shutdown as user, and some DE like xfce starts these automatically while X/startx does not.
So I think if you use 'startx' currently is best to manually start them if you want them, let us choose if we want them or not.
I just use the power button, or ctrl-alt-del in TTY1 works fine for me, without services, YMMV.
FWIW, startxfce4 script should start all that stuff automatically, and if it does not then it's a startxfce4 bug.
I'm usually very careful about services and what starts them, so I'd prefer if this was solved in starxfce4 and not X/startx.
I usually use Plasma, but I logged out and into XFCE and I've got Shutdown, Restart, Logout, etc, in the Menu, none greyed out - all available by clicking on Logout. I have runlevel 4 set as default in /etc/inittab.
Last edited by brianL; 06-10-2022 at 10:26 AM.
Reason: wrong choice of word
It is possible to disable the shutdown and reboot options from the users window manager menus (and sometimes it might be a good idea). However, at least on some systems they still choose to have shutdown and reboot options from the menu of the display manager (the graphical login screen).
So, could you try if you first can log out and then find a shutdown option in some menu of xdm, kdm, sddm or whatever display manager you are running?
@henca: I'm running xdm, as per slackware norms and any reboot or halt scripts/programs should be setuid root so lusers can use them. That's the norm.
@BrianL: That's what I normally have too. The icons being less clear/grteyed out makes me think it's in X, not the undergrowth.
Slackware starts dbus in the init scripts, as network scripts check for it. Runlevel 3 -->runlevel 4 is accomplished with rc.4 which goes through the various DMs best --> worst and starts them. Slackware's runlevel 4 just starts xdm, AFAICT. In /etc/X11/xinit, xinitrc is pointed at a script. there's a script xinitrc.xfce and one for half a dozen wms.
This was rsync'ed from a backup of an older box, which I don't remember having this issue. One solution might be a line in ~/.bash_profile starting X if it wasn't running . That might do it. But the perfectionist in me (which is a TINY FRACTION of my personality) wants the 'real' fix.
@henca: I'm running xdm, as per slackware norms and any reboot or halt scripts/programs should be setuid root so lusers can use them. That's the norm.
I once used xdm, but it was probably about 20 years ago on Slackware 3.1. Since Slackware started shipping KDE i switched to kdm even though I've during the years mostly have used other desktop environments like Gnome and XFCE.
It is probably possible to configure xdm to have some shutdown/reboot option, but I can say for sure that kdm has those menu choices by default.
I agree that the user should be able to reboot or shutdown his PC (personal computer) without having to switch to root. However, for workstations with multiple simultaneous logged in users it can be a major annoyance if the user at the console (or any other user) by mistake or on purpose shuts down the machine. That is probably why /sbin/halt is not setuid by default.
On Slackware 14.2 systems used for workstations and servers with remote users I have disabled shutdown and reboot menu options for users by modifying
However, users are still able to shutdown their machines by logging out and then choose shutdown or reboot from the kdm-menu. With this setup they are less likely to shutdown or reboot by mistake.
By default, when users are allowed to reboot and shutdown from the XFCE menus that file looks like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
<vendor>XFCE Session Manager</vendor>
<vendor_url>http://xfce.org/</vendor_url>
<icon_name>xfce4-session</icon_name>
<action id="org.xfce.session.xfsm-shutdown-helper">
<description>Shutdown, restart, suspend, or hibernate the system</description>
<message>Authentication is required to shutdown, restart, suspend, or hibernate the system.</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib64/xfce4/session/xfsm-shutdown-helper</annotate>
</action>
</policyconfig>
To disable the choices to halt or reboot I changed "yes" to "auth_admin" like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
<vendor>XFCE Session Manager</vendor>
<vendor_url>http://xfce.org/</vendor_url>
<icon_name>xfce4-session</icon_name>
<action id="org.xfce.session.xfsm-shutdown-helper">
<description>Shutdown, restart, suspend, or hibernate the system</description>
<message>Authentication is required to shutdown, restart, suspend, or hibernate the system.</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib64/xfce4/session/xfsm-shutdown-helper</annotate>
</action>
</policyconfig>
However, how to disable this has changed during the years between different versions of Slackware. I would also guess that you would be aware if you would have done any such changes.
This was rsync'ed from a backup of an older box, which I don't remember having this issue.
If the older box was 14.2 then it used consolekit to make it work. 15.0 has no consolekit and will use elogind when available.
Few comments on that;
XDM has no reboot/shutdown menu at all, by default, and therefore does not require elogind for anything.
XDM was compiled to use elogind at some point, and that feature was reverted before 15.0 release.
IIRC there was a bug preventing XDM from working correctly in some setups when XDM binary was linked to elogind.
What I assume could cause the grayed out menu:
1. Your local xintrc or xsession scripts use dbus-launch or ck-launch-session (deprecated by xfce).
2. You've upgraded from 14.2 and forgot to remove all traces of consolekit which is now obsolete in 15.0
3. Your xfce assumes the *DM starts elogind service and it actually does not, since XDM does not even respond to dbus messages.
4. There's more, but you've neglected to mention if it ever worked on that system and what happened right before it stopped working.
The older box was/is 15.0 + my usual additions mainly from Alien's repo. These are single user machines in the main and I know what I'm doing (as a rule). There's been no major hacking, surgery or reconstruction done.
I didn't do any 14.2 --> 15.0 transition, but went through several iterations of current before going to 15.0 so nothing from 14.2 remains. It was all caught earlier.
The change on my new box that seemed to cause the issue was changing the initdefault setting from 3 to 4 which allows rc.4 to run. That seemed pretty harmless, but evidently wasn't. Restoring runlevel 3 as initdefault cured the problem . That makes no sense to me. Runlevel 4 startx xdm directly, which presumably calls other stuff; runlevel 3 calls startx, /etc/xinitrc.xfce and presumably adm also.
Runlevel 4 startx xdm directly, which presumably calls other stuff
Well, I use XDM all the time, it does not call anything unspecified, it currently works fine here without elogind or dbus.
But the reboot/shutdown feature in xfce went away the same day consolekit did, as far as I'm concerned.
From my point of view; this was intended, i.e. not a bug but more of a push into certain direction, by xfce upstream.
I'd just ask not to make X or XDM depend on elogind library again, because I'd have to recompile them all again.
Maybe it'd be easier to use another DM which already starts the systemd stuff, instead of pushing systemd stuff to XDM, just saying.
Well, I use XDM all the time, it does not call anything unspecified, it currently works fine here without elogind or dbus.
But the reboot/shutdown feature in xfce went away the same day consolekit did, as far as I'm concerned.
From my point of view; this was intended, i.e. not a bug but more of a push into certain direction, by xfce upstream.
I'd just ask not to make X or XDM depend on elogind library again, because I'd have to recompile them all again.
Maybe it'd be easier to use another DM which already starts the systemd stuff, instead of pushing systemd stuff to XDM, just saying.
XDM still registers an elogind session using the pam_elogind.so module in the /etc/pam.d/xdm configuration. As long as elogind is installed then the daemon should be started at boot and the pam_elogind.so module will register a session, giving the user access to shutdown/restart/suspend/hibernate the machine. XDM itself isnt built with elogind support so I guess it wont have options to shutdown/restart from within xdm, but an xfce4 session started from xdm on a stock full install of slackware will register an elogind session by default.
Removing elogind and dbus is of course up to you, but its not what a stock install of slackware provides and will break things like shutdown/restart in xfce4 and plasma. It seems like you're suggesting to remove it here. I would suggest the opposite; make sure elogind/dbus/polkit are installed, daemons are running from their stock /etc/rc.d/rc.{messages,elogind} scripts, and that /etc/pam.d/xdm still has the pam_elogind.so line present. If shutdown/restart/etc. are missing in a DE like xfce4 on a stock install, then one of these things is most likely missing or not functioning.
My install of 15.0 has elogind started in the rc scripts so it's there.
What I'm interested in is: Why are the Restart & power off icons greyed over in XFCE when they are non functional? All these super complicated daemons nattering to each other are inclined to be fully tested and working by the first beta, never mind a distro release
I'm now back in runlevel 3 using 'startx,' and my suspend option is back and working. I also have higher saturation on the 'restart' & 'power off' icons. Some obscure daemon concerned with it's tasks at console level is hardly going to start telling XFCE what it can and cannot do, is it? Something is telling XFCE (in runlevel 4)
You can't suspend.
You can't restsart.
You can't power off.
But something is telling XFCE just that.
The only difference was the use of 'startx' vs. the use of 'xdm' to start X.
If you have done a full install of 15.0 then it is very likely you have sddm installed and when using init level 4 this is the default DM. My first guess would be a missing or messed up configuration file for SDDM. Thus,I would suggest removing all SDDM parts from the system and clean up the SDDM files and directories (if any remain). Then reinstall SDDM and try again with init level 4.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.