From dfdece542e4afcd0b8657d81b7e498ad76b26683 Mon Sep 17 00:00:00 2001 From: Eyal Date: Sun, 22 Apr 2018 13:00:30 +0300 Subject: [PATCH] make sure graph starts after collector on reboot add kill mode to graph and collector Change-Id: I5c8ab90c1d2fccd4657bde4f68b07024886509f4 --- devstack/plugin.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index c08753dfb..ec4c26fb4 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -308,8 +308,24 @@ function start_vitrage { run_process vitrage-persistor "$VITRAGE_BIN_DIR/vitrage-persistor --config-file $VITRAGE_CONF" run_process vitrage-snmp-parsing "$VITRAGE_BIN_DIR/vitrage-snmp-parsing --config-file $VITRAGE_CONF" - change_systemd_kill_mode vitrage-graph vitrage-collector + write_systemd_dependency vitrage-graph vitrage-collector + change_systemd_kill_mode vitrage-graph + change_systemd_kill_mode vitrage-collector +} + + +function write_systemd_dependency { + local service_after=$1 + local service_before=$2 + local systemd_service_after="devstack@$service_after.service" + local systemd_service_before="devstack@$service_before.service" + + local unitfile_after="$SYSTEMD_DIR/$systemd_service_after" + + iniset -sudo $unitfile_after "Unit" "After" "$systemd_service_before" + + $SYSTEMCTL daemon-reload } function change_systemd_kill_mode { @@ -318,6 +334,8 @@ function change_systemd_kill_mode { local unitfile="$SYSTEMD_DIR/$systemd_service" iniset -sudo $unitfile "Service" "KillMode" "control-group" + + $SYSTEMCTL daemon-reload } # stop_vitrage() - Stop running processes