Merge pull request #7836 from jkloetzke/shutdown-no-coredumps

shutdown: prevent core dumps in final shutdown stage
This commit is contained in:
Lennart Poettering
2018-01-10 15:15:07 +01:00
committed by GitHub
5 changed files with 15 additions and 2 deletions
+7
View File
@@ -61,6 +61,7 @@
#include "umask-util.h"
#include "user-util.h"
#include "util.h"
#include "virt.h"
int saved_argc = 0;
char **saved_argv = NULL;
@@ -615,3 +616,9 @@ int str_verscmp(const char *s1, const char *s2) {
return strcmp(os1, os2);
}
/* Turn off core dumps but only if we're running outside of a container. */
void disable_core_dumps(void) {
if (detect_container() <= 0)
(void) write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
}
+2
View File
@@ -191,3 +191,5 @@ int update_reboot_parameter_and_warn(const char *param);
int version(void);
int str_verscmp(const char *s1, const char *s2);
void disable_core_dumps(void);