1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

systemd: warn when setrlimit fails

This should make it easier to figure things out.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-08-17 12:06:07 -04:00
parent 622a0f628c
commit 206fc4b284

View File

@ -1505,7 +1505,8 @@ int main(int argc, char *argv[]) {
if (getpid() == 1) {
/* Don't limit the core dump size, so that coredump handlers such as systemd-coredump (which honour the limit)
* will process core dumps for system services by default. */
(void) setrlimit(RLIMIT_CORE, &RLIMIT_MAKE_CONST(RLIM_INFINITY));
if (setrlimit(RLIMIT_CORE, &RLIMIT_MAKE_CONST(RLIM_INFINITY)) < 0)
log_warning_errno(errno, "Failed to set RLIMIT_CORE: %m");
/* But at the same time, turn off the core_pattern logic by default, so that no coredumps are stored
* until the systemd-coredump tool is enabled via sysctl. */