force_depend tls and influx
This commit is contained in:
parent
6a92e572e3
commit
e5f8248668
|
@ -31,6 +31,36 @@ start_cmd="albatross_influx_start"
|
||||||
pidfile="/var/run/albatross_influx.pid"
|
pidfile="/var/run/albatross_influx.pid"
|
||||||
procname="/usr/local/libexec/albatross/vmmd_influx"
|
procname="/usr/local/libexec/albatross/vmmd_influx"
|
||||||
|
|
||||||
|
#
|
||||||
|
# force_depend script [rcvar]
|
||||||
|
# Force a service to start. Intended for use by services
|
||||||
|
# to resolve dependency issues.
|
||||||
|
# $1 - filename of script, in /usr/local/etc/rc.d, to run
|
||||||
|
# $2 - name of the script's rcvar (minus the _enable)
|
||||||
|
#
|
||||||
|
my_force_depend()
|
||||||
|
{
|
||||||
|
local _depend _dep_rcvar
|
||||||
|
|
||||||
|
_depend="$1"
|
||||||
|
_dep_rcvar="${2:-$1}_enable"
|
||||||
|
|
||||||
|
[ -n "$rc_fast" ] && ! checkyesno always_force_depends &&
|
||||||
|
checkyesno $_dep_rcvar && return 0
|
||||||
|
|
||||||
|
/usr/local/etc/rc.d/${_depend} forcestatus >/dev/null 2>&1 && return 0
|
||||||
|
|
||||||
|
info "${name} depends on ${_depend}, which will be forced to start."
|
||||||
|
if ! /usr/local/etc/rc.d/${_depend} forcestart; then
|
||||||
|
warn "Unable to force ${_depend}. It may already be running."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
albatross_influx_precmd() {
|
||||||
|
my_force_depend albatross_stat || err 1 "Cannot run albatross_stat"
|
||||||
|
}
|
||||||
|
|
||||||
albatross_influx_start () {
|
albatross_influx_start () {
|
||||||
/usr/sbin/daemon -S -p "${pidfile}" -u "${albatross_influx_user}" \
|
/usr/sbin/daemon -S -p "${pidfile}" -u "${albatross_influx_user}" \
|
||||||
"${procname}" "${albatross_influx_flags}"
|
"${procname}" "${albatross_influx_flags}"
|
||||||
|
|
|
@ -31,6 +31,36 @@ start_cmd="albatross_tls_start"
|
||||||
pidfile="/var/run/albatross_tls.pid"
|
pidfile="/var/run/albatross_tls.pid"
|
||||||
procname="/usr/local/libexec/albatross/vmmd_tls"
|
procname="/usr/local/libexec/albatross/vmmd_tls"
|
||||||
|
|
||||||
|
#
|
||||||
|
# force_depend script [rcvar]
|
||||||
|
# Force a service to start. Intended for use by services
|
||||||
|
# to resolve dependency issues.
|
||||||
|
# $1 - filename of script, in /usr/local/etc/rc.d, to run
|
||||||
|
# $2 - name of the script's rcvar (minus the _enable)
|
||||||
|
#
|
||||||
|
my_force_depend()
|
||||||
|
{
|
||||||
|
local _depend _dep_rcvar
|
||||||
|
|
||||||
|
_depend="$1"
|
||||||
|
_dep_rcvar="${2:-$1}_enable"
|
||||||
|
|
||||||
|
[ -n "$rc_fast" ] && ! checkyesno always_force_depends &&
|
||||||
|
checkyesno $_dep_rcvar && return 0
|
||||||
|
|
||||||
|
/usr/local/etc/rc.d/${_depend} forcestatus >/dev/null 2>&1 && return 0
|
||||||
|
|
||||||
|
info "${name} depends on ${_depend}, which will be forced to start."
|
||||||
|
if ! /usr/local/etc/rc.d/${_depend} forcestart; then
|
||||||
|
warn "Unable to force ${_depend}. It may already be running."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
albatross_tls_precmd() {
|
||||||
|
my_force_depend albatross_daemon || err 1 "Cannot run albatross_daemon"
|
||||||
|
}
|
||||||
|
|
||||||
albatross_tls_start () {
|
albatross_tls_start () {
|
||||||
/usr/sbin/daemon -S -p "${pidfile}" -u "${albatross_tls_user}" \
|
/usr/sbin/daemon -S -p "${pidfile}" -u "${albatross_tls_user}" \
|
||||||
"${procname}" "${albatross_tls_flags}"
|
"${procname}" "${albatross_tls_flags}"
|
||||||
|
|
Loading…
Reference in a new issue