}
NULSTR_FOREACH(dir, dirs)
- if (mkdir_p(dir, 0755) < 0 && errno != EEXIST) {
+ if (mkdir_p_label(dir, 0755) < 0 && errno != EEXIST) {
log_error("Failed to mkdir %s: %m", dir);
return -errno;
}
unsigned retries;
bool need_umount = true, need_swapoff = true, need_loop_detach = true, need_dm_detach = true;
bool killed_everbody = false, in_container, use_watchdog = false;
+ char *arguments[3];
log_parse_environment();
log_set_target(LOG_TARGET_CONSOLE); /* syslog will die if not gone yet */
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);
if (retries >= FINALIZE_ATTEMPTS)
log_error("Too many iterations, giving up.");
- execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, NULL);
+ arguments[0] = NULL;
+ arguments[1] = argv[1];
+ arguments[2] = NULL;
+ execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, arguments);
/* If we are in a container, just exit, this will kill our
* container for good. */