vnc is in startup scripts(change user and home directory?)

Barn Owl barnowl "at" uronramp.net
Sat, 04 Aug 2001 01:01:03 +0000


I am on a non-rpm system. so i will need to make the
/etc/init.d/functions dir. What goes in it? Same with the
/etc/sysconfig/network. Are they even important? Finally as this looks
like the best way to setup VNC to start at boot time, I think it should
be add to the FAQ as it appears to be a commone need. If need be i will
write an entrie for it if some will tell me where to send it after i get
mine setup.

Evan

> */
> 
> #!/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} "
>         initlog $INITLOG_ARGS -c \
>             "su ${display##*:} -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
>         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
> ---------------------------------------------------------------------
> To unsubscribe, send a message with the line: unsubscribe vnc-list
> to majordomo "at" uk.research.att.com
> See also: http://www.uk.research.att.com/vnc/intouch.html
> ---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at" uk.research.att.com
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------