+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
#include "alloc-util.h"
#include "cgroup-util.h"
#include "def.h"
+#include "exec-util.h"
#include "fileio.h"
#include "killall.h"
#include "log.h"
umask(0022);
- if (getpid() != 1) {
+ if (getpid_cached() != 1) {
log_error("Not executed by init (PID 1).");
r = -EPERM;
goto error;
arguments[0] = NULL;
arguments[1] = arg_verb;
arguments[2] = NULL;
- execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments);
+ execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments);
if (!in_container && !in_initrd() &&
access("/run/initramfs/shutdown", X_OK) == 0) {
_cleanup_free_ char *param = NULL;
r = read_one_line_file("/run/systemd/reboot-param", ¶m);
- if (r < 0)
+ if (r < 0 && r != -ENOENT)
log_warning_errno(r, "Failed to read reboot parameter file: %m");
if (!isempty(param)) {