]> source.dussan.org Git - gitblit.git/commitdiff
Add service scripts for FreeBSD 1345/head
authorDavid Hofmann <dev@davehofmann.de>
Tue, 4 Aug 2020 15:47:33 +0000 (17:47 +0200)
committerDavid Hofmann <dev@davehofmann.de>
Tue, 4 Aug 2020 15:47:33 +0000 (17:47 +0200)
src/main/distrib/linux/install-service-freebsd.sh [new file with mode: 0644]
src/main/distrib/linux/service-freebsd.sh [new file with mode: 0644]

diff --git a/src/main/distrib/linux/install-service-freebsd.sh b/src/main/distrib/linux/install-service-freebsd.sh
new file mode 100644 (file)
index 0000000..727779c
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+sudo cp service-freebsd.sh /usr/local/etc/rc.d/gitblit
diff --git a/src/main/distrib/linux/service-freebsd.sh b/src/main/distrib/linux/service-freebsd.sh
new file mode 100644 (file)
index 0000000..513e64c
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# PROVIDE: gitblit
+# BEFORE:  LOGIN
+# KEYWORD: shutdown
+
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+
+. /etc/rc.subr
+
+name="gitblit"
+rcvar="gitblit_enable"
+
+pidfile="/var/run/${name}.pid"
+
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+restart_cmd="${name}_restart"
+
+
+# change theses values (default values)
+GITBLIT_PATH=/opt/gitblit
+GITBLIT_BASE_FOLDER=/opt/gitblit/data
+. ${GITBLIT_PATH}/java-proxy-config.sh
+COMMAND_LINE="java -server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -cp gitblit.jar:ext/* com.gitblit.GitBlitServer --baseFolder $GITBLIT_BASE_FOLDER"
+
+gitblit_start()
+{
+  echo "Starting Gitblit Server..."
+  cd $GITBLIT_PATH
+  $COMMAND_LINE --dailyLogFile &
+}
+
+gitblit_stop()
+{
+  echo "Stopping Gitblit Server..."
+  cd $GITBLIT_PATH
+  $COMMAND_LINE --stop > /dev/null &
+}
+
+gitblit_restart()
+{
+  $0 stop
+  sleep 5
+  $0 start
+}
+
+load_rc_config $name
+run_rc_command "$1"