mirror of
https://github.com/valitydev/salt-common.git
synced 2024-11-07 02:45:21 +00:00
42 lines
856 B
Bash
Executable File
42 lines
856 B
Bash
Executable File
#!/sbin/openrc-run
|
|
# -*- mode: shell-script -*-
|
|
# Copyright 1999-2012 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
extra_started_commands="reload"
|
|
|
|
EXE="${SVCNAME}"
|
|
SOCK="/var/run/${EXE}.ctl"
|
|
|
|
depend() {
|
|
need net
|
|
use logger
|
|
}
|
|
|
|
checkconfig() {
|
|
if [ ! -f "/etc/${EXE}.conf" ]; then
|
|
eerror "Please create /etc/${EXE}.conf"
|
|
return 1
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
start() {
|
|
checkconfig || return $?
|
|
ebegin "Starting ${SVCNAME}"
|
|
start-stop-daemon --start --exec /usr/sbin/${EXE} -- -c "/etc/${EXE}.conf" -s "${SOCK}"
|
|
eend $? "Failed to start BIRD"
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping ${SVCNAME}"
|
|
start-stop-daemon --stop --exec /usr/sbin/${EXE}
|
|
eend $? "Failed to stop BIRD"
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading ${SVCNAME}"
|
|
start-stop-daemon --stop --signal HUP --oknodo --exec /usr/sbin/${EXE}
|
|
eend $? "Failed to reload BIRD"
|
|
}
|