blob: 09c14931dcfbb475984ef2ad148df8b6205a8344 [file] [log] [blame]
Andrew Geissler86a1ebf2022-11-10 15:58:30 -06001[Unit]
2Description=Check Chassis%i pgood and create a file to indicate it
3Wants=mapper-wait@-org-openbmc-control-power%i.service
4After=mapper-wait@-org-openbmc-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 /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"
Andrew Geissler69a250d2022-11-10 16:23:04 -060013SyslogIdentifier=phosphor-reset-chassis-running
Andrew Geissler86a1ebf2022-11-10 15:58:30 -060014
15[Install]
16WantedBy=obmc-chassis-powerreset@%i.target