[FreeNX-kNX] Sanity check...
FabianFranz at gmx.de
Sat Apr 23 15:41:40 UTC 2005
-----BEGIN PGP SIGNED MESSAGE-----
Am Samstag, 23. April 2005 17:32 schrieb Ed Warnicke:
> On Saturday 23 April 2005 07:03 am, Fabian Franz wrote:
> > exec 3>&1 # save stdout
> > exec 1>&2 # put all stdout to stderr instead
> > netcat >&3 # connect with old stdout
> > to prevent the effects that _any_ message goes to stdout after the bye
> > command.
> > But this needs testing and evaulation.
> That seems like a good first approach ;)
Ok, I'll add a FR to do that.
> I dug into this more after I sent the email.
> As it turns out there is a race condition between
> nc and the starting of the nxagent by nxnode.
Good catch! This should solve many more problems.
> If nxagent isn't ready to accept the connection
> from nc when the nc call is made, then nc quietly
> exits and you fail in negotiating link parameters.
> This failure is partially masked by the 'NX>'
> error. I debuged this with something like
> log "netcat started"
> netcat [...]
> log "netcat finished with exit code $?"
> which showed an exit code of 1. After that
> line you saw the 'NX> [...]" lines associated with
> nxagent listening for connections.
> sleep 3; netcat [...]
> fixed the problem (which for some reason was
> reliably occuring for me last night).
Thats great :-). I mean: How could you have debugged it else ;-)?
> So I am pretty
> sure there is a race condition between calling
> nc in nxserver and the nxagent started by nxnode
> I don't think a sleep is the right solution
> though. Thoughts?
while [ $TRY -gt 0 ]
netcat && break
if [ $TRY -eq 0 ]
echo "NX> 550 Error: nxagent failed to start after three tries." 1>&2
PS: Please test and then I can apply it to CVS.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the FreeNX-kNX