Line 0
Link Here
|
|
|
1 |
#!/bin/sh |
2 |
|
3 |
# $FreeBSD$ |
4 |
# PROVIDE: buildbot |
5 |
# REQUIRE: DAEMON |
6 |
# KEYWORD: shutdown |
7 |
|
8 |
# |
9 |
# Add the following lines to /etc/rc.conf to enable buildbot: |
10 |
# buildbot_enable (bool): Set to "NO" by default |
11 |
# buildbot_basedir (path): Must be set to the path of the buildbot directory |
12 |
# file, e.g. /var/www/buildbot |
13 |
# buildbot_user (str): Set to "root" by default. Change it to run |
14 |
# buildbot as a different user. |
15 |
|
16 |
. /etc/rc.subr |
17 |
|
18 |
export PATH=${PATH}:%%PREFIX%%/bin |
19 |
|
20 |
name="buildbot" |
21 |
rcvar=buildbot_enable |
22 |
command="%%PREFIX%%/bin/buildbot" |
23 |
load_rc_config $name |
24 |
|
25 |
check_cmd="${name}_check" |
26 |
extra_commands="check reload" |
27 |
reload_cmd="${name}_reload" |
28 |
start_precmd="${name}_prestart" |
29 |
stop_precmd="${name}_prestop" |
30 |
|
31 |
pidfile="${buildbot_basedir}/twistd.pid" |
32 |
procname="%%PYTHON_CMD%%" |
33 |
|
34 |
buildbot_check() |
35 |
{ |
36 |
echo "Checking BuildBot config" |
37 |
rc_flags="${buildbot_basedir} ${rc_flags}" |
38 |
${command} checkconfig ${rc_flags} |
39 |
} |
40 |
|
41 |
buildbot_prestart() |
42 |
{ |
43 |
rc_flags="start ${buildbot_basedir} ${rc_flags}" |
44 |
} |
45 |
|
46 |
buildbot_prestop() |
47 |
{ |
48 |
rc_flags="stop ${buildbot_basedir} ${rc_flags}" |
49 |
} |
50 |
|
51 |
buildbot_reload() |
52 |
{ |
53 |
rc_flags="${buildbot_basedir} ${rc_flags}" |
54 |
${command} sighup ${rc_flags} |
55 |
} |
56 |
|
57 |
run_rc_command "$1" |