summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-03-20 19:51:43 -0400
committerJames Moger <james.moger@gitblit.com>2012-03-20 19:51:43 -0400
commit3da5a58bf8f533cba7d65f4da19f1cd350b0f118 (patch)
treed4500d0f4f4496785b857a98982623591202d2ff
parent7525c2436675fbe28fdd8aa9e7a38a2c4a901c76 (diff)
downloadgitblit-3da5a58bf8f533cba7d65f4da19f1cd350b0f118.tar.gz
gitblit-3da5a58bf8f533cba7d65f4da19f1cd350b0f118.zip
Added Ubuntu service init script (issue 72)
-rw-r--r--distrib/gitblit-ubuntu46
-rw-r--r--docs/04_releases.mkd1
2 files changed, 47 insertions, 0 deletions
diff --git a/distrib/gitblit-ubuntu b/distrib/gitblit-ubuntu
new file mode 100644
index 00000000..957a8d05
--- /dev/null
+++ b/distrib/gitblit-ubuntu
@@ -0,0 +1,46 @@
+#!/bin/bash
+# chkconfig: 3 21 91
+# Source function library.
+. /lib/init/vars.sh
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+
+# change theses values (default values)
+GITBLIT_PATH=/opt/gitblit
+GITBLIT_USER="gitblit"
+ARGS="-server -Xmx1024M -jar gitblit.jar"
+
+RETVAL=0
+
+case "$1" in
+ start)
+ if [ -f $GITBLIT_PATH/gitblit.jar ];
+ then
+ echo $"Starting gitblit server"
+ start-stop-daemon --start --quiet --background --oknodo --make-pidfile --pidfile /var/run/gitblit.pid --exec /usr/bin/java --chuid $GITBLIT_USER --chdir $GITBLIT_PATH -- $ARGS
+ exit $RETVAL
+ fi
+ ;;
+
+ stop)
+ if [ -f $GITBLIT_PATH/gitblit.jar ];
+ then
+ echo $"Stopping gitblit server"
+ start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/gitblit.pid
+ exit $RETVAL
+ fi
+ ;;
+
+ force-reload|restart)
+ $0 stop
+ $0 start
+ ;;
+
+ *)
+ echo $"Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit $RETVAL \ No newline at end of file
diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd
index 5b54aaad..126ee239 100644
--- a/docs/04_releases.mkd
+++ b/docs/04_releases.mkd
@@ -31,6 +31,7 @@ Push requests to these repositories will be rejected.
**New:** *git.onlyAccessBareRepositories = false*
- Added *protect-refs.groovy* (Github/plm)
- Allow setting default branch (relinking HEAD) to a branch or a tag (Github/plm)
+- Added Ubuntu service init script (issue 72)
#### fixes