Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 2003 21:13:48 -0600
From:      Rik Scarborough <RikSca@kc.rr.com>
To:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: VNC - server started at boot-time
Message-ID:  <20030404031348.GA94650@gruffy.kc.rr.com>
In-Reply-To: <000e01c2f7a5$c36006b0$4500a8c0@saturnus>
References:  <000e01c2f7a5$c36006b0$4500a8c0@saturnus>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 31 Mar 2003, D. Theunissen wrote:
> Does anyone know how to start /usr/local/bin/vncserver at boottime as a particular user?
> 
> eg. I want to start the vncserver as user 'dan' during boot.

I've found that if you put
    @reboot	$HOME/bin/startvnc
in dan's crontab works really well.

startvnc is the following script:

    #!/bin/sh

    umask 22
    PATH=<ACTUALPATH>
    MAIL=/var/mail/<USER>; export MAIL
    BLOCKSIZE=K; export BLOCKSIZE
    FTP_PASSIVE_MODE=YES; export FTP_PASSIVE_MODE
    SHELL=/bin/tcsh; export SHELL
    HOME=/home/<USER>; export HOME
    LOGNAME=<USER>; export LOGNAME
    USER=<USER>; export USER
    HOSTTYPE=FreeBSD; export HOSTTYPE
    VENDOR=intel; export VENDOR
    OSTYPE=FreeBSD; export OSTYPE
    MACHTYPE=i386; export MACHTYPE
    SHLVL=1; export SHLVL
    PWD=/home/<USER>; export PWD
    GROUP=<GROUP>; export GROUP
    HOST=<HOST>; export HOST
    CVSROOT=/usr/local/cvsroot; export CVSROOT
    cd /usr/home/<USER> || {
         echo 'Execution directory inaccessible' >&2
         exit 1
    }
    /usr/local/bin/vncserver :2


you could replace items in <> with the equivalent, but I generated this
script by running the last line as an at script (man at).  Finding the at script 
in the queue and copying it to startvnc in my home directory.

> 
> tnx in advance
> 
> Dan.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030404031348.GA94650>