Skip to content

Commit f082db4

Browse files
authored
Merge pull request #1345 from davehofmann/master
Add service scripts for FreeBSD
2 parents 5fa4b3f + 34bbf39 commit f082db4

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
sudo cp service-freebsd.sh /usr/local/etc/rc.d/gitblit
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
3+
# PROVIDE: gitblit
4+
# BEFORE: LOGIN
5+
# KEYWORD: shutdown
6+
7+
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
8+
9+
. /etc/rc.subr
10+
11+
name="gitblit"
12+
rcvar="gitblit_enable"
13+
14+
pidfile="/var/run/${name}.pid"
15+
16+
start_cmd="${name}_start"
17+
stop_cmd="${name}_stop"
18+
restart_cmd="${name}_restart"
19+
20+
21+
# change theses values (default values)
22+
GITBLIT_PATH=/opt/gitblit
23+
GITBLIT_BASE_FOLDER=/opt/gitblit/data
24+
. ${GITBLIT_PATH}/java-proxy-config.sh
25+
COMMAND_LINE="java -server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -cp gitblit.jar:ext/* com.gitblit.GitBlitServer --baseFolder $GITBLIT_BASE_FOLDER"
26+
27+
gitblit_start()
28+
{
29+
echo "Starting Gitblit Server..."
30+
cd $GITBLIT_PATH
31+
$COMMAND_LINE --dailyLogFile &
32+
}
33+
34+
gitblit_stop()
35+
{
36+
echo "Stopping Gitblit Server..."
37+
cd $GITBLIT_PATH
38+
$COMMAND_LINE --stop > /dev/null &
39+
}
40+
41+
gitblit_restart()
42+
{
43+
$0 stop
44+
sleep 5
45+
$0 start
46+
}
47+
48+
load_rc_config $name
49+
run_rc_command "$1"

0 commit comments

Comments
 (0)