integ/tools/collector/scripts/collect_coredump.sh
Scott Little c8d4b55130 Relocate collector to stx-integ/tools/collector
Move content from stx-utils into stx-integ or stx-update

Packages will be relocated to

stx-update:
    enable-dev-patch
    extras

stx-integ:
    config-files/
        io-scheduler

    filesystem/
        filesystem-scripts

    grub/
        grubby

    logging/
        logmgmt

    tools/
        collector
        monitor-tools

    tools/engtools/
        hostdata-collectors
        parsers

    utilities/
        build-info
        branding   (formerly wrs-branding)
        platform-util

Change-Id: Iefa35db5a644b8ca0f1962e6c4cbbc97213b69e9
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 12:24:00 -04:00

36 lines
792 B
Bash

#! /bin/bash
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Loads Up Utilities and Commands Variables
source /usr/local/sbin/collect_parms
source /usr/local/sbin/collect_utils
SERVICE="coredump"
LOGFILE="${extradir}/${SERVICE}.info"
COREDUMPDIR="/var/lib/systemd/coredump"
echo "${hostname}: Core Dump Info ....: ${LOGFILE}"
files=`ls ${COREDUMPDIR} | wc -l`
if [ "${files}" == "0" ] ; then
echo "No core dumps" >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
else
COMMAND="ls -lrtd ${COREDUMPDIR}/*"
delimiter ${LOGFILE} "${COMMAND}"
${COMMAND} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
COMMAND="md5sum ${COREDUMPDIR}/*"
delimiter ${LOGFILE} "${COMMAND}"
${COMMAND} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
fi
exit 0