diff options
author | Jan Klötzke <Jan.Kloetzke@preh.de> | 2018-01-10 10:36:14 +0100 |
---|---|---|
committer | Jan Klötzke <Jan.Kloetzke@preh.de> | 2018-01-10 10:54:40 +0100 |
commit | 9ce1759311c6734deb69aa7253bf7297536a55d9 (patch) | |
tree | 92c674bc360c3ec8703461273efd34db4e9b7968 /src/coredump | |
parent | 27c34f732e7767b5cdc90fe7ad03ae0ea625671c (diff) | |
download | systemd-9ce1759311c6734deb69aa7253bf7297536a55d9.tar.gz |
tree-wide: introduce disable_core_dumps helper and port existing users
Changes the core_pattern to prevent any core dumps by the kernel. Does
nothing if we're in a container environment as this is system wide
setting.
Diffstat (limited to 'src/coredump')
-rw-r--r-- | src/coredump/coredump.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index e6063cc980..f83a951df7 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -1126,7 +1126,7 @@ static int gather_pid_metadata( /* If this is PID 1 disable coredump collection, we'll unlikely be able to process it later on. */ if (is_pid1_crash((const char**) context)) { log_notice("Due to PID 1 having crashed coredump collection will now be turned off."); - (void) write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0); + disable_core_dumps(); } set_iovec_field(iovec, n_iovec, "COREDUMP_UNIT=", context[CONTEXT_UNIT]); |