Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2006 16:20:39 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        pobox@verysmall.org
Cc:        freebsd-questions@freebsd.org
Subject:   Re: subversion on boot
Message-ID:  <20061031142039.GE90986@gothmog.pc>
In-Reply-To: <45475482.5020604@verysmall.org>
References:  <45475482.5020604@verysmall.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-10-31 14:49, "pobox@verysmall.org" <pobox@verysmall.org> wrote:
> Hello,
> 
> what is the best way to launch subversion (svnserve) on boot?
> 
> So far I did not find out something that can be put in /etc/rc.conf.

You can write your own rc.d script and save it in `/usr/local/etc/rc.d'.

We have a very good guide about the internals of the rc.d scripts now,
which you can read online at:

    http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/

A sample `svnserve' script could be as simple as:

    #!/bin/sh
    
    . /etc/rc.subr
    
    name="svnserve"
    rcvar=`set_rcvar`
    command="/usr/sbin/${name}"
    
    start_precmd="${name}_prestart"
    
    pidfile="/var/run/${name}.pid"
    
    svnserve_prestart()
    {
        rc_flags="--pidfile ${pidfile} ${rc_flags}"
        return 0
    }
    
    load_rc_config $name
    run_rc_command "$1"

Note that I haven't tested this, but something like this should be all
it takes to let you start or stop `svnserve' by adding in your local
`/etc/rc.conf.local' file:

    svnserve_enable='YES'
    svnserve_flags='-d -R --listen-port 9000'

Have a look at the `rc-scripting' article, try it out and let us know
how things worked out :)




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