diff options
author | Alex Elder <elder@dreamhost.com> | 2012-03-21 16:01:18 -0500 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-03-21 16:01:18 -0500 |
commit | 1b2a0669b996b41e8d14592fdaaca8958126f67a (patch) | |
tree | e64b67f20ec0b1ee73e0d888a76122c3eddc5be9 /debian | |
parent | 3caa43191125b99286e9b475580e7ffafaef0989 (diff) | |
download | ceph-1b2a0669b996b41e8d14592fdaaca8958126f67a.tar.gz |
ceph-kdump-copy: add tools for saving kdumps
This puts in place an init script and a command it runs to save a
kernel core dump to a remote server when a panic or other kernel
failure occurs. The content of a crash file generated by the
"kdump" init script (which uses the Ubuntu "apport" kernel_crashdump
command) is re-packaged and copied (via scp) to a remote server
specified by variables in /etc/default/ceph-kdump-copy. This
packaging (as well as the work done by the apport script) is done
on the next boot of the kernel following a crash.
Note: Although the init script, its config file, and shell script
are known to work, the packaging of these things should not be
expected to be. I (now) know, for example, that the init script
belongs in src/init-ceph-kdump-copy.in if it is to follow the
pattern used by the ceph init script. And there are likely other
problems with the build/install portions of this patch.
Signed-off-by: Alex Elder <elder@dreamhost.com>
Diffstat (limited to 'debian')
-rw-r--r-- | debian/ceph-kdump-copy.default | 33 | ||||
-rw-r--r-- | debian/ceph-kdump-copy.init | 69 | ||||
-rw-r--r-- | debian/ceph-kdump-copy.install | 1 | ||||
-rw-r--r-- | debian/control | 14 |
4 files changed, 117 insertions, 0 deletions
diff --git a/debian/ceph-kdump-copy.default b/debian/ceph-kdump-copy.default new file mode 100644 index 00000000000..e62dd31e650 --- /dev/null +++ b/debian/ceph-kdump-copy.default @@ -0,0 +1,33 @@ +# ceph-kdump-copy configuration +# --------------------------------------------------------------------------- + +# --------------------------------------------------------------------------- +# Remote host information: +# +# These first two MUST be specified +# KDUMP_HOST - The remote host to which kdumps will be copied. +# KDUMP_HOST_USER - The ssh user on KDUMP_HOST that has write +# permission in KDUMP_HOST_COREDIR. +KDUMP_HOST="YOU_MUST_SPECIFY_THIS" +KDUMP_HOST_USER="YOU_MUST_SPECIFY_THIS_TOO" + +# KDUMP_HOST_COREDIR - Full path to the directory on KDUMP_HOST that +# will contain copied kdumps. If not set, "/var/crash/remote" is +# the default. +# KDUMP_HOST_COREDIR="/var/crash/remote" + +# KDUMP_HOST_MY_ID - Name for "me", used as the directory name +# under KDUMP_HOST_COREDIR under which all kdumps from this +# host are placed. Each kdump is identified by a date stamp. +# If not set, "$(hostname)" is the default. +# KDUMP_HOST_MY_ID="$(hostname)" + +# --------------------------------------------------------------------------- +# Local host information: +# +# The local directory in which dumps are saved. If not set, "/var/crash" +# is the default. +# KDUMP_COREDIR="/var/crash" + +# --------------------------------------------------------------------------- +# Architecture specific Overrides: diff --git a/debian/ceph-kdump-copy.init b/debian/ceph-kdump-copy.init new file mode 100644 index 00000000000..35990f05949 --- /dev/null +++ b/debian/ceph-kdump-copy.init @@ -0,0 +1,69 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: ceph-kdump-copy +# Required-Start: $kdump +# Required-Stop: +# Default-Start: 2 +# Default-Stop: 6 +# Short-Description: Copies kdump crash files to remote server +# Description: This file is used to move crash files generated +# by Ubuntu apport via the kdump init script to a +# remote host. +### END INIT INFO + +# Author: Alex Elder <elder@dreamhost.com> + +# To install and activate this init script: +# update-rc.d ceph-kdump-copy start 02 2 . +# To deactivate and uninstall this init script: +# update-rc.d -f ceph-kdump-copy remove + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH="/sbin:/usr/sbin:/bin:/usr/bin" +DESC="Copies kdump crash files to remote server" +NAME="ceph-kdump-copy" +SCRIPTNAME="/etc/init.d/${NAME}" +CONFIGFILE="/etc/default/${NAME}" + +# Exit if the copy command is not installed +[ -x "/usr/bin/ceph-kdump-copy" ] || exit 0 + +# Read configuration variable file if it is present +[ -r "${CONFIGFILE}" ] && . "${CONFIGFILE}" + +[ -z "${KDUMP_HOST}" ] && + err "please specify KDUMP_HOST in '${CONFIGFILE}'" +[ -z "${KDUMP_HOST_USER}" ] && + err "please specify KDUMP_HOST_USER in '${CONFIGFILE}'" +export KDUMP_HOST KDUMP_HOST_USER + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.2-14) to ensure that this file is present +# and status_of_proc is working. +. /lib/lsb/init-functions + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_action_begin_msg "Copying kdump files" + /usr/bin/ceph-kdump-copy + if [ "$?" -eq 0 ]; then + [ "$VERBOSE" != no ] && log_end_msg 0 + else + [ "$VERBOSE" != no ] && log_end_msg 1 + fi + ;; + stop) # No-op + ;; + status|reload|force-reload|restart) + echo "Error: argument '$1' not supported" >&2 + echo "Usage: $SCRIPTNAME {start|stop}" >&2 + exit 3 + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop}" >&2 + exit 3 + ;; +esac diff --git a/debian/ceph-kdump-copy.install b/debian/ceph-kdump-copy.install new file mode 100644 index 00000000000..1b77eec02b2 --- /dev/null +++ b/debian/ceph-kdump-copy.install @@ -0,0 +1 @@ +usr/bin/ceph-kdump-copy diff --git a/debian/control b/debian/control index 946b0c37f3a..d704b1d9d75 100644 --- a/debian/control +++ b/debian/control @@ -326,3 +326,17 @@ Description: Python libraries for the Ceph distributed filesystem . This package contains Python libraries for interacting with Ceph's RADOS object storage, and RBD (RADOS block device). + +Package: ceph-kdump-copy +Architecture: linux-any +Section: devel +Priority: extra +Depends: ${misc:Depends}, linux-crashdump +Description: Shell script to repackage linux crashdump files generated by + Ubuntu apport, then copy them to a remote system to facilitate + offline analysis. Also includes an init script and associated + configuration file to allow this to happen automatically at boot + time. + . + This package contains an init script and supporting shell script to + copy crashdump files to a remote server. |