summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service')
-rw-r--r--meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service19
1 files changed, 19 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service b/meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service
new file mode 100644
index 0000000000..f398038993
--- /dev/null
+++ b/meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Reboot If Enabled
+Wants=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service
+After=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service
+Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service
+After=mapper-wait@-xyz-openbmc_project-state-host%i.service
+Wants=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
+After=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
+After=op-reset-chassis-on@%i.service
+ConditionPathExists=!/run/openbmc/chassis@%i-on
+
+[Service]
+Restart=no
+Type=oneshot
+ExecStart=/usr/bin/env phosphor-discover-system-state --host %i
+SyslogIdentifier=phosphor-discover-system-state
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}