diff options
author | David Hofmann <dev@davehofmann.de> | 2020-08-04 17:47:33 +0200 |
---|---|---|
committer | David Hofmann <dev@davehofmann.de> | 2020-08-04 17:47:33 +0200 |
commit | 34bbf39e19a467003afb1c8f0e7e9ed3f2f36673 (patch) | |
tree | a667c540ef1f9cec0b9a51a289aca82c864eefd6 /src | |
parent | 5fa4b3f7773c482f29ebad95c1f2199a314dfc43 (diff) | |
download | gitblit-34bbf39e19a467003afb1c8f0e7e9ed3f2f36673.tar.gz gitblit-34bbf39e19a467003afb1c8f0e7e9ed3f2f36673.zip |
Add service scripts for FreeBSD
Diffstat (limited to 'src')
-rw-r--r-- | src/main/distrib/linux/install-service-freebsd.sh | 2 | ||||
-rw-r--r-- | src/main/distrib/linux/service-freebsd.sh | 49 |
2 files changed, 51 insertions, 0 deletions
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" |