blob: 3280d0a4045ef4caae4c172d05ba176c0d50920c [file] [log] [blame]
Kuiying Wangc8153bc2018-11-09 16:34:33 +08001[Unit]
2Description=Check Chassis%i pgood and create a file to indicate it
3Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service
4After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service
5Wants=obmc-power-reset-on@%i.target
6Before=obmc-power-reset-on@%i.target
7Conflicts=obmc-chassis-poweroff@%i.target
8
9[Service]
10RemainAfterExit=no
11Type=oneshot
12ExecStart=/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"
13
14[Install]
15WantedBy=obmc-chassis-powerreset@%i.target