From: David Hofmann Date: Tue, 4 Aug 2020 15:47:33 +0000 (+0200) Subject: Add service scripts for FreeBSD X-Git-Tag: v1.9.2~43^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1345%2Fhead;p=gitblit.git Add service scripts for FreeBSD --- diff --git a/src/main/distrib/linux/install-service-freebsd.sh b/src/main/distrib/linux/install-service-freebsd.sh new file mode 100644 index 00000000..727779cf --- /dev/null +++ b/src/main/distrib/linux/install-service-freebsd.sh @@ -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 index 00000000..513e64c4 --- /dev/null +++ b/src/main/distrib/linux/service-freebsd.sh @@ -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"