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