LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-10-2022, 06:40 AM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,409

Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
Exit X on runlevel 4?


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?
 
Old 06-10-2022, 06:56 AM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,302
Blog Entries: 61

Rep: Reputation: Disabled
What DE or WM?
 
Old 06-10-2022, 08:09 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,409

Original Poster
Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
XFCE, the low(er) cholesterol WM. Sorry, but it does simplify things. I also made sure it wasn't some background task holding me up. A few do that.
 
Old 06-10-2022, 08:15 AM   #4
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,797

Rep: Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436
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

Code:
Section "InputClass"
    Identifier         "Keyboard0"
    Driver             "evdev"
    MatchIsKeyboard    "on"
    MatchDevicePath    "/dev/input/event*"
    Option         "XkbLayout" "us"
        #Option "XkbVariant" ""
    Option         "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
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.
 
Old 06-10-2022, 08:21 AM   #5
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,754

Rep: Reputation: Disabled
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.
 
Old 06-10-2022, 10:16 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,302
Blog Entries: 61

Rep: Reputation: Disabled
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
 
Old 06-10-2022, 01:43 PM   #7
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 992

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
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?

regards Henrik
 
Old 06-10-2022, 02:32 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,409

Original Poster
Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
Thanks for all replies, guys.

@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.
 
Old 06-10-2022, 03:19 PM   #9
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 992

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
Quote:
Originally Posted by business_kid View Post
@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

/usr/share/config/ksmserverrc

and

/usr/share/polkit-1/actions/org.xfce.session.policy

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.

regards Henrik
 
Old 06-11-2022, 01:32 AM   #10
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,754

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
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.
 
Old 06-11-2022, 11:16 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,409

Original Poster
Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
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.
 
Old 06-11-2022, 11:55 AM   #12
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,754

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
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.
 
Old 06-11-2022, 12:37 PM   #13
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 781

Rep: Reputation: 895Reputation: 895Reputation: 895Reputation: 895Reputation: 895Reputation: 895Reputation: 895
Quote:
Originally Posted by elcore View Post
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.
 
Old 06-11-2022, 02:40 PM   #14
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,409

Original Poster
Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
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)
  1. You can't suspend.
  2. You can't restsart.
  3. 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.
 
Old 06-11-2022, 02:56 PM   #15
hoodlum7
Member
 
Registered: May 2016
Posts: 40

Rep: Reputation: Disabled
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.
 
  


Reply



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
What's the difference between runlevel 2 and runlevel 5 in Debian? davidas Linux - Newbie 2 01-05-2012 01:10 PM
New Install of PCLinuxOS boots into runlevel 3. Should be runlevel 5 MonctonJohn Linux - General 4 02-01-2008 04:38 PM
Go into runlevel 3 after a runlevel 4 crash davidguygc Linux - General 1 08-24-2007 08:23 PM
Soun Mixer absent in Runlevel 3 but present in Runlevel 5 debloxie SUSE / openSUSE 1 01-18-2006 09:15 AM
X does not start in Runlevel 4, but i Runlevel 3 Rabon Linux - General 3 11-18-2003 06:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:13 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration