blob: 09c14931dcfbb475984ef2ad148df8b6205a8344 [file] [log] [blame]
[Unit]
Description=Check Chassis%i pgood and create a file to indicate it
Wants=mapper-wait@-org-openbmc-control-power%i.service
After=mapper-wait@-org-openbmc-control-power%i.service
Wants=obmc-power-reset-on@%i.target
Before=obmc-power-reset-on@%i.target
Conflicts=obmc-chassis-poweroff@%i.target
[Service]
RemainAfterExit=no
Type=oneshot
ExecStart=/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"
SyslogIdentifier=phosphor-reset-chassis-running
[Install]
WantedBy=obmc-chassis-powerreset@%i.target