optional service to log info log on chassis poweron
This commit introduces a new service that will log an informational log
on every chassis power on.
This new informational error is being created for a couple of reasons:
- An easy eye catcher when reviewing logs to easily distinguish between
major boots of the system (ones including a chassis power cycle)
- A mechanism for other OpenBMC software which utilizes the log to
report back to the user when errors from the current boot need
attention
This service needs to run before any of the power/vrm services run to
ensure any logs from those services can be correlated to running after
the current power on has started.
By default this service will not be installed but can be brought in via
a bbappend if desired.
Tested:
- Built new service into a flash image and confirmed
- Info log was logged as expected during power on (prior to any vrm,
power, or fan functions)
- Info log was not logged when rebooting the BMC from a host running
state
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: If78c076d86efabed6b0093e9f4116502a4d9da93
diff --git a/service_files/meson.build b/service_files/meson.build
index 26c95c8..42c2357 100644
--- a/service_files/meson.build
+++ b/service_files/meson.build
@@ -20,7 +20,8 @@
'phosphor-set-host-transition-to-off@.service',
'phosphor-set-host-transition-to-running@.service',
'phosphor-chassis-check-power-status@.service',
- 'phosphor-bmc-security-check.service'
+ 'phosphor-bmc-security-check.service',
+ 'phosphor-create-chassis-poweron-log@.service'
]
foreach u : unit_files
diff --git a/service_files/phosphor-create-chassis-poweron-log@.service b/service_files/phosphor-create-chassis-poweron-log@.service
new file mode 100644
index 0000000..a3d8e18
--- /dev/null
+++ b/service_files/phosphor-create-chassis-poweron-log@.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Create info log indicating chassis%i poweron has started
+Wants=obmc-power-start-pre@%i.target
+Before=obmc-power-start-pre@%i.target
+Before=phosphor-regulators-config.service
+Conflicts=obmc-chassis-poweroff@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
+
+[Service]
+Restart=no
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/sh -c \
+ "busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging \
+ xyz.openbmc_project.Logging.Create Create ssa{ss} \
+ xyz.openbmc_project.State.Info.ChassisPowerOnStarted \
+ xyz.openbmc_project.Logging.Entry.Level.Informational 1 CHASSIS_ID %i"
+
+[Install]
+WantedBy=obmc-chassis-poweron@%i.target