]> gitweb @ CieloNegro.org - git-rc.git/blob - gitd
Initial commit
[git-rc.git] / gitd
1 #!/bin/sh
2 #
3 # This rc.d script is intended to be used in FreeBSD.
4 #
5 # PROVIDE: gitd
6 # REQUIRE: NETWORKING DAEMON
7
8 . /etc/rc.subr
9
10 _base_path="/home/www/git.cielonegro.org/htdocs"
11
12 name="gitd"
13 rcvar=`set_rcvar`
14 pidfile="/var/run/${name}.pid"
15 procname="git-daemon"
16 command="/usr/pkg/bin/git"
17 command_args=" \
18     daemon \
19     --base-path=$_base_path \
20     --export-all \
21     --reuseaddr \
22     --detach \
23     --pid-file=${pidfile} \
24     "
25 gitd_user=www
26 gitd_group=www
27
28 start_precmd () {
29     touch ${pidfile}
30     chown ${gitd_user}:${gitd_group} ${pidfile}
31 }
32
33 load_rc_config $name
34 run_rc_command "$1"