• Contact Us
  • Home
  • Installation
  • Platform

Core File Retention

Written by Maryanne Normann

Updated at July 27th, 2024

  • Quick Start
  • Installation
    Best Practices Configuration Troubleshooting Design Performance Platform
  • Maintenance
    Releases Upgrade
  • Reference
+ More

Table of Contents

Set System Core File Size Limit Generating Usable Core Dumps in Debian/Ubuntu Set Default Save-To Location for Core Files

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
Copyright © 2020-2024 Symas Corporation. All rights reserved.
core files dumps

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Basic Security Certificate Setup
  • Creating Core Dumps
  • LetsEncrypt Certificates on Ubuntu
  • Symas Blog RSS Feed
  • Symas on Facebook
  • Symas on Twitter
  • Symas Blog
  • Symas on LinkedIn
  • Symas YouTube Channel

Copyright © 2023, Symas Corporation. All rights reserved. Privacy Statement (updated July 31, 2023)

Phone:

Main Office: +1.650.963.7601
Fax: +1.650.390.6284

Email:

Sales: sales@symas.com
Support: support@symas.com

Office Hours:

8:00 AM - 5:00 PM ET

Office Location:

Symas Corporation
PO Box 391
Grand Junction, CO 81507 USA

Expand