11 MIL <<
"Try to acquire an inhibitor lock..." << endl;
12 std::string whoStr =
str::form(
"--who=%s", who.c_str());
13 std::string whyStr =
str::form(
"--why=%s", reason.c_str());
17 "/usr/bin/systemd-inhibit",
18 "--what=sleep:shutdown:idle",
33 MIL <<
"Terminate inhibitor lock: pid " <<
_prog->getpid() << endl;
34 _prog->kill( SIGTERM );
35 if ( !
_prog->waitForExit( 10 * 1000 ) ) {
37 WAR <<
"systemd-inhibit did not respond to SIGTERM, killing it" << std::endl;
ExternalProgramWithSeperatePgid(const char *const *argv, Stderr_Disposition stderr_disp=Normal_Stderr, int stderr_fd=-1, bool default_locale=false, const Pathname &root="")
shared_ptr< ExternalProgramWithSeperatePgid > _prog
ShutdownLock(const std::string &who, const std::string &reason)
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.