$ systemctl cat corosync.service
<nothing about pacemaker>
Desired properties:
i) when corosync is started, attempt to start pacemaker
ii) when corosync is restarted, attempt to restart pacemaker too
iii) when corosync is stopped, do not stop pacemaker
1) Property i) can be satisfied with [Install] WantedBy=corosync.service, in pacemaker.service.
2) Requires=corosync.service is too strong, as it means that pacemaker cannot operate without corosync. Is this true?
3) Currently on upgrade corosync prerm script does "stop corosync" and later postinst does "start corosync". My understanding it would be better, on upgrades to simply "restart" corosync, instead of doing stop&start. Please consider switching corosync package to use dh_systemd and use restart-on-upgrade dh_installinit/systemd option.
4) Properties ii) and iii) cannot currently be satisfied simultaneously with simple stanzas. If pacemaker requires corosync at all time, then pacemaker.service should declare PartOf=corosync.service. Then stop/restart of corosync will stop and restart pacemaker. Condition ii) is good. However that will violate condition iii). However, we can instead introduce a helper unit to achieve both ii) and iii) simultaneously. e.g.:
This means that whenever corosync is stopped, or restarted, pacemaker.service will be restarted too. This extra unit will satisfy the conditions `ii` and `iii` as stated.
Currently, in bionic: system/ pacemaker. service service corosync. service
$ systemctl cat pacemaker.service
# /lib/systemd/
After=corosync.
Requires=
$ systemctl cat corosync.service
<nothing about pacemaker>
Desired properties:
i) when corosync is started, attempt to start pacemaker
ii) when corosync is restarted, attempt to restart pacemaker too
iii) when corosync is stopped, do not stop pacemaker
1) Property i) can be satisfied with [Install] WantedBy= corosync. service, in pacemaker.service.
2) Requires= corosync. service is too strong, as it means that pacemaker cannot operate without corosync. Is this true?
3) Currently on upgrade corosync prerm script does "stop corosync" and later postinst does "start corosync". My understanding it would be better, on upgrades to simply "restart" corosync, instead of doing stop&start. Please consider switching corosync package to use dh_systemd and use restart-on-upgrade dh_installinit/ systemd option.
4) Properties ii) and iii) cannot currently be satisfied simultaneously with simple stanzas. If pacemaker requires corosync at all time, then pacemaker.service should declare PartOf= corosync. service. Then stop/restart of corosync will stop and restart pacemaker. Condition ii) is good. However that will violate condition iii). However, we can instead introduce a helper unit to achieve both ii) and iii) simultaneously. e.g.:
pacemaker- restart. service corosync. service /bin/systemctl restart pacemaker.service corosync. service
[Unit]
PartOf=
[Service]
ExecStart=/bin/true
ExecStop=
[Install]
WantedBy=
This means that whenever corosync is stopped, or restarted, pacemaker.service will be restarted too. This extra unit will satisfy the conditions `ii` and `iii` as stated.