186a1ebf9SAndrew Geissler[Unit] 286a1ebf9SAndrew GeisslerDescription=Check Chassis%i pgood and create a file to indicate it 386a1ebf9SAndrew GeisslerWants=mapper-wait@-org-openbmc-control-power%i.service 486a1ebf9SAndrew GeisslerAfter=mapper-wait@-org-openbmc-control-power%i.service 586a1ebf9SAndrew GeisslerWants=obmc-power-reset-on@%i.target 686a1ebf9SAndrew GeisslerBefore=obmc-power-reset-on@%i.target 786a1ebf9SAndrew GeisslerConflicts=obmc-chassis-poweroff@%i.target 886a1ebf9SAndrew Geissler 986a1ebf9SAndrew Geissler[Service] 1086a1ebf9SAndrew GeisslerRemainAfterExit=no 1186a1ebf9SAndrew GeisslerType=oneshot 1286a1ebf9SAndrew GeisslerExecStart=/bin/sh -c "if [ $(busctl get-property `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power pgood | sed 's/i\s*[1]/on/' | grep on | wc -l) != 0 ]; then mkdir -p /run/openbmc/ && touch /run/openbmc/chassis@%i-on; fi" 13*69a250ddSAndrew GeisslerSyslogIdentifier=phosphor-reset-chassis-running 1486a1ebf9SAndrew Geissler 1586a1ebf9SAndrew Geissler[Install] 1686a1ebf9SAndrew GeisslerWantedBy=obmc-chassis-powerreset@%i.target 17