blob: 3280d0a4045ef4caae4c172d05ba176c0d50920c [file] [log] [blame]
[Unit]
Description=Check Chassis%i pgood and create a file to indicate it
Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service
After=mapper-wait@-xyz-openbmc_project-Chassis-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 /xyz/openbmc_project/Chassis/Control/Power%i` /xyz/openbmc_project/Chassis/Control/Power%i xyz.openbmc_project.Chassis.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"
[Install]
WantedBy=obmc-chassis-powerreset@%i.target