aboutsummaryrefslogtreecommitdiffstats
path: root/main/subversion/svnserve.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/subversion/svnserve.initd')
-rw-r--r--main/subversion/svnserve.initd44
1 files changed, 44 insertions, 0 deletions
diff --git a/main/subversion/svnserve.initd b/main/subversion/svnserve.initd
new file mode 100644
index 0000000000..036d0187e7
--- /dev/null
+++ b/main/subversion/svnserve.initd
@@ -0,0 +1,44 @@
+#!/sbin/runscript
+# Copyright 2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/dev-util/subversion/files/svnserve.initd,v 1.2 2005/08/25 13:59:48 pauldv Exp $
+
+opts="$opts setup"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting svnserve"
+ # Ensure that we run from a readable working dir, and that we do not
+ # lock filesystems when being run from such a location.
+ cd /
+ start-stop-daemon --start --quiet --background --make-pidfile \
+ --pidfile /var/run/svnserve.pid --exec /usr/bin/svnserve \
+ --chuid ${SVNSERVE_USER:-apache}:${SVNSERVE_GROUP:-apache} -- \
+ --foreground --daemon ${SVNSERVE_OPTS:---root=/var/svn}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping svnserve"
+ start-stop-daemon --stop --quiet --pidfile /var/run/svnserve.pid
+ eend $?
+}
+
+setup() {
+ local root=${SVNSERVE_ROOT:-/var/svn}
+ ebeging "Setting up svnserve repositories in $root"
+ if [ -e "$root/repos" ]; then
+ eend 1 "$root/repos already exist"
+ return 1
+ fi
+
+ svnadmin create "$root"/repos
+ chown -Rf "${SVNSERVE_USER}:${SVNSERVE_GROUP}" "$root/repos"
+ mkdir -p "$root/conf"
+ chmod -Rf go-rwx "$root/conf"
+ chmod -Rf o-rwx "$root/repos"
+ eend $?
+}