--- /dev/null
+#!/bin/sh
+#
+# This rc.d script is intended to be used in FreeBSD.
+#
+# PROVIDE: gitd
+# REQUIRE: NETWORKING DAEMON
+
+. /etc/rc.subr
+
+_base_path="/home/www/git.cielonegro.org/htdocs"
+
+name="gitd"
+rcvar=`set_rcvar`
+pidfile="/var/run/${name}.pid"
+procname="git-daemon"
+command="/usr/pkg/bin/git"
+command_args=" \
+ daemon \
+ --base-path=$_base_path \
+ --export-all \
+ --reuseaddr \
+ --detach \
+ --pid-file=${pidfile} \
+ "
+gitd_user=www
+gitd_group=www
+
+start_precmd () {
+ touch ${pidfile}
+ chown ${gitd_user}:${gitd_group} ${pidfile}
+}
+
+load_rc_config $name
+run_rc_command "$1"