chiark / gitweb /
shutdown: don't complain if we cannot lock memory, to make container shutdowns clean
[elogind.git] / src / core / shutdown.c
index cd478b0349901e6a8762bea0adcc6f8adc190f73..2494bb86a120c15bf735e090b453e584156b749c 100644 (file)
@@ -347,8 +347,7 @@ int main(int argc, char *argv[]) {
         use_watchdog = !!getenv("WATCHDOG_USEC");
 
         /* lock us into memory */
-        if (mlockall(MCL_CURRENT|MCL_FUTURE) != 0)
-                log_warning("Cannot lock process memory: %m");
+        mlockall(MCL_CURRENT|MCL_FUTURE);
 
         log_info("Sending SIGTERM to remaining processes...");
         send_signal(SIGTERM);
@@ -356,8 +355,10 @@ int main(int argc, char *argv[]) {
         log_info("Sending SIGKILL to remaining processes...");
         send_signal(SIGKILL);
 
-        if (in_container)
+        if (in_container) {
                 need_swapoff = false;
+                need_dm_detach = false;
+        }
 
         /* Unmount all mountpoints, swaps, and loopback devices */
         for (retries = 0; retries < FINALIZE_ATTEMPTS; retries++) {