summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-01-08 21:03:40 +0000
committermh <mh@immerda.ch>2009-01-08 21:03:40 +0000
commita28669485770e6bf62adba52793b6d193ea88b76 (patch)
tree38db3fe1989f0522f7fdefedb9d9fd4d251f5c52 /files
parent147a631c625c6c0eb7b8dcc88a2e068d7a5eb70e (diff)
introducing git-daemon
Diffstat (limited to 'files')
-rw-r--r--files/init.d/git-daemon73
-rw-r--r--files/sysconfig/git-daemon23
-rw-r--r--files/sysconfig/git-daemon.vhosts24
3 files changed, 120 insertions, 0 deletions
diff --git a/files/init.d/git-daemon b/files/init.d/git-daemon
new file mode 100644
index 0000000..f574480
--- /dev/null
+++ b/files/init.d/git-daemon
@@ -0,0 +1,73 @@
+#!/bin/bash
+# puppet Init script for running the git-daemon
+#
+# Author: Marcel Haerry <mh+rpms(at)immerda.ch>
+#
+# chkconfig: - 98 02
+#
+# description: Enables the git-daemon to serve various directories. By default it serves /srv/git
+# processname: git-daemon
+# config: /etc/sysconfig/git-daemon
+
+PATH=/usr/bin:/sbin:/bin:/usr/sbin
+export PATH
+
+[ -f /etc/sysconfig/git-daemon ] && . /etc/sysconfig/git-daemon
+lockfile=${LOCKFILE-/var/lock/subsys/git-daemon}
+gitdir=${GITDIR-/srv/git}
+gitvhost=${GITVHOST-no}
+options=${OPTIONS-"--reuseaddr --verbose --detach"}
+gitdaemon=${GITDAEMON-/usr/bin/git-daemon}
+RETVAL=0
+
+if [ $gitvhost = yes ]; then
+ gitoptions="${options} --interpolated-path=${gitdir}/%H/%D"
+else
+ gitoptions="${options} --base-path=${gitdir}"
+fi
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+start() {
+ echo -n $"Starting git-daemon: "
+ daemon $gitdaemon $gitoptions
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch ${lockfile}
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping git-daemon: "
+ killproc $gitdaemon
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f ${lockfile}
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ status)
+ status $gitdaemon
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/files/sysconfig/git-daemon b/files/sysconfig/git-daemon
new file mode 100644
index 0000000..92e66f2
--- /dev/null
+++ b/files/sysconfig/git-daemon
@@ -0,0 +1,23 @@
+# git-daemon config file
+
+# location of the lockfile
+#LOCKFILE=/var/lock/subsys/git-daemon
+
+# which directory to server
+#GITDIR=/srv/git
+
+# do we serve vhosts?
+# setting this to yes assumes that you
+# have in $GITDIR per vhost to serve
+# a subdirectory containing their repos.
+# for example:
+# - /srv/git/git.example.com
+# - /srv/git/git.example.org
+#GITVHOST=no
+
+# options for the daemon
+#OPTIONS="--reuseaddr --verbose --detach"
+
+# location of the daemon
+#GITDAEMON=/usr/bin/git-daemon
+
diff --git a/files/sysconfig/git-daemon.vhosts b/files/sysconfig/git-daemon.vhosts
new file mode 100644
index 0000000..dce800f
--- /dev/null
+++ b/files/sysconfig/git-daemon.vhosts
@@ -0,0 +1,24 @@
+# git-daemon config file
+
+# location of the lockfile
+#LOCKFILE=/var/lock/subsys/git-daemon
+
+# which directory to server
+#GITDIR=/srv/git
+
+# do we serve vhosts?
+# setting this to yes assumes that you
+# have in $GITDIR per vhost to serve
+# a subdirectory containing their repos.
+# for example:
+# - /srv/git/git.example.com
+# - /srv/git/git.example.org
+#GITVHOST=no
+GITVHOST=yes
+
+# options for the daemon
+#OPTIONS="--reuseaddr --verbose --detach"
+
+# location of the daemon
+#GITDAEMON=/usr/bin/git-daemon
+