RBMC: phosphor-set-bmc-active-passive.service
Install this service. it is a helper service to set a file in /run that
other services can use to know if the obmc-bmc-active target has been
started, such as with ConditionFileExists.
Also bind it to the obmc-bmc-active target so it will start and stop
when the target does.
Change-Id: Ia823f3176431ebfa29efe52299e8abbf6cf167f8
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/service_files/meson.build b/service_files/meson.build
index d622268..0ba81ba 100644
--- a/service_files/meson.build
+++ b/service_files/meson.build
@@ -26,6 +26,12 @@
'phosphor-set-chassis-transition-to-off@.service'
]
+if get_option('rbmc-state-management').allowed()
+ unit_files += [
+ 'phosphor-set-bmc-active-passive.service'
+ ]
+endif
+
fs = import('fs')
foreach u : unit_files
fs.copyfile(
diff --git a/service_files/phosphor-set-bmc-active-passive.service b/service_files/phosphor-set-bmc-active-passive.service
new file mode 100644
index 0000000..0fb716c
--- /dev/null
+++ b/service_files/phosphor-set-bmc-active-passive.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Start/Stop the active BMC target helper
+After=obmc-bmc-active.target
+PartOf=obmc-bmc-active.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStartPre=mkdir -p /run/openbmc/
+ExecStart=/bin/touch /run/openbmc/active-bmc
+ExecStop=/bin/rm -f /run/openbmc/active-bmc
diff --git a/target_files/obmc-bmc-active.target b/target_files/obmc-bmc-active.target
index a0322e9..5bee245 100644
--- a/target_files/obmc-bmc-active.target
+++ b/target_files/obmc-bmc-active.target
@@ -1,2 +1,3 @@
[Unit]
Description=Active BMC Target
+BindsTo=phosphor-set-bmc-active-passive.service