Hi Everybody,

I was writing this email hoping to catch an eye of the FAQ maintainer
for the VNC.
I had been looking for a way of starting a vnc server at boot time under
linux (*nix) automatically.
And while I could find only information on how to do this with the Xvnc
started as a root user process I could not find any information as to
how to start a number of Xvnc servers for many different users.
Well, I have figured it out on my own, and thought I should send this
in.

Here is an example init.d script that performs the task:

/etc/init.d/vnc.userwho

# !/bin/sh

# 2002/08/29 (np) [EMAIL PROTECTED]
# Created this startup script to automatically start a vnc server
# for a particular user at a particular display number when the server
is restarted

RUNASUSER=userwho
VNCID=1
VNCSERVER=/usr/X11R6/bin/vncserver
SUDO=/usr/bin/sudo

test -x $VNCSERVER || exit 0
test -x $SUDO      || exit 0

# See how we were called.
case "$1" in
  start)
        $SUDO -H -u $RUNASUSER $VNCSERVER -depth 16 -geometry 1024x768
:$VNCID
        ;;
  stop)
        $VNCSERVER -kill :$VNCID
        rm -rf /tmp/.X11-unix/X$VNCID
        ;;
  force-reload)
        $0 restart
        ;;
  restart)
        $0 stop
        sleep 60
        $0 start
        ;;
  status)
        echo ""
        echo "Status"
        ps -uxw --user $RUNASUSER | grep Xvnc
        ;;
  *)
        echo "Usage: $0 {start|stop|force-reload|restart|status}"
        exit 1
esac

exit 0


P.S.
Perhaps it is a trivial task for most *nix admins, however it was not a
trivial task for me, and I believe it would be usefull information for
other vnc users who may not be as experienced *nix admins as others.
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
http://www.realvnc.com/mailman/listinfo/vnc-list

Reply via email to