chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
main: add kernel option to enable confirm_spawn
[elogind.git]
/
main.c
diff --git
a/main.c
b/main.c
index 6a3eee2eb0511b6a74c81870d3c184fb48d6c02b..802e2ae9f33d1d518460c315b1391c35356b79a5 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-121,6
+121,8
@@
_noreturn static void crash(int sig) {
assert_se(sigaddset(&mask, sig) == 0);
assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
assert_se(sigaddset(&mask, sig) == 0);
assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
+ ignore_signal(sig);
+
execl("/bin/sh", "/bin/sh", NULL);
log_error("execl() failed: %s", strerror(errno));
}
execl("/bin/sh", "/bin/sh", NULL);
log_error("execl() failed: %s", strerror(errno));
}
@@
-248,6
+250,15
@@
static int parse_proc_cmdline_word(const char *word) {
else
crash_shell = r;
else
crash_shell = r;
+
+ } else if (startswith(word, "systemd.confirm_spawn=")) {
+ int r;
+
+ if ((r = parse_boolean(word + 22)) < 0)
+ log_warning("Failed to parse confirm spawn switch %s, Ignoring.", word + 22);
+ else
+ confirm_spawn = r;
+
} else if (startswith(word, "systemd.crash_chvt=")) {
int k;
} else if (startswith(word, "systemd.crash_chvt=")) {
int k;
@@
-267,6
+278,7
@@
static int parse_proc_cmdline_word(const char *word) {
log_info("systemd.dump_core=0|1 Dump core on crash");
log_info("systemd.crash_shell=0|1 On crash run shell");
log_info("systemd.crash_chvt=N Change to VT #N on crash");
log_info("systemd.dump_core=0|1 Dump core on crash");
log_info("systemd.crash_shell=0|1 On crash run shell");
log_info("systemd.crash_chvt=N Change to VT #N on crash");
+ log_info("systemd.confirm_spawn=0|1 Confirm every process spawn");
} else {
unsigned i;
} else {
unsigned i;
@@
-575,5
+587,8
@@
finish:
dbus_shutdown();
dbus_shutdown();
+ if (getpid() == 1)
+ freeze();
+
return retval;
}
return retval;
}