Re: Core dump of crashing service program

From: Jeff <sysinit_at_yandex.com>
Date: Sat, 13 Aug 2022 17:26:44 +0200

> In order to change this default, you need to modify stage 1.

after that all child processes will use these settings as default.

> After that, if your services still cannot create coredumps, then it
> means the kernel sets the hard limit at 0, and that will be more
> difficult to work around. (Might be time to give an option back to
> s6-softlimit so it can modify hard limits as well...)

what about making /sbin/init a shell script that execs into s6-l-i?
e. g. /sbin/init (symlink to /sbin/s6-init.sh):

#!/bin/mksh

trap : SIGINT SIGQUIT
umask 0022
ulimit -Sc 0 # set soft limit for coredumpsize here
cd /

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/busybox:/toybox"
export PATH

hostname darkstar # set default hostname, can be changed later

exec s6-setsid -sI /bin/s6-linux-init -c "/etc/s6-linux-init/current" -m 0022 \
  -p "$PATH" -s "/run/initenv" -- ${1+"$_at_"}

now you can set both limits (soft and hard) in the right place
via ulimit -S -c (soft) and ulimit -H -c (hard) using the shell's "ulimit" builtin.
Received on Sat Aug 13 2022 - 17:26:44 CEST

This archive was generated by hypermail 2.4.0 : Sat Aug 13 2022 - 17:27:17 CEST