diff options
author | Sage Weil <sage@inktank.com> | 2012-06-11 16:25:42 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-06-12 10:10:58 -0700 |
commit | c31b4e3100f59237990162fdc2ded5a9b101edac (patch) | |
tree | d6764d5d1cf10f6ebeca9737512ccc7ec22ffa7d | |
parent | d64600dfaefeafe6e673fea4f3786ded6bbce2fb (diff) | |
download | ceph-c31b4e3100f59237990162fdc2ded5a9b101edac.tar.gz |
remove ceph-kdump-copy
Moved to its own repo.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | ceph.spec.in | 1 | ||||
-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 | 13 | ||||
-rw-r--r-- | src/.gitignore | 1 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/ceph-kdump-copy.in | 188 |
8 files changed, 1 insertions, 309 deletions
diff --git a/ceph.spec.in b/ceph.spec.in index 81e70401ff6..eb1cf830880 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -286,7 +286,6 @@ fi %{_bindir}/boto_tool %{_bindir}/ceph-coverage %{_bindir}/obsync -%{_bindir}/ceph-kdump-copy %{_initrddir}/ceph %dir %{_libdir}/rados-classes /sbin/mkcephfs diff --git a/debian/ceph-kdump-copy.default b/debian/ceph-kdump-copy.default deleted file mode 100644 index e62dd31e650..00000000000 --- a/debian/ceph-kdump-copy.default +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 617d9589021..00000000000 --- a/debian/ceph-kdump-copy.init +++ /dev/null @@ -1,69 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: ceph-kdump-copy -# Required-Start: $remote_fs $network $named -# Required-Stop: $remote_fs $network $named -# 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 deleted file mode 100644 index 1b77eec02b2..00000000000 --- a/debian/ceph-kdump-copy.install +++ /dev/null @@ -1 +0,0 @@ -usr/bin/ceph-kdump-copy diff --git a/debian/control b/debian/control index 1e6d892f246..023e13459da 100644 --- a/debian/control +++ b/debian/control @@ -280,16 +280,3 @@ 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: amd64 armel armhf i386 ia64 mipsel -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. diff --git a/src/.gitignore b/src/.gitignore index a5ee9dd2c19..f79d79da2e9 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -74,7 +74,6 @@ acconfig.h /ceph-coverage /dumpjournal /init-ceph -/ceph-kdump-copy /librados-config /rbd /psim diff --git a/src/Makefile.am b/src/Makefile.am index d913e63287e..c02f4c31748 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -833,7 +833,7 @@ editpaths = sed \ -e 's|@prefix[@]|$(prefix)|g' \ -e 's|@@GCOV_PREFIX_STRIP[@][@]|$(GCOV_PREFIX_STRIP)|g' -shell_scripts = init-ceph mkcephfs ceph-debugpack ceph-coverage ceph-kdump-copy +shell_scripts = init-ceph mkcephfs ceph-debugpack ceph-coverage $(shell_scripts): Makefile @@ -851,8 +851,6 @@ bin_SCRIPTS += obsync/obsync bin_SCRIPTS += obsync/boto_tool bin_SCRIPTS += ceph-coverage -bin_SCRIPTS += ceph-kdump-copy - CLEANFILES += $(shell_scripts) CLEANFILES += ceph_ver.h sample.fetch_config diff --git a/src/ceph-kdump-copy.in b/src/ceph-kdump-copy.in deleted file mode 100644 index 1f12f86565d..00000000000 --- a/src/ceph-kdump-copy.in +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -norc - -# Copyright (C) 2012 Alex Elder <elder@dreamhost.com> -# -# This is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1, as published by the Free Software -# Foundation. See file COPYING. - -PROGNAME=$(basename $0) - -# issue a message to stderr and exit -function err() { - echo "${PROGNAME}: $@" >&2 - exit 1 -} - -###################### - -# This script is normally called by @sysconfdir@/init.d/ceph-kdump-copy, -# which will set up these variables based on its config file, found -# in @sysconfdir@/default/ceph-kdump-copy. - -[ -z "${KDUMP_HOST}" ] && - err "KDUMP_HOST must be specified" -[ -z "${KDUMP_HOST_USER}" ] && - err "KDUMP_HOST_UESR must be specified" - -# The local directory in which dumps are saved. -KDUMP_COREDIR="${KDUMP_COREDIR:-/var/crash}" - -# Subdirectory on dump host under which my dumps are collected -KDUMP_HOST_MY_ID="${KDUMP_HOST_MY_ID:-$(hostname)}" - -# Path on the dump host to the directory in which dumps are copied. -KDUMP_HOST_COREDIR="${KDUMP_HOST_COREDIR:-/var/crash/remote}" - -KDUMP_HOST_MY_COREDIR="${KDUMP_HOST_COREDIR}/${KDUMP_HOST_MY_ID}" - -##################################################################### - - -# If no arguments are provided, it is a simple usage message (no error). -# Otherwise display the message before printing usage information, and -# exit with status indicating error. -function usage () { - local status=0 - - echo "" >&2 - if [ $# -gt 0 ]; then - status=1 - echo "${PROGNAME}: $@" >&2 - echo "" >&2 - fi - echo "Usage: ${PROGNAME}" >&2 - echo "" >&2 - echo " each crash_file is the name of a crash file in " >&2 - echo " ${KDUMP_COREDIR} generated by kernel_crashdump" >&2 - echo "" >&2 - - exit ${status} -} - -# Run a command (or semicolon-separated commands) on the dump host -function on_dump_host() { - ssh -T "${KDUMP_HOST_USER}@${KDUMP_HOST}" "$@" -} - -# Create a summary file based on apport crashfile content -function summarize() { - echo "Crash Summary" - echo "-------------" - echo "hostname: $(hostname)" - echo "host arch: $(arch)" - echo "time collected: $(date)" - echo "crash_dir: ${CRASH_DIR}" - echo "" - echo "crash uname: $(cat Uname)" - echo "crash timestamp: $(cat Date)" - echo "kernel package: $(cat Package)" - echo "distribution: $(cat DistroRelease)" -} - -# Collect information related to a dump file. The file name provided -# is the name of a file in ${KDUMP_COREDIR} containing a crash file -# generated by /usr/share/apport/kernel_crashdump. Ubuntu uses its -# apport package to bundle up information from the crash. We'll unpack -# that and re-bundle it in a way less specific to Ubuntu. We'll also -# gather a few more files to make the result self-contained. -function collect_dump_info() { - [ $# -eq 2 ] || exit 99 - local crash_release="$1" - local crash_dir="$2" - local i original copy - - # We need the debug version of vmlinux matching the dump. - # Grab a few other useful files from /boot as well. - for i in @libdir@/debug/boot/vmlinux \ - /boot/System.map /boot/vmcoreinfo \ - /boot/config /boot/abi - do - original="${i}-${crash_release}" - copy="${crash_dir}/$(basename "${original}")" - - cp "${original}" "${copy}" - gzip "${copy}" # Compressing could be optional - done -} - -# Copy a directory containing a kdump and associated files. -function move_crash_to_repository() { - [ $# -eq 1 ] || exit 99 - local crash_dir="$1" - - tar cf - "./${crash_dir}" | - on_dump_host "tar -C '${KDUMP_HOST_MY_COREDIR}' -xf -" && - # Removing it should be the default, but optionally skipped - rm -rf "./${crash_dir}" -} - -# Process a single apport-generated crash file -function process_crash_file() { - [ $# -eq 1 ] || exit 99 - local crash_file="$1" - local apport_dir crash_release crash_dir - - apport_dir="${crash_file}-apport_dir" - mkdir "${apport_dir}" - - # Unpack the crash file - apport-unpack "${crash_file}" "${apport_dir}" - rm -f "${crash_file}" - - # Grab the release id from the kernel that crashed - crash_release=$(cat "${apport_dir}"/Uname | awk '{print $2}') - - # Create a date-stamped directory in which to hold this crash - crash_dir=$(date '+%F-%T%z') - mkdir "${crash_dir}" - - # Produce a summary and save the actual core file - ( cd "${apport_dir}"; summarize ) > "${crash_dir}/summary.txt" - gzip "${crash_dir}/summary.txt" - - # Save and compress the actual core file - mv ${apport_dir}/VmCore "${crash_dir}/vmcore-${crash_release}" - gzip "${crash_dir}/vmcore-${crash_release}" - - # We've got what we need from the crash file - rm -rf "${apport_dir}" - - # Collect the other related files - collect_dump_info "${crash_release}" "${crash_dir}" - - # Create a little README file - ( - echo "To analyze the kernel core dump here:" - echo " gunzip 'vmcore-${crash_release}'" - echo " crash 'vmlinux-${crash_release}.gz' \\" - echo " 'vmcore-${crash_release}'" - echo "" - echo "Other files provide additional context." - ) > "${crash_dir}/README" - - # Remove other files we don't have any need for - rm config_link kernel_link system.map_link - - # Finally, copy the crash directory over to the repository - move_crash_to_repository "${crash_dir}" -} - -######### Start ######### - -cd "${KDUMP_COREDIR}" -CRASH_FILES=$(ls linux-image-*.crash 2> /dev/null) -[ -z "${CRASH_FILES}" ] && exit 0 # Quit if there's nothing to do - -# Make sure the directory to contain our dumps is there on the dump host -on_dump_host "mkdir -p '${KDUMP_HOST_MY_COREDIR}'" || -err "unable to create '${KDUMP_HOST_MY_COREDIR}' on host '${KDUMP_HOST}'" - -# Now process each crash file; exit on the first error. -for crash_file in ${CRASH_FILES}; do - process_crash_file "${crash_file}" || - err "unable to process '${crsh_file}'" -done - -exit 0 |