[FreeNX-kNX] A Fix for the problem of multiple attempts needed to login to FreeNX after a re-boot
Antoine Martin
antoine at nagafix.co.uk
Wed Apr 7 21:40:00 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
[snip]
> When backgrounding a script to launch something upon which
> something else depends, bear in mind that the the script launch
> will return straight away, then continue with the load.
>
> To emulate synchronous launching, a delay must be introduced.
Well spotted! I had hit this bug too.
Generally happened when I was doing a well rehearsed demo.. ;)
The solution that I have used successfully (and is also used in neatx)
is to watch the output of the nxagent process: once the line saying
"Waiting for connection from ..." shows up, you can be certain that the
socket is ready.
I have also previously used a tcp-connect loop (with a 1 second
timeout), but the log parsing is both quicker and more proper.
The "sleep 4" that you have added may work in most cases, but you can't
guarantee that it is the correct delay. Too short and it causes the
aforementioned bug, too long is also problematic as it slows down
session startup unnecessarily. (4 extra seconds is pretty long when you
don't actually need it in most cases)
You should be able to parse the log file in /bin/sh too, or just grep
it. Do this in a loop with a "sleep 1" and you should be able to avoid
the unnecessary wait.
This sort of thing has bugged me for years with freenx, and in the end I
gave up and wrote my own client/server without trying to remain
compatible with the original NX server.
My 2p
Cheers
Antoine
>
>
> Patch for nxnode 0.7.3
>
> Watch out for line wraps messing up the diff.
>
> It will probably be easier to look for xrdb -merge in an editor
> and add the sleep.
>
> --- nxnode.orig 2008-11-28 12:18:13.000000000 +0000
> +++ nxnode.mod 2010-04-07 14:44:18.000000000 +0100
> @@ -328,6 +328,9 @@
> NODE_WM_PID=$!
> fi
>
> + # Patch - delay to allow nxagent to complete lauching. ccb 20100407
> + sleep 4
> +
> echo "Xft.dpi: 96" | DISPLAY=:$display xrdb -merge
>>>"$USER_FAKE_HOME/.nx/C-$sess_id/session" 2>&1
> [ -d /etc/X11/Xresources ] && xrdb -display :$display -merge
> /etc/X11/Xresources/* >>"$USER_FAKE_HOME/.nx/C-$sess_id/session" 2>&1
>
>
>
> If this works for you, please let us know so the next
> people with this problem have some idea if it is a fix
> for them or not !!
>
> If it doesn't work I'm sure you will say something!!
>
>
> cb
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> ________________________________________________________________
> Were you helped on this list with your FreeNX problem?
> Then please write up the solution in the FreeNX Wiki/FAQ:
>
> http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
>
> Don't forget to check the NX Knowledge Base:
> http://www.nomachine.com/kb/
>
> ________________________________________________________________
> FreeNX-kNX mailing list --- FreeNX-kNX at kde.org
> https://mail.kde.org/mailman/listinfo/freenx-knx
> ________________________________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEAREKAAYFAku8+68ACgkQGK2zHPGK1rtW9wCfezKY/yCoTMpOtQ2d55DJZx0l
758An3on5jn6B4IRGitCPDVAdDKl4j4N
=U1L/
-----END PGP SIGNATURE-----
More information about the FreeNX-kNX
mailing list