[Pkg-ltsp-devel] Bug#490897: tcsh logins

Vagrant Cascadian vagrant at freegeek.org
Fri Aug 15 18:13:37 UTC 2008


On Thu, Aug 14, 2008 at 10:48:21PM +0200, Daniel Nilsson wrote:
> On Wed, Aug 13, 2008 at 01:46:14PM -0700, Vagrant Cascadian wrote:

> Please test this patch first

which patch?

if it's a simple patch based on ldm 2.0.6, i can try and get it into
lenny.

otherwise, without a patch that's tested to work with bash, zsh, dash
and tcsh, multiple x sessions and window managers, i don't really have
the time to do the testing.

> , what I found was that I was able to login as a tcsh user but the
> logout seems to hang after the Xsession has ended (gnome-session in my
> testcase). 

the patch i made to ldm 2.0.6 worked with lenny's gnome and icewm, but
not with xfce (session would hang).

> I think this is due to the
> "kill -1 $PPID" and the end of the ssh command above, the $PPID
> variable is not available in a tcsh as far as I know. 

that would make sense, yes.

might be able to try something like "exec /bin/sh kill -1 $PPID". i
think that's the last thing i'll try and if it doesn't work, will wait
for tested patches.

patch attached. tested and works for bash, tcsh, zsh and dash with
gnome, icewm, and xfce4.

if you could please test that patch, i can try and get it into lenny.
then i can work on getting it working upstream, too.

> I don't know what the correct way to do this is so that it doesn't
> depend on the user shell, there is comment in the code:
 
> 
>     /*
>      * FIXME: ditch the kill -1 and use ssh -o exit on the control
>     socket 
>      */
>     command = g_strjoin(" ", "ssh", "-Y", "-t", "-S", ldm.control_socket,
>             "-l", ldm.username, ldm.server, "env" ,client_env,
>             lang ? lang : "", display ? display : "", sound ? sound : "",
>             ldm.session, localdev ? localdev : "",
>             "; kill -1 $PPID", NULL);
> 
> I think that should be ssh -O exit though, but I haven't tested this
> yet.

we tested the "ssh -O exit" approach the recent LTSP developer hackfest,
and i couldn't get it to work, as any lingering X client connections
through the ssh tunnel will prevent the command from completing.

live well,
  vagrant
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## fix-tcsh-logins.dpatch by Vagrant Cascadian <vagrant at freegeek.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad ldm-2.0.6~/src/ldm.c ldm-2.0.6/src/ldm.c
--- ldm-2.0.6~/src/ldm.c	2008-08-13 16:01:35.000000000 -0700
+++ ldm-2.0.6/src/ldm.c	2008-08-15 10:35:43.000000000 -0700
@@ -258,6 +258,7 @@
     cmd[i++] = "-l";
     cmd[i++] = ldminfo.username;
     cmd[i++] = ldminfo.server;
+    cmd[i++] = "env";
     cmd[i++] = ltspclienv;
 
     /*
@@ -313,6 +314,8 @@
     }
 
     cmd[i++] = ";";
+    cmd[i++] = "exec";
+    cmd[i++] = "sh";
     cmd[i++] = "kill";
     cmd[i++] = "-1";
     cmd[i++] = "$PPID";
diff -urNad ldm-2.0.6~/src/sshutils.c ldm-2.0.6/src/sshutils.c
--- ldm-2.0.6~/src/sshutils.c	2008-08-15 10:34:48.000000000 -0700
+++ ldm-2.0.6/src/sshutils.c	2008-08-15 10:34:48.000000000 -0700
@@ -68,6 +68,7 @@
     sshcmd[i++] = "echo";
     sshcmd[i++] = SENTINEL;
     sshcmd[i++] = ";";
+    sshcmd[i++] = "env";
     sshcmd[i++] = "LANG=C";
     sshcmd[i++] = "/bin/sh";
     sshcmd[i++] = "-";


More information about the Pkg-ltsp-devel mailing list