[FreeNX-kNX] Feature #4717 - Script execution on server event

chris at ccburton.com chris at ccburton.com
Tue Oct 27 15:06:07 UTC 2009


Alexander Todorov <alexx.todorov at gmail.com> wrote on 27/10/2009 10:51:54:

> I'm replying to myself :)
> 
> > 
> > Is there any documentation about the inner workings of freenx? Can
> you tell me
> > which bash script is executed first, which second, etc. so I can 
figure out
> > where to stuff my code? Any pointers are welcome.
> > 
> 
> I've changed the node.conf and nxnode::node_terminate_session() to 
execute a
> script after the session is terminated. This works pretty well for me 
and is
> only executed on terminate, not on suspend or when the nxclient is 
killed (or
> power failure) for instance. See svn diff output below. Comments are 
welcome.
> 
> 
> Index: node.conf.sample
> ===================================================================
> --- node.conf.sample    (revision 631)
> +++ node.conf.sample    (working copy)
> @@ -648,3 +648,6 @@
>  #
>  # If nxviewer cannot be found this is set automatically to "1".
>  #ENABLE_EXTERNAL_NXVIEWER="0"
> +
> +# Execute a script after session is terminated
> +#USER_SCRIPT_AFTER_SESSION_CLOSE=""
> Index: nxnode
> ===================================================================
> --- nxnode      (revision 631)
> +++ nxnode      (working copy)
> @@ -156,6 +156,9 @@
> 
>         [ "$SESSION_LOG_CLEAN" = "0" -a "$2" = "failed" ] && mv
> "$USER_FAKE_HOME/.nx/C-$1/" "$USER_FAKE_HOME/.nx/F-C-$1"
>         [ "$SESSION_LOG_CLEAN" = "0" -a "$2" != "failed" ] && mv
> "$USER_FAKE_HOME/.nx/C-$1/" "$USER_FAKE_HOME/.nx/T-C-$1"
> +
> +       # execute script after session is terminated
> +       [ ! -z "$USER_SCRIPT_AFTER_SESSION_CLOSE" ] &&
> "$USER_SCRIPT_AFTER_SESSION_CLOSE"
>  }
> 
>  #
> 
> 
> 
> For USER_SCRIPT_AFTER_SESSION_START I'm not quite sure though.
> nxnode::startsession()  looks like the proper place for me but the 
script was
> executed after session start and after resume. The NoMachine NX server 
has
> different variables for those two actions. I'd have to figure out 
onwhich line
> to put my changes, currently they are just before the last wait in the
> startsession() function and don't work quite well.


Do you want this before or after starting the X window system ??

Look for "node_start_applications".

startsession()  does the resume too, ( as startsession "restore" ), but 
then it knows it's doing a resume . . .


> 
> --
> Alexander.
> 
> ________________________________________________________________
>      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
> ________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20091027/05c80501/attachment.html>


More information about the FreeNX-kNX mailing list