]> source.dussan.org Git - gitblit.git/commitdiff
add tools to install giblet as service on linux based os 1/head
authorMohamed MOUNIROU <mmounirou@MacBook-Pro-de-Mohamed.local>
Tue, 4 Oct 2011 20:35:09 +0000 (22:35 +0200)
committerMohamed MOUNIROU <mmounirou@MacBook-Pro-de-Mohamed.local>
Tue, 4 Oct 2011 20:35:09 +0000 (22:35 +0200)
distrib/gitblit [new file with mode: 0644]
distrib/install-service.sh [new file with mode: 0644]

diff --git a/distrib/gitblit b/distrib/gitblit
new file mode 100644 (file)
index 0000000..9ae4d03
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+
+GITBLIT_PATH=/opt/gitblit/
+GITBLIT_HTTP_PORT=0
+GITBLIT_HTTPS_PORT=8443
+JAVA="java -server -Xmx1024M -jar"
+
+. /lib/lsb/init-functions
+
+case "$1" in
+  start)
+        log_action_begin_msg "Starting gitblit server"
+        $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT &
+        log_action_end_msg $?
+        ;;
+  stop)
+        log_action_begin_msg "Stopping gitblit server"
+        $JAVA $GITBLIT_PATH/gitblit.jar --stop &
+        log_action_end_msg $?
+        ;;
+  force-reload|restart)
+        $0 stop
+        $0 start
+        ;;
+  *)
+        echo "Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}"
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/distrib/install-service.sh b/distrib/install-service.sh
new file mode 100644 (file)
index 0000000..75d7fcc
--- /dev/null
@@ -0,0 +1,3 @@
+cp gitblit /etc/init.d/
+chmod +x /etc/init.d/gitblit
+sudo update-rc.d gitblit defaults
\ No newline at end of file