Session not completely terminated after "End" (patch)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
FreeNX Server |
New
|
Undecided
|
Unassigned |
Bug Description
I'm using freenx-server 0.7.3.zgit.
When I terminate sesions by using the "X" button of the window and selecting "End" or when the session is disconnected due to loss of the network connection I get hanging sessions. Sometimes it is no longer possible to connect with NX Client, somtimes I get a list of sessions but can neither resume nor terminate them.
When I call "sudo /etc/init.
In /var/log/
NX> 105 server_nxnode_echo: NX> 1006 Session status: running
bye
Bye
NX> 999 Bye
nxnode_reader: NX> 1009 Session status: terminating
NX> 1009 Session status: terminating
session_status BC732222297E97A
server_nxnode_echo: NX> 1009 Session status: terminating
Info: Closing connection to slave with pid 29383.
nxnode_reader: 1001 Bye.
1001 Bye.
nxnode_reader: expect: spawn id exp7 not open
nxnode_reader: while executing
nxnode_reader: "expect "NX> 1001 Bye.""
nxnode_reader: (file "/usr/lib/
expect: spawn id exp7 not open
while executing
"expect "NX> 1001 Bye.""
(file "/usr/lib/
/usr/lib/
In /usr/lib/nx/nxnode the message is sent with
echo "$DELIM 1001 Bye."
and DELIM is set to
DELIM="NX>"
And it might also be
[ -n "$2" ] && DELIM="NX-$2>"
but I don't know under which circumstances $2 is passed to nxnode.
But there is a case when DELIM is set to an empty string or something else.
if [ "$CMD" = "--startsession" -o "$CMD" = "--resumesession" ]
fi
When this case is executed, the exit message is sent without the prefix "NX>"
I replaced DELIM with DELIM2 in the "else" branch which seems to fix the problem. (see patch)
With this fix the log is OK:
NX> 105 server_nxnode_echo: NX> 1006 Session status: running
bye
Bye
NX> 999 Bye
nxnode_reader: NX> 1009 Session status: terminating
NX> 1009 Session status: terminating
session_status 00AB6151468BEAD
server_nxnode_echo: NX> 1009 Session status: terminating
Info: Closing connection to slave with pid 32307.
nxnode_reader: NX> 1001 Bye.
NX> 1001 Bye.
server_nxnode_echo: NX> 1001 Bye.
Info: Closing connection to slave with pid 32307.
General remarks:
I don't know the specification of the protocol, but I think the system is a bit fragile. When comparing to FTP protocol or similar, I think it would be better to check the message number only, not the message text, e.g. "expect "NX> 1001 "".
If it is really possible for DELIM to be "NX-$2>" a pattern should be used, e.g. "expect "NX*> 1001 "".
Bodo