Howto use standalone engine in clustering! (The linux answer I found)
Pierre Sahores
psahores at easynet.fr
Thu Mar 11 01:26:37 EST 2004
Wouaw !!!
What an incredibule usefull piece of code, Kevin ! Thanks, thanks,
thanks,.. :)
Best Regards, Pierre
Le 10 mars 04, à 23:54, Kevin a écrit :
>
>
> Okay, here is my solution it is messy but gets the job done.
>
> Create a user with very little access for my purposes I will call it
> 'clustergui'.
>
> Manually execute vncserver and set the vnc password to something very
> secure!
>
> Create a init.d script (or use the one below) to initialize a
> vncserver secession (protected by local firewall) for user
> 'clustergui'.
>
> Add 127.0.0.1 aka locahost to your system xhost (this gives 127.0.0.1
> aka localhost the right to mount the gui you just created).
>
> Execute the program like so:
>
> rrprogram -display 127.0.0.1:<display#>
>
> Note: You can set the DISPLAY environment varaible to
> 127.0.0.1:<display#> for entire cluster.
>
> Because the firewall is protecting the VNC secession (preventing
> anyone from connecting) the secession will utilize little processor.
> I also configured the ~/.vnc/xstartup to use 'twm' as the window
> manager (significantly lowering the memory foot-print). Using it in
> this manner allows ALL GUI applications to have a X secession (not
> just RR standalones). In fact I am now using matlab with bitmap
> function (which require X) on my cluster.
>
> I am also using this method for my cron/console (dual mode) execution.
>
> The scripts I used to create the secession is below.
>
> Hope this is helpful,
>
> Kevin
>
>
>
> #!/bin/bash
> #
> # chkconfig: - 91 35
> # description: Starts and stops vncserver. \
> # used to provide remote X administration services.
>
> # Source function library.
> . /etc/init.d/functions
>
> # Source networking configuration.
> . /etc/sysconfig/network
>
> # Check that networking is up.
> [ ${NETWORKING} = "no" ] && exit 0
>
> VNCSERVERS=""
> [ -f /etc/sysconfig/vncservers ] && . /etc/sysconfig/vncservers
>
> prog=$"VNC server"
>
> start() {
> echo -n $"Starting $prog: "
> ulimit -S -c 0 >/dev/null 2>&1
> RETVAL=0
> for display in ${VNCSERVERS}
> do
> echo -n "${display} "
> unset BASH_ENV ENV
> initlog $INITLOG_ARGS -c \
> "su ${display##*:} -l -c \"cd ~${display##*:} && [ -f
> .vnc/passwd ] && vncserver :${display%%:*}\""
> RETVAL=$?
> [ "$RETVAL" -ne 0 ] && break
> done
> [ "$RETVAL" -eq 0 ] && success $"vncserver startup" || \
> failure $"vncserver start"
> echo
> [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vncserver
> }
>
> stop() {
> echo -n $"Shutting down $prog: "
> for display in ${VNCSERVERS}
> do
> echo -n "${display} "
> unset BASH_ENV ENV
> initlog $INITLOG_ARGS -c \
> "su ${display##*:} -c \"vncserver -kill :${display%%:*}\"
> >/dev/null 2>&1"
> done
> RETVAL=$?
> [ "$RETVAL" -eq 0 ] && success $"vncserver shutdown" || \
> failure $"vncserver shutdown"
> echo
> [ "$RETVAL" -eq 0 ] && rm -f /var/lock/subsys/vncserver
> }
>
> # See how we were called.
> case "$1" in
> start)
> start
> ;;
> stop)
> stop
> ;;
> restart|reload)
> stop
> sleep 1
> start
> ;;
> condrestart)
> if [ -f /var/lock/subsys/vncserver ]; then
> stop
> start
> fi
> ;;
> status)
> status Xvnc
> ;;
> *)
> echo $"Usage: $0 {start|stop|restart|condrestart|status}"
> exit 1
> esac
>
> --------------------
> Contents of /etc/sysconfig/vncservers:
>
> # The VNCSERVERS variable is a list of display:user pairs.
> #
> # Uncomment the line below to start a VNC server on display :1
> # as my 'myusername' (adjust this to your own). You will also
> # need to set a VNC password; run 'man vncpasswd' to see how
> # to do that.
> #
> # DO NOT RUN THIS SERVICE if your local area network is
> # untrusted! For a secure way of using VNC, see
> # URL:http://www.uk.research.att.com/vnc/sshvnc.html.
>
> # VNCSERVERS="1:myusername"
> VNCSERVERS="100:clustergui"
>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
--
Bien cordialement, Pierre Sahores
100, rue de Paris
F - 77140 Nemours
psahores (at) easynet.fr
GSM: +33 6 03 95 77 70
Pro: +33 1 41 60 52 68
Dom: +33 1 64 45 05 33
Fax: +33 1 64 45 05 33
Inspection académique de Seine-Saint-Denis
Applications et SGBD ACID SQL (WEB et PGI)
Penser et produire "delta de productivité"
More information about the use-livecode
mailing list