diff options
| -rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 11 | ||||
| -rw-r--r-- | doc/examples/configure-index | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 09f3e4783..0f2467607 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1516,8 +1516,15 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) int Fd = -1; Inhibitor() { - if (_config->FindB("DPkg::Inhibit-Shutdown", true)) - Fd = Inhibit("shutdown", "APT", "APT is installing or removing packages", "block"); + std::string to_inhibit; + if (_config->FindB("DPkg::Inhibit-Shutdown", true)) + to_inhibit.append("shutdown:"); + if (_config->FindB("DPkg::Inhibit-Sleep", true)) + to_inhibit.append("sleep:"); + // Remove trailing : separator + if (to_inhibit.length() > 0) + to_inhibit.pop_back(); + Fd = Inhibit(to_inhibit.c_str(), "APT", "APT is installing or removing packages", "block"); } ~Inhibitor() { diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 9cdacfe34..034399819 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -540,6 +540,8 @@ DPkg // Set a shutdown block inhibitor on systemd systems while running dpkg Inhibit-Shutdown "<BOOL>"; + // Set a sleep block inhibitor on systemd systems while running dpkg + Inhibit-Sleep "<BOOL>"; } /* Options you can set to see some debugging text They correspond to names |
