Table of Contents
Date: 17-01-2022
SystemD-Based Operating Systems
Warning: RedHat/CentOS 7+, Ubuntu 16+, Debian 8+, SLES 12+ all use systemd which ignores /etc/security/limits.conf and /etc/security/limits.d/* settings. To permit core files without size limits on systemd-based systems use the following process instead.
NOTE: these steps must be done as root
Set System Core File Size Limit
sudo -s
cd /etc/systemd/system
mkdir solserver.service.d
cd solserver.service.d
printf "[Service]nLimitCORE=infinityn" > override.conf
systemctl daemon-reload
Now you can verify the change has taken effect for future slapd startup:
systemctl cat solserver
This should show the updated limits:
# /etc/systemd/system/solserver.service.d/override.conf
[Service]
LimitCORE=infinity
Once Symas OpenLDAP is installed you can view the process' limits file to see the Max open files limit:
systemctl show solserver | grep LimitCORE
will show:
LimitCORE=infinity
LimitCORESoft=infinity
If adjusting these settings after Symas OpenLDAP is installed and slapd is running, a restart of solserver is required to pick up the change:
systemctl restart solserver
Generating Usable Core Dumps in Debian/Ubuntu
Unfortunately, generating usable core files on Debian or Ubuntu operating systems requires disabling the apport process. To do this, edit /etc/default/apport, and set enabled to 0.
sudo vi /etc/default/apport
enabled=0
Then stop the apport service:
sudo service apport stop
sudo vi /etc/sysctl.d/60-slapd-core.conf
and apply the following core file defaults:
kernel.core_uses_pid=1
fs.suid_dumpable=2
kernel.core_pattern=/opt/symas/data/tmp/core-%e-%s-%u-%g-%p-%t
Then start the procps service:
sudo service procps start
Set Default Save-To Location for Core Files
Edit the coredump.conf file:
sudo vi /etc/systemd/coredump.conf
Add the following to the file:
[Coredump]
Storage=both
Compress=yes
Create a simlink to the coredump.conf file in /etc/sysctl.d/
cd /etc/systctl.d/
sudo ln -s /etc/systemd/coredump.conf 50-coredump.conf
For some systems, /etc/sysctl.d/99-sysctl.conf will be a simlink to /etc/sysctl.conf. On others it will its own file. Whichever is the case, edit the file:
sudo vi /etc/sysctl.conf
OR
sudo vi /etc/sysctl.d/99-sysctl.conf
with the following:
fs.suid_dumpable = 2
kernel.core_uses_pid = 1
kernel.core_pattern = /tmp/core-%e-%s-%u-%g-%p-%t
Or
kernel.core_pattern = /opt/tmp/core-%e-%s-%u-%g-%p-%t