pid1: make sure to restore correct default values for some rlimits
authorJan Synacek <jsynacek@redhat.com>
Wed, 12 Feb 2020 11:58:54 +0000 (12:58 +0100)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Thu, 13 Feb 2020 13:45:23 +0000 (14:45 +0100)
commit77a273e02c1c811485d13ddca0f844512aed2cff
tree2378b0a418c3a870efd016de89e754c766735476
parent781a055c17400e953bb7929434fe7a2e6517d5e8
pid1: make sure to restore correct default values for some rlimits

Commit fb39af4ce42d7ef9af63009f271f404038703704 forgot to restore the default
rlimit values (RLIMIT_NOFILE and RLIMIT_MEMLOCK) while PID1 is reloading.

This patch extracts the code in charge of initializing the default values for
those rlimits in order to create dedicated functions, which take care of their
initialization.

These functions are then called in parse_configuration() so we make sure that
the default values for these rlimits get restored every time PID1 is reloading
its configuration.

(cherry picked from commit a9fd4cd1206832a61aaf61fff583bb133e6cb965)
Resolves: #1789930
src/core/main.c