host-gpio-monitor: Use systemd template
The systemd target gbmc-bare-metal-active.target is being changed to a
template, in order to support multi-host systems. The commit updates the
host-gpio-monitor functionality accordingly. The host number now gets
passed in as an argument.
Tested:
Set the bare metal flag /var/google/config-package/enable-bm.flag on the
BMC. Started host-gpio-monitor@0.service, which then started
gbmc-bare-metal-active@0.target. Then rebooted the host, at which point,
the host-gpio-monitor@0.service disabled
gbmc-bare-metal-active@0.target.
Change-Id: I02a0b11996aa2ee168e682fbf61f3f1a8cf01771
Signed-off-by: John Wedig <johnwedig@google.com>
diff --git a/subprojects/bare-metal-host-monitor/host-gpio-monitor@.service.in b/subprojects/bare-metal-host-monitor/host-gpio-monitor@.service.in
new file mode 100644
index 0000000..7afcd97
--- /dev/null
+++ b/subprojects/bare-metal-host-monitor/host-gpio-monitor@.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=gBMC bare-metal GPIO monitoring for host %i
+ConditionPathExists=/var/google/config-package/enable-bm.flag
+After=phosphor-ipmi-host.service
+
+[Service]
+Restart=always
+ExecStart=@@BIN@ host_gpio_monitor --host_label %i
+
+[Install]
+WantedBy=multi-user.target