浏览代码

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>
Jan Friesse 5 年之前
父节点
当前提交
191bec5d1d
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 3 0
      init/corosync.in
  2. 1 0
      init/corosync.service.in

+ 3 - 0
init/corosync.in

@@ -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

+ 1 - 0
init/corosync.service.in

@@ -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