The officially official Devuan Forum!

You are not logged in.

#1 2021-08-28 10:02:16

Rena
Member
Registered: 2021-08-28
Posts: 2  

[SOLVED] Mounting and shutdown not allowed as normal user

Hi,

a few days ago KDE suddenly started to

a) deny mounting USB drives.
The drive pops up in the desktop's system tray, but when I try to open it, it says I have insufficient rights. I have to open a console and mount as root, only then I can open the drive using a file manager.

b) deny shutdown.
Whenever I try to shutdown from the KDE desktop, I end up with the login manager slim's login page; only from there I can shutdown. (I can, however, still suspend the system using KDE.)

Both of this used to work with my normal user account. I have no idea why this happened and how to fix it to get back to the previous behaviour.

I'm sure I did not modify any system settings. Might have done an apt upgrade in the days before, but I don't see why that all of a sudden should mess with the settings. I'm lost in several explanations on the web involving polkit and policykit, which are apparently incompatible, and even found some systemd files (specifically /usr/share/polkit-1/actions/org.freedesktop.login1.policy), even though I am and have always been using runit with Devuan.

Confused, any help appreciated! I don't want to install the whole system again.

Last edited by Rena (2021-08-28 10:05:28)

Offline

#2 2021-08-28 10:19:16

alphalpha
Member
From: Germany
Registered: 2018-01-23
Posts: 146  

Re: [SOLVED] Mounting and shutdown not allowed as normal user

Not a KDE user, but it is normal that you need root privileges to shutdown and mount.
I cant tell you how KDE handles this by default, but what you can do is edit your /etc/sudoers

EDITOR=nano sudo visudo

and add this:

yourUserName ALL = NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff

maybe KDE uses the wheel group for this and you are not a member of the wheel group but i dont know

for mounting you can install usbpmount

sudo apt install usbpmount

Offline

#3 2021-08-28 14:07:07

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: [SOLVED] Mounting and shutdown not allowed as normal user

Look in /var/log/apt/history.log to see what was recently installed or removed. Something related to policykit or elogind might be missing. You shouldn't need to enable sudo for these things in kde.

Offline

#4 2021-08-29 08:46:47

Rena
Member
Registered: 2021-08-28
Posts: 2  

Re: [SOLVED] Mounting and shutdown not allowed as normal user

Thanks for your replies.

Strange thing happened this morning, mounting and shutdown worked as they used to - one time. After a reboot, the issue was back. Didn't change anything in the meantime, so the issue seemed to appear at random.

apt's history did not show anything unexpected, neither Firefox, Thunderbird nor sane should mess with this. I dumped avahi, though. Not a permissions thing either, but …

Checked elogind and "loginctl list" returned "No sessions.", which, being logged in, didn't seem right. A further look into elogind turned up this warning on https://wiki.gentoo.org/wiki/Elogind#Service

if there are problems getting poweroff/reboot/suspend etc. working from desktop environment, putting elogind into boot runlevel will make sure it is started properly before any user is logged in and so should fix the problem.

There I had all the puzzle pieces. Here's what happened:
I have elogind started by runit. My desktop is started automatically by slim, which in turn was still started using a sysv init script.

The removal of avahi apparently triggered a race condition. With avahi gone, the desktop started earlier than elogind - no elogind, no shutdown permissions.

Moved slim to runit, made it conditional on elogind, et voilà: Works.

Thanks again for the apt and elogin hints!

Offline

#5 2021-09-14 16:34:56

mclien
Member
Registered: 2020-02-29
Posts: 100  

Re: [SOLVED] Mounting and shutdown not allowed as normal user

well. I thought I found my solution, but no "usbpmout" in the repos (I assumed a typo, but no usbmount either).

running beowulf.

Last edited by mclien (2021-09-14 16:49:39)

Offline

#6 2021-09-14 16:49:31

golinux
Administrator
Registered: 2016-11-25
Posts: 3,317  

Re: [SOLVED] Mounting and shutdown not allowed as normal user

Offline

#7 2021-09-14 17:12:30

mclien
Member
Registered: 2020-02-29
Posts: 100  

Re: [SOLVED] Mounting and shutdown not allowed as normal user

yes. Thanks.
I normaly don't use this much, but now I have to set up a machine, which serves as the operating terminal for my lasercutter, which will be used by others, too.

So next step is automounting USB thumb drives.

Offline

Board footer