Ganeti uses an internal tool to start/stop daemons during init and upgrade. This patch makes the tool use native Shepherd facilities. diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in --- a/daemons/daemon-util.in +++ b/daemons/daemon-util.in @@ -184,6 +184,21 @@ use_systemctl() { return 1 } +# Checks if we should use the Shepherd to start/stop daemons +use_shepherd() { + # Is Shepherd running as PID 1? + ps --no-headers -p 1 -o cmd | grep -q shepherd || return 1 + + type -p herd >/dev/null || return 1 + + # Does Shepherd know about Ganeti at all? + if herd status | grep -q ganeti; then + return 0 + fi + + return 1 +} + # Prints path to PID file for a daemon. daemon_pidfile() { if [[ "$#" -lt 1 ]]; then @@ -261,6 +276,13 @@ check() { else return 1 fi + elif use_shepherd; then + activestate="$(herd status ${name})" + if echo $activestate | grep -q Running ; then + return 0 + else + return 1 + fi elif type -p start-stop-daemon >/dev/null; then start-stop-daemon --stop --signal 0 --quiet \ --pidfile $pidfile
aboutsummaryrefslogtreecommitdiff
path: root/build-aux/