Files
scylladb/dist/docker/docker-entrypoint.py
Yaniv Michael Kaul f55a55fbf3 docker: fix coredump collection when host uses pipe-based core_pattern
The container image inherits kernel.core_pattern from the host.  When
the host pipes core dumps to a handler (e.g. Ubuntu's apport), that
handler does not exist or work correctly inside the container, so core
dumps are silently lost.

Override any pipe-based core_pattern with a file-based pattern that
writes directly to /var/lib/scylla/coredump/.  The override is attempted
both from the entrypoint (scyllasetup.coredumpSetup) and from
scylla-server.sh when running as root; it succeeds only when the
container has write access to /proc/sys/kernel/core_pattern and is
silently skipped otherwise.

Fixes: SCYLLADB-1366

Closes scylladb/scylladb#29337
2026-05-12 14:16:22 +03:00

36 lines
922 B
Python
Executable File

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import signal
import subprocess
import scyllasetup
import logging
import commandlineparser
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(message)s")
supervisord = None
def signal_handler(signum, frame):
supervisord.send_signal(signum)
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
try:
arguments, extra_arguments = commandlineparser.parse()
setup = scyllasetup.ScyllaSetup(arguments, extra_arguments=extra_arguments)
setup.developerMode()
setup.cpuSet()
setup.io()
setup.coredumpSetup()
setup.cqlshrc()
setup.write_rackdc_properties()
setup.arguments()
setup.set_housekeeping()
supervisord = subprocess.Popen(["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"])
supervisord.wait()
except Exception:
logging.exception('failed!')