root@xenialcorosyncpacemaker:~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:29:44 UTC; 21s ago
Main PID: 445 (corosync)
root@xenialcorosyncpacemaker:~# systemctl status pacemaker | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:29:44 UTC; 27s ago
Main PID: 447 (pacemakerd)
root@xenialcorosync:~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:30:56 UTC; 1s ago
Main PID: 474 (corosync)
root@xenialcorosyncpacemaker:~# systemctl status pacemaker | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:30:56 UTC; 3s ago
Main PID: 476 (pacemakerd)
- It doesn't seem to have any side-effects when pacemaker isn't installed.
The Wants= options is simply ignore since the pacemaker.service is not present.
root@xenialcorosyncnopacemaker:~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:32:11 UTC; 53s ago
Main PID: 1284 (corosync)
root@xenialcorosyncnopacemake:~# systemctl status pacemaker
● pacemaker.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
root@v:~# systemctl stop corosync
root@xenialcorosyncnopacemake:~# systemctl status pacemaker
● pacemaker.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
root@xenialcorosyncnopacemake:~# systemctl status corosync | egrep "PID|Active:"
Active: inactive (dead) since Mon 2018-01-08 19:33:17 UTC; 4s ago
Main PID: 1284 (code=exited, status=0/SUCCESS)
root@xenialcorosyncnopacemake:~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:33:26 UTC; 1s ago
Main PID: 1378 (corosync)
As per nacc's comment it seems like "Wants=" is the recommended way to hook start-up of one unit to the start-up of another unit.[1]
[1] - https:/ /www.freedeskto p.org/software/ systemd/ man/systemd. unit.html# Wants=
So far I have tested using 2 scenarios (including "Wants= pacemaker. service" ) and it look good so far.
------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ----
* Scenario #1
[Both corosync & pacemaker installed]
-------
- pacemaker start on corosync start.
root@xenialcoro syncpacemaker: ~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:29:44 UTC; 21s ago
Main PID: 445 (corosync)
root@xenialcoro syncpacemaker: ~# systemctl status pacemaker | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:29:44 UTC; 27s ago
Main PID: 447 (pacemakerd)
root@xenialcoro syncpacemaker: ~# systemctl stop corosync
root@xenialcoro syncpacemaker: ~# systemctl status corosync | egrep "PID|Active:"
Active: inactive (dead) since Mon 2018-01-08 19:30:29 UTC; 1s ago
Main PID: 445 (code=exited, status=0/SUCCESS)
root@xenialcoro syncpacemaker: ~# systemctl status pacemaker | egrep "PID|Active:"
Active: inactive (dead) since Mon 2018-01-08 19:30:29 UTC; 3s ago
Main PID: 447 (code=exited, status=0/SUCCESS)
root@xenialcoro syncpacemaker: ~# systemctl start corosync
root@xenialcoro sync:~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:30:56 UTC; 1s ago
Main PID: 474 (corosync)
root@xenialcoro syncpacemaker: ~# systemctl status pacemaker | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:30:56 UTC; 3s ago
Main PID: 476 (pacemakerd)
------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ----
* Scenario #2
[corosync installed & pacemaker not installed]
-------
- It doesn't seem to have any side-effects when pacemaker isn't installed.
The Wants= options is simply ignore since the pacemaker.service is not present.
root@xenialcoro syncnopacemaker :~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:32:11 UTC; 53s ago
Main PID: 1284 (corosync)
root@xenialcoro syncnopacemake: ~# systemctl status pacemaker
● pacemaker.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
root@v:~# systemctl stop corosync
root@xenialcoro syncnopacemake: ~# systemctl status pacemaker
● pacemaker.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
root@xenialcoro syncnopacemake: ~# systemctl status corosync | egrep "PID|Active:"
Active: inactive (dead) since Mon 2018-01-08 19:33:17 UTC; 4s ago
Main PID: 1284 (code=exited, status=0/SUCCESS)
root@xenialcoro syncnopacemake: ~# systemctl start corosync
root@xenialcoro syncnopacemake: ~# systemctl status corosync | egrep "PID|Active:"
Active: active (running) since Mon 2018-01-08 19:33:26 UTC; 1s ago
Main PID: 1378 (corosync)
- Eric