Skip to content

Commit e274696

Browse files
cursoragentManjotS
andcommitted
ansible-scylla-monitoring: make start wrapper idempotent for systemd unit
The 'Enable scylla-monitoring at boot' task sets state: started on the scylla-monitoring.service unit right after the stack was already started manually via the same start wrapper a few tasks earlier. Since the unit was freshly installed (and thus inactive from systemd's point of view), enabling it with state: started re-runs ExecStart (start-monitoring.sh -> start-all.sh) against containers that are already up, so start-all.sh fails with a container/name conflict and systemd reports 'control process exited with error code'. Make start-monitoring.sh.j2 tear down any already-running stack (via the already-idempotent stop wrapper) before starting, so it is safe to invoke back-to-back from the manual start task and then again from the systemd unit. Co-authored-by: Manjot Singh <ManjotS@users.noreply.github.com>
1 parent 004d9ac commit e274696

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ansible-scylla-monitoring/templates/start-monitoring.sh.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ if [ -f "$ENV_FILE" ]; then
66
# shellcheck disable=SC1090
77
. "$ENV_FILE"
88
fi
9+
# Tear down any already-running stack first so this script is safe to run
10+
# more than once in a row (e.g. once from the deploy task, then again when
11+
# the systemd unit is started right after) instead of failing on container
12+
# name conflicts left over from the previous run.
13+
{{ scylla_monitoring_stop_script_path | quote }} || true
914
{{ start_command }}

0 commit comments

Comments
 (0)