[Pkg-ltsp-devel] Bug#490897: tcsh logins
Daniel Nilsson
debian-bugs at dnil.se
Sat Aug 16 21:29:39 UTC 2008
On Fri, Aug 15, 2008 at 11:13:37AM -0700, Vagrant Cascadian wrote:
> 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?
Sorry, I was referring to the 2.0.9 based patch i had been testing and
working on which I felt needed more testing before applying upstream
since it didn't seem to solve the logout problem.
> 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.
Ok, I did some testing with the patch you had attached. What I found
though was that starting up a new shell on the server just for killing
$PPID would probably not solve the issue since that would just kill
the calling shell and not the ssh process which I believe is what the
intent is here. I'm referring to this portion of the patch.
cmd[i++] = ";";
+ cmd[i++] = "exec";
+ cmd[i++] = "sh";
cmd[i++] = "kill";
cmd[i++] = "-1";
cmd[i++] = "$PPID";
What is needed is a more portable way to find the parent process id in
a manner that is not shell dependent and that will find the process id
of the calling ssh process. I worked on that for a while, and the
following seems to do the trick in a shell portable way:
ps -o ppid -p $$ | tail -1
I put that into a 2.0.6 based patch which looks like this:
--- ldm-2.0.6.orig/src/sshutils.c
+++ ldm-2.0.6/src/sshutils.c
@@ -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++] = "-";
--- ldm-2.0.6.orig/src/ldm.c
+++ ldm-2.0.6/src/ldm.c
@@ -258,6 +258,7 @@
cmd[i++] = "-l";
cmd[i++] = ldminfo.username;
cmd[i++] = ldminfo.server;
+ cmd[i++] = "env";
cmd[i++] = ltspclienv;
/*
@@ -315,7 +316,7 @@
cmd[i++] = ";";
cmd[i++] = "kill";
cmd[i++] = "-1";
- cmd[i++] = "$PPID";
+ cmd[i++] = "`ps -o ppid -p $$ | tail -1`";
cmd[i++] = NULL;
xsessionpid = ldm_spawn(cmd);
I tried logging in and out with bash, tcsh, dash and zsh using gnome,
xfce4 and icewm sessions on the server. All those combinations worked
well in my case (server running etch).
I hope that helps!
Regards
--
Daniel Nilsson
More information about the Pkg-ltsp-devel
mailing list