Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-08 Thread Petter Reinholdtsen
[Wolfgang Schweer]
> Seems to be there. At least kdm 4.8.4-4 (sid) shows the same effect,
> same config files, same workaround updates utmp.

Right.  I submitted BTS report #692730 to track the problem in kdm.
Please update it with more details if you got any.

> What about changing the shutdown-at-night script to not use »who«,
> instead looking for shell like bash/dash or session string to find
> logins? Would that be a way for existing installations? Could also
> solve the problem inside the chroot by a simple package update.

Nah, it should still shut down machines even if there are left-over
processes after logout (which happen all the time, leaving shells and
other processes lingering).  But perhaps we can find a better method?
What about ConsoleKit?

In any case, 'who' should report the logged in users, to make sure
'shutdown' know who to notify and other tools know that there are
logged in users present.

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20121108122358.ge29...@login1.uio.no



Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-08 Thread Wolfgang Schweer
On Thu, Nov 08, 2012 at 10:31:42AM +0100, Petter Reinholdtsen wrote:
> Thus the correct workaround for now in Squeeze seem to be to edit
> /etc/kde4/kdm/kdm.options to comment out use-sessreg (just for
> clarity), and edit /etc/kde4/kdm/kdmrc to set UseSessReg=true to get
> utmp updating actually working.  We could use cfengine for this to fix
> new installations.  Not quite sure how we should fix existing
> installations.  Anyone know if this problem is also there in Wheezy?
 
Seems to be there. At least kdm 4.8.4-4 (sid) shows the same effect, 
same config files, same workaround updates utmp.

What about changing the shutdown-at-night script to not use »who«, 
instead looking for shell like bash/dash or session string to find 
logins? Would that be a way for existing installations? Could also solve 
the problem inside the chroot by a simple package update.

Wolfgang



signature.asc
Description: Digital signature


Re: Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-08 Thread Wolfgang Schweer
On Thu, Nov 08, 2012 at 10:31:42AM +0100, Petter Reinholdtsen wrote:
> 
> Thus the correct workaround for now in Squeeze seem to be to edit
> /etc/kde4/kdm/kdm.options to comment out use-sessreg (just for
> clarity), and edit /etc/kde4/kdm/kdmrc to set UseSessReg=true to get
> utmp updating actually working.

According to man kdm.options perhaps instead of commenting out 
»no-use-sessreg« should be used?

Wolfgang



signature.asc
Description: Digital signature


Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-08 Thread Petter Reinholdtsen
Sending this thread back to BTS, to make sure the knowledge is
recorded.

[Wolfgang Schweer]
> According to man kdm.options the option »use-sessreg« should enable
> writing to utmp. That option is set by default in
> /etc/kde4/kdm/kdm.options but doesn't seem to work by some reason.
> Setting the same (?) option in kdmrc does work.

Right.  I found http://bugs.debian.org/303392 > talking about
problems with these options.  The opposite problem in fact, getting
two utmp entries when only one should be included.

> For testing I used a pxeinstalled LTSP-Server (LXDE, gdm) with kdm
> and kdepasswd installed additionally in the chroot. Your proposed
> patch didn't work for diskless workstations. In order to find out if
> kdm would need other writable dirs I installed both packages on the
> server and found that utmp wasn't updated there, too, if kdm was
> used instead of gdm. So I figured all machines would show the same
> failure. Maybe things are different if there's a complete KDE
> desktop installation?

You are right.  I was fooled by konsole adding utmp entries on its
own.  There is no utmp entry for my login on my laptop, only for the
konsole shells I use.  So the problem seem to be a generic kdm issue.

I had a look at the strace for kdm when logging in, and it is trying
to access utmp, but do not write anything to it:

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

Thus the correct workaround for now in Squeeze seem to be to edit
/etc/kde4/kdm/kdm.options to comment out use-sessreg (just for
clarity), and edit /etc/kde4/kdm/kdmrc to set UseSessReg=true to get
utmp updating actually working.  We could use cfengine for this to fix
new installations.  Not quite sure how we should fix existing
installations.  Anyone know if this problem is also there in Wheezy?

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20121108093142.ga29...@login1.uio.no



Re: Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-08 Thread Wolfgang Schweer
On Thu, Nov 08, 2012 at 05:52:03AM +0100, Petter Reinholdtsen wrote:
> 
> I tried to get the built-in utmp registration working, while your 
> approach just disable it and use sessreg instead.  Any idea why the 
> built-in registration do not work for "all Debian Edu Squeeze 
> machines"?  It seem to work on my laptop, so I am a bit unsure what 
> you mean here.
 
According to man kdm.options the option »use-sessreg« should enable 
writing to utmp. That option is set by default in 
/etc/kde4/kdm/kdm.options but doesn't seem to work by some reason. 
Setting the same (?) option in kdmrc does work.

