blob: 8dcdfc4f727c152541ab796cc19070855460c41a [file] [log] [blame]
#include "chassis.hpp"
#include "boost/process.hpp" // NOLINT
#include "boost/system/error_code.hpp" // NOLINT
#include "error_messages.hpp"
#include "subprocess_utils.hpp"
namespace redfish {
static std::vector<std::string> ResetCmd(const int& delayTimeSecs) {
std::vector<std::string> resetCmd = {
"systemd-run",
"--on-active=" + std::to_string(delayTimeSecs),
"--timer-property=AccuracySec=100ms",
"--",
"systemctl",
"start",
"gbmc-psu-hardreset.target"};
return resetCmd;
}
void delayResetCN(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
int delayTimeSecs) {
childProcessRun(asyncResp, ResetCmd(delayTimeSecs));
}
} // namespace redfish