X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=extras%2Fcore-handler%2Fhandler.sh;h=781728223bd64b50355a022bc0cf8d24a1348e5c;hp=3026e52f9a90baeae8bdf4d0f3f18b2d983a4195;hb=c071ccd98cbd98e5f49a6b6f691e21a578c8a14e;hpb=1daafe0d10c80ffa893d95e8f8bb6bf79d638c77 diff --git a/extras/core-handler/handler.sh b/extras/core-handler/handler.sh index 3026e52f9..781728223 100755 --- a/extras/core-handler/handler.sh +++ b/extras/core-handler/handler.sh @@ -23,18 +23,16 @@ PGREP_BIN="pgrep" MKDIR_BIN="mkdir" LTTNG_BIN="lttng" -# Core file settings. -CORE_PATH="/tmp/lttng/core" -CORE_PREFIX="core" - -# Folder where to save snapshot output. -# Can also be a remote URI. -SNAPSHOT_PATH="/tmp/lttng/snapshot" -SNAPSHOT_OUTPUT="file://${SNAPSHOT_PATH}" +# Session name +SESSION_NAME="coredump-handler" # Sessiond binary name. SESSIOND_BIN_NAME="lttng-sessiond" +# Core file settings. +CORE_PATH="/tmp/lttng/core" +CORE_PREFIX="core" + # Core specifiers, see man core(5) p=$1 # PID of dumped process @@ -60,13 +58,5 @@ $CAT_BIN - > "${CORE_PATH}/${CORE_PREFIX}.$p" # TODO: Checking for a sessiond lockfile would be more appropriate. if $PGREP_BIN -u root "${SESSIOND_BIN_NAME}" > /dev/null 2>&1 then - # Since we are called via the kernel coredump mechanism, we need to - # setup our environment manually. - # - # The lttng command line tool lookup $HOME to adjust the .lttngrc - # path. This is useful to have automatic session name lookup. - export HOME="/root" - $MKDIR_BIN -p "${SNAPSHOT_PATH}" - $LTTNG_BIN snapshot add-output "${SNAPSHOT_OUTPUT}" > /dev/null 2>&1 - $LTTNG_BIN snapshot record > /dev/null 2>&1 + $LTTNG_BIN snapshot record -s ${SESSION_NAME} > /dev/null 2>&1 fi