Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 570666 | Differences between
and this patch

Collapse All | Expand All

(-)buildbot/files/buildmaster.initd (-14 / +21 lines)
Lines 1-14 Link Here
1
#!/sbin/runscript
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
2
# Copyright 1999-2016 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
extra_started_commands="reload"
5
extra_started_commands="reload"
6
6
7
BUILDMASTER_NAME=${RC_SVCNAME:12}
8
BUILDMASTER_PATH="${BASEDIR}/${BUILDMASTER_NAME}"
9
7
depend() {
10
depend() {
8
	need net
11
	need net
9
}
12
}
10
13
11
checkconfig() {
14
checkconfig() {
15
	if [ -z "${BUILDMASTER_NAME}" ]; then
16
		eerror "Buildmaster name not defined. Please link buildmaster.foo to this file to start the buildmaster with the name \"foo\"."
17
		return 1
18
	fi
12
	if [ -z "${BASEDIR}" ]; then
19
	if [ -z "${BASEDIR}" ]; then
13
		eerror "BASEDIR not set"
20
		eerror "BASEDIR not set"
14
		return 1
21
		return 1
Lines 17-54 Link Here
17
		eerror "USERNAME not set"
24
		eerror "USERNAME not set"
18
		return 1
25
		return 1
19
	fi
26
	fi
20
	if [ ! -d "${BASEDIR}" ]; then
27
	if [ ! -d "${BUILDMASTER_PATH}" ]; then
21
		eerror "${BASEDIR} is not a directory"
28
		eerror "${BUILDMASTER_PATH} is not a directory"
22
		return 1
29
		return 1
23
	fi
30
	fi
24
	if [ ! -e "${BASEDIR}/buildbot.tac" ]; then
31
	if [ ! -e "${BUILDMASTER_PATH}/buildbot.tac" ]; then
25
		eerror "${BASEDIR} does not contain buildbot.tac"
32
		eerror "${BUILDMASTER_PATH} does not contain buildbot.tac"
26
		return 1
33
		return 1
27
	fi
34
	fi
28
}
35
}
29
36
30
start() {
37
start() {
31
	checkconfig || return 1
38
	checkconfig || return 1
32
	ebegin "Starting buildmaster in ${BASEDIR}"
39
	ebegin "Starting buildmaster in ${BUILDMASTER_PATH}"
33
	start-stop-daemon --start -u "${USERNAME}" \
40
	start-stop-daemon --start -u "${USERNAME}" \
34
		--pidfile "${BASEDIR}/buildmaster.pid" \
41
		--pidfile "${BUILDMASTER_PATH}/buildmaster.pid" \
35
		--exec /usr/bin/python -- /usr/bin/twistd \
42
		--exec /usr/bin/python -- /usr/bin/twistd \
36
		--no_save \
43
		--no_save \
37
		--logfile="${BASEDIR}/twistd.log" \
44
		--logfile="${BUILDMASTER_PATH}/twistd.log" \
38
		--pidfile="${BASEDIR}/buildmaster.pid" \
45
		--pidfile="${BUILDMASTER_PATH}/buildmaster.pid" \
39
		--python="${BASEDIR}/buildbot.tac"
46
		--python="${BUILDMASTER_PATH}/buildbot.tac"
40
	eend $?
47
	eend $?
41
}
48
}
42
49
43
stop() {
50
stop() {
44
	ebegin "Stopping buildmaster in ${BASEDIR}"
51
	ebegin "Stopping buildmaster in ${BUILDMASTER_PATH}"
45
	start-stop-daemon --stop --pidfile "${BASEDIR}/buildmaster.pid"
52
	start-stop-daemon --stop --pidfile "${BUILDMASTER_PATH}/buildmaster.pid"
46
	eend $?
53
	eend $?
47
}
54
}
48
55
49
reload() {
56
reload() {
50
	ebegin "Reconfiguring buildmaster in ${BASEDIR}"
57
	ebegin "Reconfiguring buildmaster in ${BUILDMASTER_PATH}"
51
	start-stop-daemon --signal HUP --pidfile \
58
	start-stop-daemon --signal HUP --pidfile \
52
		"${BASEDIR}"/buildmaster.pid
59
		"${BUILDMASTER_PATH}"/buildmaster.pid
53
	eend $?
60
	eend $?
54
}
61
}

Return to bug 570666