You are not logged in.

#1 2016-09-18 23:34:22

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

vconsole autologin preventing user logoff?

Hallo,
i'm not sure if that's the proper way to boot up the system but that's my current boot procedure:

That works properly so far. I can logout from XFCE and will be on vconsole. That's nice.
Now, when i add myself to a new group (usermod -aG audio myuser), log out from XFCE and on vconsole doing an 'exit' it quickly clears the screen, 'autologin' and 'autostartx' kick in again and i'm back in XFCE. That's ok but the user is not actively in the new group when spawning 'groups' command. Doing an 'id <user>' shows the group has been added successfully. Looks like the logout on vconsole wasn't "successful".
As a workaround i currently reboot the system but that's not very elegant. Why is logging out from vconsole not working anymore? How can i properly log out now to get things like this done?


sys2064

Offline

#2 2016-09-19 07:08:02

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: vconsole autologin preventing user logoff?

I'm not sure that I understand your problem but to add new users to a group straight away without logging out & back in again, use:

newgrp $GROUP

See newgrp(1)

Offline

#3 2016-09-19 12:21:16

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: vconsole autologin preventing user logoff?

Correct me if i'm wrong but 'newgrp' simply spawns a new login shell or something. That's not the same like a clean logout.


sys2064

Offline

#4 2016-09-19 12:37:33

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: vconsole autologin preventing user logoff?

0. You use the X autologin by identifying the TTY you're on, but you have to type exit on the TTY after exiting XFCE, without XFCE automatically coming up again? Somethings wrong.

1. If id shows the groups, then the groups work. It is entirely possible, that the groups command didn't entirely survive the ages and doesn't work as expected anymore. If id says you're fine and everything works, then groups is probably broken, as it is entirely possible, that nothing actually writes in /etc/group anymore (but maybe on boot, I have no clue).

2. Try restarting getty@tty1.service.

3. Try adding a group on TTY2, where no auto-login is present and logout/login from there. Check groups.

Offline

#5 2016-09-19 16:29:24

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: vconsole autologin preventing user logoff?

Awebb wrote:

0. You use the X autologin by identifying the TTY you're on, but you have to type exit on the TTY after exiting XFCE, without XFCE automatically coming up again? Somethings wrong.

That's ok. I'm using 'startx' instead of 'exec startx'.

I've disabled 'Autostart X at login' now and can see that after an 'exit' it clearly says 'logged out' (in my language). New groups are effective as well (in vconsole) but not in X11. So this seems to only apply to X sessions and it childs.

I can login/logout at will (tty or x11). On vconsole new group is present, in x11 not. The x server maybe spawns from an old parent process that doesn't get killed by logging out the current user.

This is from 'root' account (vconsole). User 'maniaxx' is logged off but there are still processes running.

UID        PID  PPID  C STIME TTY          TIME CMD
maniaxx       344     1  0 18:11 ?        00:00:00   /usr/lib/systemd/systemd --user
maniaxx       346   344  0 18:11 ?        00:00:00     (sd-pam)
maniaxx       439   344  0 18:11 ?        00:00:00     /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
maniaxx       456   344  0 18:11 ?        00:00:00     /usr/lib/xfce4/xfconf/xfconfd
maniaxx       488   344  0 18:11 ?        00:00:00     /usr/lib/gvfs/gvfsd
maniaxx       499   344  0 18:11 ?        00:00:00     /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
maniaxx       516   344  0 18:11 ?        00:00:00     /usr/lib/at-spi2-core/at-spi-bus-launcher
maniaxx       524   516  0 18:11 ?        00:00:00       /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
maniaxx       564   344  0 18:11 ?        00:00:00     /usr/lib/gvfs/gvfs-udisks2-volume-monitor
maniaxx       586   344  0 18:11 ?        00:00:00     /usr/lib/gvfs/gvfsd-trash --spawner :1.15 /org/gtk/gvfs/exec_spaw/0
maniaxx       591   344  0 18:11 ?        00:00:00     /usr/lib/gvfs/gvfsd-metadata
maniaxx       818   344  0 18:14 ?        00:00:00     /usr/bin/lashd
maniaxx       831   344  0 18:14 ?        00:00:00     /usr/bin/jackdbus auto
maniaxx       920   344  0 18:15 ?        00:00:00     /usr/lib/GConf/gconfd-2
maniaxx       461     1  0 18:11 ?        00:00:00   /usr/bin/gpg-agent --sh --daemon --write-env-file /home/maniaxx/.cache/gpg-agent-info

Edit: Post cleaned.

Last edited by Maniaxx (2016-09-19 20:28:13)


sys2064

Offline

#6 2016-09-19 18:54:12

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: vconsole autologin preventing user logoff?

Awebb wrote:

2. Try restarting getty@tty1.service.

What about this?

Offline

#7 2016-09-19 20:05:31

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: vconsole autologin preventing user logoff?

Doesn't change anything.  But as you said it seems inconsistent indeed. The Jackserver does react to group change whereas shells/terminals spawned in X do not (at least 'groups'). So its not X in general.
I will try to kill all user processes on vconsole with root account. Lets see what happens.

Edit: 'systemd --user' process seems the culprit. In post #5 you can see most (remaining) processes are childs of it. If i stop it (sudo systemctl stop user-1000.slice) everything works properly (including 'groups' in X). I'm not sure if 'exit' is not the proper command to logout anymore (on systemd) or if that's even intended behavior. I will look up some options in '/etc/systemd/logind.conf' like 'KillUserProcesses='.

Last edited by Maniaxx (2016-09-19 20:40:54)


sys2064

Offline

#8 2016-09-19 20:55:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: vconsole autologin preventing user logoff?

Yes! That's it. Some user processes survive the login. I'd say the only reason this hasn't bugged more people already, is that adding and removing users isn't something many people do several times a day.

Offline

#9 2016-09-19 23:52:02

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: vconsole autologin preventing user logoff?

When setting 'KillUserProcesses=yes' in '/etc/systemd/logind.conf' all processes are killed indeed. Default setting is 'yes'. On Arch its 'No'. I'm wondering why it has been changed here.

KillUserProcesses=

    Takes a boolean argument. Configures whether the processes of a user should be killed when the user logs out. If true, the scope unit corresponding to the session and all processes inside that scope will be terminated. If false, the scope is "abandoned", see systemd.scope(5), and processes are not killed. Defaults to "yes"

https://www.freedesktop.org/software/sy … .conf.html

Last edited by Maniaxx (2016-09-19 23:57:15)


sys2064

Offline

Board footer

Powered by FluxBB