Ldm sometimes hangs at logout
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ldm (Ubuntu) |
Fix Released
|
Low
|
Scott Balneaves |
Bug Description
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(
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
alkisg@alkis:~$ LANG=en dpkg -l ltsp* && sudo chroot /opt/ltsp/i386 dpkg -l ltsp*
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Description
+++-===
ii ltsp-server 5.1.65-0ubuntu2 Basic LTSP server environment
ii ltsp-server-
un ltsp-utils <none> (no description available)
ii ltspfs 0.5.10-0ubuntu1 Fuse based remote filesystem for LTSP thin clients
Desired=
| Status=
|/ Err?=(none)
||/ Όνομα Έκδοση Περιγραφή
+++-===
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
Changed in ldm (Ubuntu): | |
assignee: | nobody → Ryan Niebur (ryan52) |
importance: | Undecided → Low |
status: | New → In Progress |
Changed in ldm (Ubuntu): | |
assignee: | Ryan Niebur (ryan52) → Scott Balneaves (sbalneav) |
Changed in ldm (Ubuntu): | |
status: | In Progress → Fix Committed |
crap, sorry for forgetting to look at this. if somebody else wants to, go ahead.