3

I just added myself to "docker" group on my workstation. I dutifully logged out and in again on my desktop environment but I'm still not on the group:

mcon@cinderella:~$ id
uid=1000(mcon) gid=1000(mcon) groups=1000(mcon),20(dialout),27(sudo),46(plugdev),115(lpadmin),124(vboxusers)
mcon@cinderella:~$ grep mcon /etc/group
dialout:x:20:mcon,mauro
sudo:x:27:mcon
plugdev:x:46:mcon
mcon:x:1000:
lpadmin:x:115:mcon
vboxusers:x:124:mauro,mcon
docker:x:136:mcon

I'm under an up-to-date Debian Sid. My desktop is Gnome/Cinnamon

I know this can be fixed by rebooting, but I would like to understand what's going on.

Note that using the "su trick" actually works:

mcon@cinderella:~$ su - mcon
Password: 
mcon@cinderella:~$ id
uid=1000(mcon) gid=1000(mcon) groups=1000(mcon),20(dialout),27(sudo),46(plugdev),115(lpadmin),124(vboxusers),136(docker)

WHY logging out and then in again does not?

UPDATE: further investigation shows that after logout there still are a ton of processes running with my userid, including systemd, sh, various gvfs-whatever, gpg-agent, etc. Killing the shell did not change anything and but I'm a bit scared about killing them all. Logging-out shouldn't end all activities in my behalf? This looks like a security hole (or not?). I will try to kill all those processes to see if something is "keeping session alive" (at worst I'll have to reboot).

Update2 (as asked by @StephenKitt):

mcon@cinderella:~$ loginctl show-user $(whoami)
UID=1000
GID=1000
Name=mcon
Timestamp=Sat 2019-03-23 15:01:35 CET
TimestampMonotonic=24931331
RuntimePath=/run/user/1000
Service=user@1000.service
Slice=user-1000.slice
Display=2
State=active
Sessions=2
IdleHint=no
IdleSinceHint=1553356954121832
IdleSinceHintMonotonic=7284187020
Linger=no

Update3 (inspired by @StephenKitt):

Apparently session2 exists, but seems to be the only one present... but the command without argument gives a different view and says there's only one active session. I'm quite confused; where does the "Sessions=2" above come from?

mcon@cinderella:/tmp/ca$ loginctl show-session
EnableWallMessages=no
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
IdleHint=no
IdleSinceHint=1553356954121832
IdleSinceHintMonotonic=7284187020
BlockInhibited=handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
DelayInhibited=shutdown:sleep
InhibitDelayMaxUSec=30s
UserStopDelayUSec=10s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=yes
LidClosed=no
OnExternalPower=yes
RemoveIPC=yes
RuntimeDirectorySize=3314405376
InhibitorsMax=8192
NCurrentInhibitors=7
SessionsMax=8192
NCurrentSessions=1
mcon@cinderella:/tmp/ca$ loginctl show-session 2
Id=2
User=1000
Name=mcon
Timestamp=Sat 2019-03-23 15:01:35 CET
TimestampMonotonic=24933340
VTNr=7
Seat=seat0
Display=:0
Remote=no
Service=lightdm
Desktop=lightdm-xsession
Scope=session-2.scope
Leader=2009
Audit=2
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=1553356954121832
IdleSinceHintMonotonic=7284187020
LockedHint=no
  • How did you log out? Are you running a GUI? – roaima Mar 23 at 11:14
  • @roaima: yes, as said I'm using cinnamon. I simply logout from menu->Logout->LeaveSession. This drops me in lightdm, from there I give again user/pass. – ZioByte Mar 23 at 11:18
  • Sorry, I missed the Gnome/Cinnamon bit. You're right, though: logging out and in again should have fixed it. – roaima Mar 23 at 11:23
  • 1
    @roaima: please see Question update. – ZioByte Mar 23 at 11:37
  • What does loginctl show-user $(whoami) show, when you’re logged in? – Stephen Kitt Mar 23 at 16:45
1

It turns out logout will not close all processes running on user behalf. Logging on Linux console (Ctrel-Alt-F1) as root and issuing killall -HUP -u mcon resolves the issue.

Note: the above command will not terminate all processes having effective uid "mcon" (in particular systemd, dbus-daemon and several others resist), but it seems enough to cure the "group reloading" problem.

I'm still wondering why logout does not really clear after itself, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.