Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
[Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Hi all,
I've run into an issue with Xfce on Debian 11 and 12 (Testing). When installed without root (sudo), the power manager options for shutdown and reboot are disabled. It's not possible to shut down the system via the power menu, instead `sudo systemctl poweroff` needs to be entered into the terminal (or any other shutdown command, for that matter).
Although systemctl is probably no userspace command, I don't think this is supposed to be intended behavior.
I've also briefly tried KDE and its power menu seems to work, although I also wasn't able to shut down without sudo from the terminal.
Any way to fix this or is this a known issue?
How to replicate: Install current Debian with sudo and Xfce and try a shutdown.
I've run into an issue with Xfce on Debian 11 and 12 (Testing). When installed without root (sudo), the power manager options for shutdown and reboot are disabled. It's not possible to shut down the system via the power menu, instead `sudo systemctl poweroff` needs to be entered into the terminal (or any other shutdown command, for that matter).
Although systemctl is probably no userspace command, I don't think this is supposed to be intended behavior.
I've also briefly tried KDE and its power menu seems to work, although I also wasn't able to shut down without sudo from the terminal.
Any way to fix this or is this a known issue?
How to replicate: Install current Debian with sudo and Xfce and try a shutdown.
-
- Global Moderator
- Posts: 2638
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 192 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Seems so.
I'm not inclined to test rootless installs...
viewtopic.php?t=154191
Instead of a forced edit. a better way to add a user to a group if package adduser is installed, and a root terminal of sorts available. Try group 'adm'
Code: Select all
# adduser User group
this may give some ideas, the polkit rules should work without a root account I'd assume. And note the polkit change I referenced, Debian 11 and 12 are different.
- None1975
- df -h | participant
- Posts: 1388
- Joined: 2015-11-29 18:23
- Location: Russia, Kaliningrad
- Has thanked: 45 times
- Been thanked: 65 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Hello. Once logged in as a user, you can verify whether or not the user belongs to group=sudo using either the id or groups commands. E.g., a user with id=foo should see output from
Code: Select all
$ groups
Code: Select all
foo sudo
To add an existing user with
Code: Select all
id=foo
First get root (e.g., sudo su -) and then run the command
Code: Select all
# adduser foo sudo
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github
Debian Wiki | DontBreakDebian, My config files on github
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Hi,
I've also read somewhere that the user should be added to certain power* groups in Xfce, however there are no predefined groups with any such name.
Since I considered this kind of a botched installation, I just tried installing other DEs on top to see if they would work. After installing the MATE desktop, the power menu options suddenly became available for the user in Xfce as well.
I assume there is some package missing from the Xfce install, but I don't know which one. I had installed pm-utils beforehand, because I read that would solve the issue, but that also wasn't the culprit, probably because it has been replaced by systemd at some point.
I still don't really consider this solved, because a standard Xfce DE as offered by the installer should work out of the box imho, but not sure how to find out what exactly is missing.
That by itself changed nothing, I'm not sure at this point if there was an "adm" group defined to begin with, but adding the user didn't solve the issue.
I've also read somewhere that the user should be added to certain power* groups in Xfce, however there are no predefined groups with any such name.
The user account was successfully added to the sudo group by the installer from the beginning. I was also able to use sudo without any issue, just not reboot, shutdown, suspend without root credentials from the GUI.None1975 wrote: ↑2023-03-11 12:01 Hello. Once logged in as a user, you can verify whether or not the user belongs to group=sudo using either the id or groups commands. E.g., a user with id=foo should see output fromlikeCode: Select all
$ groups
Code: Select all
foo sudo
Since I considered this kind of a botched installation, I just tried installing other DEs on top to see if they would work. After installing the MATE desktop, the power menu options suddenly became available for the user in Xfce as well.
I assume there is some package missing from the Xfce install, but I don't know which one. I had installed pm-utils beforehand, because I read that would solve the issue, but that also wasn't the culprit, probably because it has been replaced by systemd at some point.
I still don't really consider this solved, because a standard Xfce DE as offered by the installer should work out of the box imho, but not sure how to find out what exactly is missing.
-
- Global Moderator
- Posts: 2638
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 192 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Certainly if you installed from the xfce meta package it should work. I can't figure what's missing.
My simple ~800 package minimal xfce with only the one user group and no sudo authority can still shut down from the menu. Install with a root account and one user, I see no reason to do it otherwise especially with xfce. Sudo tuns out to be a style preference and not at all required. Another DE installation over the top fixing something in xfce is pure coincidence.
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Which package do you mean? xfce4?
That was already installed by the Debian Installer, apt said newest version, so no changes. I have set up a new system just to confirm it wasn't a bad installation and I still couldn't access the power menu options. I also installed xfce4*, just to be sure, but that didn't change anything.
I did not install Xfce via console, I selected it from the DE menu of the text-based netinstall.
Yes, it is a workflow preference, but sudo is not some random, obscure software and it's offered by the installer, so any user would expect it to work.CwF wrote: ↑2023-03-15 04:43 My simple ~800 package minimal xfce with only the one user group and no sudo authority can still shut down from the menu. Install with a root account and one user, I see no reason to do it otherwise especially with xfce. Sudo tuns out to be a style preference and not at all required.
The solution to this issue can't be to "just use a root account" plus that has other drawbacks and potential complications as well, depending on usage.
It's not a coincidence in this case, I was able to reproduce it in the current installation by just installing mate-calc, pluma and caja with a few extensions (not the full MATE metapackage). I had used those programs previously, so I was going to install them anyway, but Xfce should work without having half of MATE on board, from my understanding there should be some gnome package that needs to be shipped with Xfce by default.
- Hallvor
- Global Moderator
- Posts: 2029
- Joined: 2009-04-16 18:35
- Location: Kristiansand, Norway
- Has thanked: 139 times
- Been thanked: 206 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
You have the package xfce4-power-manager installed, right?
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD
-
- Global Moderator
- Posts: 2638
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 192 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Thank you, that is a suggested package and not a hard dependency. However my mini xfce install does not have that package, and session-logout works without a password, without sudo, without a polkit rule.
Code: Select all
$ xfce4-session-logout
-
- Global Moderator
- Posts: 2638
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 192 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
above I typed with a password, corrected to without!
Yes, my bad.
- sunrat
- Administrator
- Posts: 6412
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 116 times
- Been thanked: 462 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Debian normally installs recommended packages as default, but not suggested packages.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
-
- Posts: 198
- Joined: 2021-08-13 19:55
- Location: Minnesota
- Has thanked: 7 times
- Been thanked: 37 times
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Yes, I thought the Expert mode of the installer had an option for that, but after double checking it doesn't. It looks like you can do it via preseeding, but that is even far less likely to have happened.
-
- Posts: 263
- Joined: 2023-03-02 05:26
- Location: USA
- Has thanked: 50 times
- Been thanked: 60 times
- Contact:
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
This is irrelevant, there is a root user, it just does not have a password. It is inaccurate to call it "without root".When installed without root (sudo)
instead `sudo systemctl poweroff` needs to be entered into the terminal (or any other shutdown command, for that matter).
By default, systemctl uses policy kit to give unprivileged users access to shutdown.
Using, (you should NOT need to use sudo)
Code: Select all
$systemctl poweroff
As an unprivileged user should cause one of three things to happen:
1. Shut down the system
2. Demand a password to set a wall message
3. Fail entirely with an error message
Is much more telling, this has nothing to do with XFCE. Your policykit configuration is for some reason borked.I've also briefly tried KDE and its power menu seems to work, although I also wasn't able to shut down without sudo from the terminal.
This is strange as the way policykit is configured, if you are in an active session, ALL users should have access to poweroff.
Are you remoting into your machine in some way? That will significantly change things.
https://wiki.debian.org/Xfce
Be seeing you...
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
Hi, sorry for the late reply, I had to use the device for a while and couldn't analyze this further.
No, this is just a normal desktop (or laptop, in this case) installation used locally.
I have reinstalled once again now and what I can absoutely say is that:
a) I can reproduce this.
b) xfce4-power-manager is preinstalled.
c) Installing xfce4-dev-tools enables the power options (reboot/shutdown/suspend).
d) Installing "mate" will also result in accessible power options, installing mate-desktop alone does not.
I have installed all missing Xfce packages one-by-one (including such things as the panel eyes) and only after installing the dev tools, the power menu was "unlocked". Also, I previously thought this would happen by just installing pluma, calc and caja from the MATE-DE, but that wasn't the case.
CynicalDebian wrote: ↑2023-03-17 01:03 Are you remoting into your machine in some way? That will significantly change things.
No, this is just a normal desktop (or laptop, in this case) installation used locally.
I have reinstalled once again now and what I can absoutely say is that:
a) I can reproduce this.
b) xfce4-power-manager is preinstalled.
c) Installing xfce4-dev-tools enables the power options (reboot/shutdown/suspend).
d) Installing "mate" will also result in accessible power options, installing mate-desktop alone does not.
I have installed all missing Xfce packages one-by-one (including such things as the panel eyes) and only after installing the dev tools, the power menu was "unlocked". Also, I previously thought this would happen by just installing pluma, calc and caja from the MATE-DE, but that wasn't the case.
-
- Posts: 263
- Joined: 2023-03-02 05:26
- Location: USA
- Has thanked: 50 times
- Been thanked: 60 times
- Contact:
Re: [Software] Sudo + Xfce = no shutdown or reboot (Debain 11/12)
I don't know if I didn't make this clear, but the fact thatI have reinstalled once again now and what I can absoutely say is that:
Code: Select all
$systemctl poweroff
The way it works is
systemctl calls '/usr/share/polkit-1/actions/org.freedesktop.login1.policy'
'org.freedesktop.login1.policy'
Code: Select all
<action id="org.freedesktop.login1.power-off">
<description gettext-domain="systemd">Power off the system</description>
<message gettext-domain="systemd">Authentication is required to power off the system.</message>
<defaults>
<allow_any>auth_admin_keep</allow_any>
<allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>yes</allow_active>
This is very confusing, but basically <allow_active>yes</allow_active> being set to 'yes' means that ANY user should be able to call to poweroff as long as they are an 'active' session, basically meaning not remote.
Code: Select all
$sudo systemctl poweroff
Which is why if you want help figuring out the issue please post the error that
Code: Select all
$systemctl poweroff
Be seeing you...