Searched hist:e97fc13a6f3253327b60120bd56c571efa29c2d0 (Results 1 – 1 of 1) sorted by relevance
/openbmc/phosphor-power/services/ |
H A D | phosphor-regulators-monitor-disable.service | e97fc13a6f3253327b60120bd56c571efa29c2d0 Tue Sep 14 12:12:36 CDT 2021 Shawn McCarney <shawnmm@us.ibm.com> regulators: Fix race condition in monitor disable
There is a systemd service file that disables regulator monitoring when the chassis is powered off. This is necessary because we do not want to read sensor values or check for phase faults when the chassis is powered off. Monitoring needs to stop before the regulators are disabled/turned off.
The service file currently does not specify a 'Type', which means that it defaults to Type 'simple'. Service files of this Type are considered started when they fork the specified executable. That is, systemd does not wait for the executable to complete.
In this case, we need the executable to complete. The service runs the regsctl executable, which makes a D-Bus method call to the regulators application disabling monitoring. We need this D-Bus method to complete before proceeding with the power off.
Otherwise there is a race condition between the following: * The timers that initiate sensor and phase fault monitoring could expire, causing unwanted monitoring to occur during power off. * The regsctl executable could complete the D-Bus call, stopping monitoring and the associated timers.
The solution is to set the Type of the service file to 'oneshot'. This causes systemd to wait until the executable completes.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: I399a2a4ba7f1a256c42a7e9b8b036abd1b077033
|