diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in index 37ca0f115eb813c290656ee640bcc6dc0ad5c399..df1510ca72f06067d78da024d290c5ad27a4a3ca 100644 --- a/daemons/daemon-util.in +++ b/daemons/daemon-util.in @@ -31,11 +31,17 @@ DAEMONS=( ganeti-wconfd ganeti-noded ganeti-masterd - ganeti-metad ganeti-rapi ganeti-luxid ) +# This is the list of daemons that are loaded on demand; they should only be +# stopped, not started. +ON_DEMAND_DAEMONS=( + ganeti-metad + ganeti-kvmd + ) + _confd_enabled() { [[ "@CUSTOM_ENABLE_CONFD@" == True ]] } @@ -52,6 +58,9 @@ if _mond_enabled; then DAEMONS+=( ganeti-mond ) fi +# The full list of all daemons we know about +ALL_DAEMONS=( ${DAEMONS[@]} ${ON_DEMAND_DAEMONS[@]} ) + NODED_ARGS= MASTERD_ARGS= CONFD_ARGS= @@ -175,15 +184,13 @@ list_start_daemons() { local name for name in "${DAEMONS[@]}"; do - if [[ "$name" != ganeti-metad ]]; then - echo "$name" - fi + echo "$name" done } # Prints a list of all daemons in the order in which they should be stopped list_stop_daemons() { - for name in "${DAEMONS[@]}"; do + for name in "${ALL_DAEMONS[@]}"; do echo "$name" done | tac } @@ -197,7 +204,7 @@ is_daemon_name() { local name="$1"; shift - for i in "${DAEMONS[@]}"; do + for i in "${ALL_DAEMONS[@]}"; do if [[ "$i" == "$name" ]]; then return 0 fi diff --git a/test/py/daemon-util_unittest.bash b/test/py/daemon-util_unittest.bash index 2354a28abe7a44e185e0bdf6f0198cd5553918ec..dd8600ed205c1c8245154214d98c31ab97a5956a 100755 --- a/test/py/daemon-util_unittest.bash +++ b/test/py/daemon-util_unittest.bash @@ -37,7 +37,7 @@ if ! grep -q '^ENABLE_MOND = ' lib/_constants.py; then fi DAEMONS_LIST="wconfd noded masterd rapi luxid" -STOPDAEMONS_LIST="luxid rapi metad masterd noded wconfd" +STOPDAEMONS_LIST="luxid rapi masterd noded wconfd" if grep -q '^ENABLE_CONFD = True' lib/_constants.py; then DAEMONS_LIST="$DAEMONS_LIST confd" @@ -49,6 +49,8 @@ if grep -q '^ENABLE_MOND = True' lib/_constants.py; then STOPDAEMONS_LIST="mond $STOPDAEMONS_LIST" fi +STOPDAEMONS_LIST="kvmd metad $STOPDAEMONS_LIST" + DAEMONS=$(echo $(for d in $DAEMONS_LIST; do echo "ganeti-$d"; done)) STOPDAEMONS=$(echo $(for d in $STOPDAEMONS_LIST; do echo "ganeti-$d"; done))