init: Use corosync-cfgtool for shutdown

... to trigger cfg shutdown callbacks.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
This commit is contained in:
Jan Friesse 2021-01-14 14:00:42 +01:00
parent 119d0b87ad
commit 191bec5d1d
2 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,9 @@ stop()
! status -p "$prog_pid_file" "$prog" > /dev/null 2>&1 && return
echo -n "Signaling $desc ($prog) to terminate: "
# Call cfgtool to trigger shutdown callbacks
corosync-cfgtool -H --force > /dev/null 2>&1
# Send TERM signal (if cfgtool -H failed)
kill -TERM "$(pid_var_run $prog_pid_file)" > /dev/null 2>&1
success
echo

View File

@ -8,6 +8,7 @@ After=network-online.target
[Service]
EnvironmentFile=-@INITCONFIGDIR@/corosync
ExecStart=@SBINDIR@/corosync -f $COROSYNC_OPTIONS
ExecStop=@SBINDIR@/corosync-cfgtool -H --force
Type=notify
# In typical systemd deployments, both standard outputs are forwarded to