]> gitweb @ CieloNegro.org - git-rc.git/commitdiff
Initial commit master
authorPHO <pho@cielonegro.org>
Sun, 4 Jan 2009 09:09:24 +0000 (18:09 +0900)
committerPHO <pho@cielonegro.org>
Sun, 4 Jan 2009 09:09:24 +0000 (18:09 +0900)
gitd [new file with mode: 0755]

diff --git a/gitd b/gitd
new file mode 100755 (executable)
index 0000000..3c6c2df
--- /dev/null
+++ b/gitd
@@ -0,0 +1,34 @@
+#!/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"