<br>
<br><tt><font size=2>Alexander Todorov <alexx.todorov@gmail.com>
wrote on 27/10/2009 10:51:54:<br>
<br>
> I'm replying to myself :)<br>
> <br>
> > <br>
> > Is there any documentation about the inner workings of freenx?
Can<br>
> you tell me<br>
> > which bash script is executed first, which second, etc. so I
can figure out<br>
> > where to stuff my code? Any pointers are welcome.<br>
> > <br>
> <br>
> I've changed the node.conf and nxnode::node_terminate_session() to
execute a<br>
> script after the session is terminated. This works pretty well for
me and is<br>
> only executed on terminate, not on suspend or when the nxclient is
killed (or<br>
> power failure) for instance. See svn diff output below. Comments are
welcome.<br>
> <br>
> <br>
> Index: node.conf.sample<br>
> ===================================================================<br>
> --- node.conf.sample (revision 631)<br>
> +++ node.conf.sample (working copy)<br>
> @@ -648,3 +648,6 @@<br>
> #<br>
> # If nxviewer cannot be found this is set automatically to "1".<br>
> #ENABLE_EXTERNAL_NXVIEWER="0"<br>
> +<br>
> +# Execute a script after session is terminated<br>
> +#USER_SCRIPT_AFTER_SESSION_CLOSE=""<br>
> Index: nxnode<br>
> ===================================================================<br>
> --- nxnode (revision 631)<br>
> +++ nxnode (working copy)<br>
> @@ -156,6 +156,9 @@<br>
> <br>
> [ "$SESSION_LOG_CLEAN" = "0"
-a "$2" = "failed" ] && mv<br>
> "$USER_FAKE_HOME/.nx/C-$1/" "$USER_FAKE_HOME/.nx/F-C-$1"<br>
> [ "$SESSION_LOG_CLEAN" = "0"
-a "$2" != "failed" ] && mv<br>
> "$USER_FAKE_HOME/.nx/C-$1/" "$USER_FAKE_HOME/.nx/T-C-$1"<br>
> +<br>
> + # execute script after session is terminated<br>
> + [ ! -z "$USER_SCRIPT_AFTER_SESSION_CLOSE"
] &&<br>
> "$USER_SCRIPT_AFTER_SESSION_CLOSE"<br>
> }<br>
> <br>
> #<br>
> <br>
> <br>
> <br>
> For USER_SCRIPT_AFTER_SESSION_START I'm not quite sure though.<br>
> nxnode::startsession() looks like the proper place for me but
the script was<br>
> executed after session start and after resume. The NoMachine NX server
has<br>
> different variables for those two actions. I'd have to figure out
onwhich line<br>
> to put my changes, currently they are just before the last wait in
the<br>
> startsession() function and don't work quite well.</font></tt>
<br>
<br>
<br><tt><font size=2>Do you want this before or after starting the X window
system ??</font></tt>
<br>
<br><tt><font size=2>Look for "node_start_applications".</font></tt>
<br>
<br><tt><font size=2>startsession() does the resume too, ( as startsession
"restore" ), but then it knows it's doing a resume . . .</font></tt>
<br>
<br><tt><font size=2><br>
> <br>
> --<br>
> Alexander.<br>
> <br>
> ________________________________________________________________<br>
> Were you helped on this list with your FreeNX
problem?<br>
> Then please write up the solution in the FreeNX Wiki/FAQ:<br>
> <br>
> </font></tt><a href="http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ"><tt><font size=2>http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ</font></tt></a><tt><font size=2><br>
> <br>
> Don't forget to check the NX Knowledge
Base:<br>
> </font></tt><a href=http://www.nomachine.com/kb/><tt><font size=2>http://www.nomachine.com/kb/</font></tt></a><tt><font size=2>
<br>
> <br>
> ________________________________________________________________<br>
> FreeNX-kNX mailing list --- FreeNX-kNX@kde.org<br>
> </font></tt><a href="https://mail.kde.org/mailman/listinfo/freenx-knx"><tt><font size=2>https://mail.kde.org/mailman/listinfo/freenx-knx</font></tt></a><tt><font size=2><br>
> ________________________________________________________________<br>
</font></tt>