For testing I used a pxeinstalled LTSP-Server (LXDE, gdm) with kdm and 
kdepasswd installed additionally in the chroot. Your proposed patch 
didn't work for diskless workstations. In order to find out if kdm would 
need other writable dirs I installed both packages on the server and 
found that utmp wasn't updated there, too, if kdm was used instead of 
gdm. So I figured all machines would show the same failure. Maybe things 
are different if there's a complete KDE desktop installation?

Wolfgang



signature.asc
Description: Digital signature


Re: Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-07 Thread Petter Reinholdtsen
[Wolfgang Schweer]
> IMO the reason is something else. By default sessreg seems to be
> disabled in kdmrc. So all Debian Edu Squeeze machines using kdm seem
> to be affected.
> 
> Changing /etc/kde4/kdm/kdmrc (ditto in chroot) makes it work.

Right, good with an alternative solution.  I tried to get the built-in
utmp registration working, while your approach just disable it and use
sessreg instead.  Any idea why the built-in registration do not work for
"all Debian Edu Squeeze machines"?  It seem to work on my laptop, so I
am a bit unsure what you mean here.

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2flr4o43de4@diskless.uio.no



Re: Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-07 Thread Wolfgang Schweer
On Wed, Nov 07, 2012 at 11:06:03AM +0100, Petter Reinholdtsen wrote:
> 
> A customer reported that shutdown-at-night on diskless workstations
> running XFCE turn off machines even if there is a user logged in.  The
> cause is that the logged in user is not registered in utmp, causing
> 'who' to not show any logged in users, making shutdown-at-night to
> believe the machine is unused.
> 
> I am not quite sure why, but one idea might be that /var/lib/kdm is used
> to store the current user status, and the fact that this directory isn't
> writable causes kdm to not update utmp.  If that is the case, this patch
> should solve it.

IMO the reason is something else. By default sessreg seems to be 
disabled in kdmrc. So all Debian Edu Squeeze machines using kdm seem to 
be affected.

Changing /etc/kde4/kdm/kdmrc (ditto in chroot) makes it work.

--- kdmrc.orig  2012-11-07 16:16:15.0 +0100
+++ kdmrc   2012-11-07 16:16:28.0 +0100
@@ -302,7 +302,7 @@
 #ClientLogFallback=/var/log/xsession-errors/%u-%d%-r
 # Whether KDM's built-in utmp/wtmp/lastlog registration should be used.
 # Default is false
-#UseSessReg=true
+UseSessReg=true
 
 # Greeter config for all displays
 [X-*-Greeter]

Wolfgang



signature.asc
Description: Digital signature


Bug#692539: debian-edu-config: Diskless workstations with XFCE do not register logged in users in utmp

2012-11-07 Thread Petter Reinholdtsen

Package: debian-edu-config
Version: 1.453
Severity: important

A customer reported that shutdown-at-night on diskless workstations
running XFCE turn off machines even if there is a user logged in.  The
cause is that the logged in user is not registered in utmp, causing
'who' to not show any logged in users, making shutdown-at-night to
believe the machine is unused.

I am not quite sure why, but one idea might be that /var/lib/kdm is used
to store the current user status, and the fact that this directory isn't
writable causes kdm to not update utmp.  If that is the case, this patch
should solve it.

Index: debian/changelog
===
--- debian/changelog(revisjon 78309)
+++ debian/changelog(arbeidskopi)
@@ -11,6 +11,12 @@
 object. Closes: #687256.
   * Fix smbaddclient.sh, use ,,set +e'' instead of non-bash-syntax ,,unset 
-e''.
 
+  [ Petter Reinholdtsen ]
+  * Adjust ltsp_config.d/debian-edu-config-rwbind to make /var/lib/kdm
+writable to allow kdm to record user status, making kdm log logged
+in users to utmp and thus make sure shutdown-at-night do not try
+to turn off occupied diskless workstations used after 16:00.
+
  -- Mike Gabriel   Mon, 20 Aug 2012 12:31:31 
+0200
 
 debian-edu-config (1.454~svn77318) squeeze-test; urgency=low
Index: share/ltsp/ltsp_config.d/debian-edu-config-rwbind
===
--- share/ltsp/ltsp_config.d/debian-edu-config-rwbind   (revisjon 78309)
+++ share/ltsp/ltsp_config.d/debian-edu-config-rwbind   (arbeidskopi)
@@ -43,6 +43,11 @@
rw_dirs="$rw_dirs /var/lib/gdm"
fi
 
+# Make sure KDM is able to update user status
+   if [ -d /var/lib/kdm ] ; then
+   rw_dirs="$rw_dirs /var/lib/kdm"
+   fi
+
 # Make sure rwhod can work
rw_dirs="$rw_dirs /var/spool/rwho"
 

I have not been able to test if this solution work, but mention it here
in case any one have time to test it.

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2fllied3eyc@diskless.uio.no