From 959ad0c8a2b864e56572e399f1613bd5980b3a57 Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Thu, 12 Jan 2012 20:48:26 +0100 Subject: [PATCH] Service installation under CentOS --- distrib/gitblit-centos | 46 +++++++++++++++++++++++++++++++ distrib/install-service-centos.sh | 3 ++ 2 files changed, 49 insertions(+) create mode 100644 distrib/gitblit-centos create mode 100644 distrib/install-service-centos.sh diff --git a/distrib/gitblit-centos b/distrib/gitblit-centos new file mode 100644 index 00000000..db2fdef5 --- /dev/null +++ b/distrib/gitblit-centos @@ -0,0 +1,46 @@ +#!/bin/bash +# chkconfig: 3 21 91 +# Source function library. +. /etc/init.d/functions + +# change theses values (default values) +GITBLIT_PATH=/opt/gitblit +GITBLIT_HTTP_PORT=0 +GITBLIT_HTTPS_PORT=8443 +JAVA="java -server -Xmx1024M -jar" + +RETVAL=0 + +case "$1" in + start) + if [ -f $GITBLIT_PATH/gitblit.jar ]; + then + echo $"Starting gitblit server" + $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT > /dev/null & + echo "." + exit $RETVAL + fi + ;; + + stop) + if [ -f $GITBLIT_PATH/gitblit.jar ]; + then + echo $"Starting gitblit server" + $JAVA $GITBLIT_PATH/gitblit.jar --stop > /dev/null & + echo "." + 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 diff --git a/distrib/install-service-centos.sh b/distrib/install-service-centos.sh new file mode 100644 index 00000000..5e2e5928 --- /dev/null +++ b/distrib/install-service-centos.sh @@ -0,0 +1,3 @@ +cp gitblit-centos /etc/init.d/gitblit +chmod +x /etc/init.d/gitblit +sudo chkconfig --add gitblit -- 2.39.5