You are not logged in.
Hi
On Debian GNU/Linux buster/sid with xfce and lightdm, I prevent gui user to shutdown or reboot when another user is logged in with polkit.
For this, like Debian use polkit 1.05, I use 3 pkla files like this one :
cat /etc/polkit-1/localauthority/50-local.d/Reject_All_Users_To_login1_reboot-multiple-sessions.pkla
[Reject all users to use login1_reboot-multiple-sessions]
Identity=unix-user:*
Action=org.freedesktop.login1.reboot-multiple-sessions
ResultAny=no
ResultInactive=no
ResultActive=no
The others are the same with action :
org.freedesktop.login1.power-off-multiple-sessions
org.xfce.session.xfsm-shutdown-helper
It's OK when others users are logged in via TTY (Ctrl+Alt+F3) or ssh.
Now, I try to enabled the switch-user button in xfce menu.
I find a thread in this forum for that.
cat /usr/local/bin/gdmflexiserver
#!/bin/sh
dm-tool switch-to-greeter
It' Ok. I can now switch user from xfce with the button.
but ...
When I use this, I am not more able to shutdown or reboot.
It seems to me that login1 always find another user.
What I do ?
Power on my computer.
Login user1 with lightdm.
Open xfce4-terminal.
ps -e > first_ps
Switch user
Login user2 with lightdm.
Logout user2
Come back with lightdm.
Login user1
ps -e > second_ps.
I can't shutdown or reboot.
The diff in first_ps and second_ps
PID TTY TIME CMD
FIRST 49 ? 00:00:01 kworker/0:2-events
FIRST 1120 pts/0 00:00:00 ps
SECOND 1190 ? 00:00:00 kworker/u16:1-events_unbound
SECOND 1193 ? 00:00:00 systemd
SECOND 1195 ? 00:00:00 (sd-pam)
SECOND 1218 ? 00:00:00 dbus-daemon
SECOND 1251 ? 00:00:00 at-spi-bus-laun
SECOND 1256 ? 00:00:00 dbus-daemon
SECOND 1262 ? 00:00:00 xfconfd
SECOND 1268 ? 00:00:00 gpg-agent
SECOND 1281 ? 00:00:01 applet.py
SECOND 1286 ? 00:00:00 agent
SECOND 1308 ? 00:00:00 dconf-service
SECOND 1318 ? 00:00:00 gvfsd
SECOND 1338 ? 00:00:00 tumblerd
SECOND 1351 ? 00:00:00 gvfs-udisks2-vo
SECOND 1355 ? 00:00:00 gvfs-gphoto2-vo
SECOND 1359 ? 00:00:00 gvfs-goa-volume
SECOND 1363 ? 00:00:00 gvfs-mtp-volume
SECOND 1367 ? 00:00:00 gvfs-afc-volume
SECOND 1375 ? 00:00:00 gvfsd-trash
SECOND 1380 ? 00:00:00 gvfsd-metadata
SECOND 1467 ? 00:00:00 kworker/0:2-mm_percpu_wq
SECOND 1468 pts/0 00:00:00 ps
There is a lot of other lines but there are the same.
I read that the switch_user button is for gdm, so, I like to known if it's the same with it?
What can I do to tell to login1 that user2 is logout?
Thanks
Offline
So even after user2 logs out, there are still processes running for that user?
Does running the following command as a step 11:
loginctl list-sessions
...show 2 sessions?
If so, systemd has a method of force killing all user processes on user logout. To do so, edit /etc/systemd/logind.conf and change:
#KillUserProcesses=no
...to read:
KillUserProcesses=yes
...and restart.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Thank you very much.
It's ok now with :
KillUserProcesses=yes
Offline
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 529.55 KiB (Peak: 530.84 KiB) ]