[arch-general] xdm, who and X sessions
Hi folks, wanting to go lightweight, I just switched back from kdm to xdm, but I ran into a little snag, which I reported as bug FS#26395 on the bug tracker. I'm no longer sure this is actually a bug, at least not of "who". The problem: After loggin in via xdm, "who" does not show any logged in users. "who /var/run/utmp" on the other hand does show the logged in user. Using kdm, "who" and "who /var/run/utmp" both reported the same result. The reason: There's a small difference between running "who" with or without argument. When run without argument, "who" checks whether the process associated with a session in /var/run/utmp is dead or alive. If it is dead, the entry is not listed in the output. Now, when using xdm, sessreg is run from Xstartup and registers the shell running Xstartup as the PID associated with the session. The shell running Xstartup exits and then xdm fires up Xsetup to start the user's session. Since the shell running Xstartup has exited, there is no longer any process with the PID associated with the session in /var/run/utmp. Hence, who does not report this session. While this explains the source of the problem, I have no idea how to fix it. It seems that what would be needed is to run sessreg as root from a process that stays alive while the user is actually logged into the X session. kdm, for example, does in fact stay alive while the user is logged in. So does xdm, but the PID recorded in /var/run/utmp is not the one of xdm but of the shell it spawns to run Xsetup. Any suggestions would be greatly appreciated. Cheers, Norbert
On 10/11/2011 11:42 AM, Norbert Zeh wrote:
Hi folks,
wanting to go lightweight, I just switched back from kdm to xdm, but I ran into a little snag, which I reported as bug FS#26395 on the bug tracker. I'm no longer sure this is actually a bug, at least not of "who".
Why not use 'slim' instead? -- Rodrigo
Rodrigo Amorim Bahiense [2011.10.11 1149 -0300]:
On 10/11/2011 11:42 AM, Norbert Zeh wrote:
Hi folks,
wanting to go lightweight, I just switched back from kdm to xdm, but I ran into a little snag, which I reported as bug FS#26395 on the bug tracker. I'm no longer sure this is actually a bug, at least not of "who".
Why not use 'slim' instead?
Well, I tried slim before and didn't like it, not sure any more why. In any case, after having produced sufficient noise on this mailing list *and* the bug tracker, I've resolved my problem: the key was to "exec sessreg" as opposed to simply invoking it. This way sessreg replaces the shell as a child process of xdm and registers the correct PID in /var/run/utmp. This is in fact what the original vanilla Xstartup script does, but then things got confusing through the use of themes. In any case, all is well now. Just a related question: If I understand correctly, the configuration in the vanilla xdm-config file says that Xstartup is to be run for all logins other than on display :0, while for display :0 *only* GiveConsole is to be run on startup. Since GiveConsole does not by default start sessreg, logins on :0 are by default not logged in utmp. What's the reasoning behind this? Cheers, Norbert
participants (2)
-
Norbert Zeh
-
Rodrigo Amorim Bahiense