Bug#692730: kdm fail to update utmp when a user log in, causing shutdown-at-night to misbehave
Package: kdm
Version: 4:4.4.5-7+squeeze1
Severity: important
In Debian Edu, we have discovered a fatal problem with kdm, when used
together with shutdown-at-night (See BTS #692539). The problem is that
a client machine is automatically turned off at 16:00, even if a user is
logged in, because 'who' do not report any logged in user when using
kdm. This is turn is caused by kdm failing to update utmp when a user
log in.
To figure out what is going on, I tried to run strace on the "child" kdm
process when I log in with a user, and this is the only section where
utmp is touched:
12214 access("/var/run/utmpx", F_OK) = -1 ENOENT (No such file or directory)
12214 open("/var/run/utmp", O_RDONLY|O_CLOEXEC) = 6
12214 lseek(6, 0, SEEK_SET) = 0
12214 alarm(0) = 0
12214 rt_sigaction(SIGALRM, {0x7f0931fe1340, [], SA_RESTORER, 0x7f0931f0f230}, {0x416e80, [],
+SA_RESTORER|SA_RESTART, 0x7f0931f0f230}, 8) = 0
12214 alarm(10) = 0
12214 fcntl(6, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
12214 read(6, "\10\0\0\0\326\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\2\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\1\0\0\0002N\0\0~\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\10\0\0\0\315\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\7\0\0\0\327/\0\0tty1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\6\0\0\0\302\f\0\0tty5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\6\0\0\0\301\f\0\0tty4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\6\0\0\0\303\f\0\0tty6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\6\0\0\0\300\f\0\0tty3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\6\0\0\0\277\f\0\0tty2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\7\0\0\0009%\0\0pts/0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "\10\0\0\0\0\0\0\0:0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
12214 read(6, "", 384) = 0
12214 fcntl(6, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
12214 alarm(0) = 10
12214 rt_sigaction(SIGALRM, {0x416e80, [], SA_RESTORER|SA_RESTART, 0x7f0931f0f230}, NULL, 8) = 0
12214 close(6) = 0
As you can see, there is no sigh of any write attempt. This is the
current setup.
root@tjener:~# grep -i sessreg /etc/kde4/kdm/kdmrc /etc/kde4/kdm/kdm.options
/etc/kde4/kdm/kdmrc:#UseSessReg=true
/etc/kde4/kdm/kdm.options:use-sessreg
root@tjener:~#
I found <URL: http://bugs.debian.org/303392 > talking about a problem
with these options, and a the problem in the past where utmp was updated
twice. I guess this problem is the flip side of that problem, where
utmp isn't updated at all.
Changing the setting to UseSessReg=true and no-use-sessreg solve the
problem. Perhaps it is a better default? Please fix it in Squeeze, and
ensure it isn't a problem in Wheezy (I have not tested in Wheezy).
--
Happy hacking
Petter Reinholdtsen
Reply to: