3#include <zypp-core/base/LogTools.h>
4#include <zypp-core/ExternalProgram.h>
11 MIL <<
"Try to acquire an inhibitor lock..." << endl;
17 "/usr/bin/systemd-inhibit",
18 "--what=sleep:shutdown:idle",
33 MIL <<
"Terminate inhibitor lock: pid " <<
_prog->
getpid() << endl;
35 if ( !
_prog->waitForExit( 10 * 1000 ) ) {
37 WAR <<
"systemd-inhibit did not respond to SIGTERM, killing it" << std::endl;
ExternalProgramWithStderr & _prog
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
ExternalProgram extended to change the progress group ID after forking.
int close() override
Wait for the progamm to complete.
bool kill()
Kill the program.
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.