blob: 88769c77aebbb2528125258422eefa8eee18dd63 [file] [log] [blame]
Matt Spinlerc9b6e432017-03-15 16:42:54 -05001[Unit]
2Description=Enable reboot on host failures
Deepak Kodihallid9ef80e2017-08-03 13:43:54 -05003Wants=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service
4After=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service
Matt Spinlerc9b6e432017-03-15 16:42:54 -05005
6[Service]
Deepak Kodihallid9ef80e2017-08-03 13:43:54 -05007ExecStart = /bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/control/host0/auto_reboot` /xyz/openbmc_project/control/host0/auto_reboot xyz.openbmc_project.Control.Boot.RebootPolicy AutoReboot b true"
8ExecStop = /bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/control/host0/auto_reboot` /xyz/openbmc_project/control/host0/auto_reboot xyz.openbmc_project.Control.Boot.RebootPolicy AutoReboot b false"
Matt Spinlerc9b6e432017-03-15 16:42:54 -05009Type=oneshot
10RemainAfterExit=yes
11
12[Install]
13WantedBy={SYSTEMD_DEFAULT_TARGET}