Public bug reported:
Binary package hint: ldm
Hi,
My TCs had a problem of ldm hanging at logout, waiting for an already-
finished process (the ssh connection) to finish.
The problem was in sshutils.c:
> ldm_wait(pid);
> read(ldm.sshfd, buf, sizeof buf); /* clear any exit message so ssh can
> exit cleanly */
> ldm_wait(ldm.sshpid);
where in my slow terminals half of the time "sshpid" finished before
"pid", so ldm_wait got mixed up and waited 2 times for "sshpid".
To solve this, in ldm.c I had to change
- res = waitid (P_ALL, 0, &info, WEXITED | WSTOPPED);
+ res = waitid (P_PID, pid, &info, WEXITED | WSTOPPED);
so that ldm_wait only waits for the SPECIFIED child, and not for ANY child.
I also had to do the following changes in sshutils.c:
+ fcntl(ldm.sshfd, F_SETFL, O_NONBLOCK);
to make the following clean-up call non-blocking:
read(ldm.sshfd, buf, sizeof buf);
Even though I didn't experience any problems with it, I also thought it
would be nice to change the "read" above to a "while" so that it flushes
sshfd even for size > sizeof buf.
A last note, in ldm_wait I don't think the "while" is needed anymore,
because it waits for the specific child it was called for. I tried it
without the "while" and it works fine, but I'm not sending it to keep
the proposed changes to a minimum. Of course I can send it if you like.
Kind regards,
Alkis Georgopoulos
alk...@alkis:~$ LANG=en dpkg -l ltsp* && sudo chroot /opt/ltsp/i386 dpkg -l
ltsp*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version
Description
+++-=================================-=================================-==================================================================================
ii ltsp-server 5.1.65-0ubuntu2 Basic
LTSP server environment
ii ltsp-server-standalone 5.1.65-0ubuntu2
Complete LTSP server environment
un ltsp-utils <none> (no
description available)
ii ltspfs 0.5.10-0ubuntu1 Fuse
based remote filesystem for LTSP thin clients
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Όνομα Έκδοση Περιγραφή
+++-=================================-=================================-==================================================================================
ii ltsp-client 5.1.65-0ubuntu2 LTSP
client environment
ii ltsp-client-core 5.1.65-0ubuntu2 LTSP
client environment
ii ltspfsd 0.5.10-0ubuntu1 Fuse
based remote filesystem daemon for LTSP thin clients
** Affects: ldm (Ubuntu)
Importance: Undecided
Status: New
--
Ldm sometimes hangs at logout
https://bugs.launchpad.net/bugs/375278
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs