3 # Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com>
5 # SPDX-License-Identifier: GPL-2.0-only
8 # System binaries paths.
14 SESSION_NAME
="coredump-handler"
16 # Sessiond binary name.
17 SESSIOND_BIN_NAME
="lttng-sessiond"
19 # TODO: Checking for a sessiond lockfile would be more appropriate.
20 if $PGREP_BIN -u root
"${SESSIOND_BIN_NAME}" > /dev
/null
2>&1
22 $LTTNG_BIN snapshot record
-s ${SESSION_NAME} > /dev
/null
2>&1
26 CORE_PATH
="/tmp/lttng/core"
29 # Core specifiers, see man core(5)
31 p
=$1 # PID of dumped process
32 u
=$2 # (numeric) real UID of dumped process
33 g
=$3 # (numeric) real GID of dumped process
34 s
=$4 # number of signal causing dump
35 t
=$5 # time of dump, expressed as seconds since the Epoch,
36 # 1970-01-01 00:00:00 +0000 (UTC)
37 h
=$6 # hostname (same as nodename returned by uname(2))
38 e
=$7 # executable filename (without path prefix)
39 E
=$8 # pathname of executable, with slashes ('/') replaced
40 # by exclamation marks ('!').
41 c
=$9 # core file size soft resource limit of crashing process
42 # (since Linux 2.6.24)
44 # Save core dump from stdin.
45 $MKDIR_BIN -p "${CORE_PATH}"
46 $CAT_BIN - > "${CORE_PATH}/${CORE_PREFIX}.$p"
48 # Optional, chain core dump handler with original systemd script.
49 #$CAT_BIN - | /usr/lib/systemd/systemd-coredump $p $u $g $s $t $e
This page took 0.030134 seconds and 4 git commands to generate.