This commit is contained in:
Mario Fetka 2017-11-11 18:24:29 +01:00
parent 26a051ad61
commit dbfa790974
14 changed files with 544 additions and 0 deletions

6
debian/NEWS vendored Normal file
View File

@ -0,0 +1,6 @@
cciss-vol-status (1:1.09-2hwraid1) unstable; urgency=low
* Starting from this release cciss-vol-status has been renamed to
cciss_vol_status to match upstream and Debian's name.
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Tue, 31 Jan 2012 14:37:03 +0100

27
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,27 @@
README.Debian for cciss-vol-status package
------------------------------------------
Possible configuration:
----------------------
If you want to change the default configuration of the init script you
can create the file /etc/default/cciss-vol-statusd and specify the following
values.
MAILTO=
PERIOD=
REMIND=
ID=
Use MAILTO to specify which user shall get the status mails
(default is root).
With PERIOD you can fix the seconds between each check.
And REMIND specifies the seconds between each reminder.
ID is set as default to /dev/cciss/c0d0 which should fit most of setups.
However you need to change it to support multiple cards.
Look at the cciss-vol-status(8) manpage for more information.
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Wed, 20 Aug 2008 12:38:00 +0200

View File

@ -0,0 +1,193 @@
#! /bin/sh
# Author: Petter Reinholdtsen <pere@hungry.com>
# Author: Adam Cécile (Le_Vert) <gandalf@le-vert.net>
# License: GNU General Public License v2 or later
#
### BEGIN INIT INFO
# Provides: cciss-vol-statusd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Check cciss_vol_status values in the background.
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="cciss-vol-status monitor"
NAME="cciss-vol-statusd"
PIDFILE=/var/run/$NAME.pid
STATUSFILE=/var/run/$NAME.status
SCRIPTNAME=/etc/init.d/$NAME
# Do not touch you can configure this in /etc/default/cciss-vol-statusd
MAILTO=root # Where to report problems
PERIOD=600 # Seconds between each check (default 10 minutes)
REMIND=7200 # Seconds between each reminder (default 2 hours)
RUN_DAEMON=yes
ID=/dev/cciss/c0d0
[ -e /etc/default/cciss-vol-statusd ] && . /etc/default/cciss-vol-statusd
# Gracefully exit if the package has been removed.
test -x /usr/sbin/cciss_vol_status || exit 0
. /lib/lsb/init-functions
[ -e /etc/default/rcS ] && . /etc/default/rcS
if [ $RUN_DAEMON = "no" ] ; then
log_begin_msg "cciss-vol-statusd is disabled in /etc/default/cciss-vol-statusd, not starting."
log_end_msg 0
exit 0
fi
check_cciss() {
echo $$ > $PIDFILE.new && mv $PIDFILE.new $PIDFILE
while true ; do
# Check ever $PERIOD seconds, send email on every status
# change and repeat ever $REMIND seconds if the raid is still
# bad.
if (cciss_vol_status $ID); then
BADRAID=false
else
BADRAID=true
logger -t cciss-vol-statusd "detected non-optimal RAID status"
fi
STATUSCHANGE=false
if [ true = "$BADRAID" ] ; then
# RAID not OK
(cciss_vol_status $ID) > $STATUSFILE.new
if [ ! -f $STATUSFILE ] ; then # RAID just became broken
STATUSCHANGE=true
mv $STATUSFILE.new $STATUSFILE
elif cmp -s $STATUSFILE $STATUSFILE.new ; then
# No change. Should we send reminder?
LASTTIME="`stat -c '%Z' $STATUSFILE`"
NOW="`date +%s`"
SINCELAST="`expr $NOW - $LASTTIME`"
if [ $REMIND -le "$SINCELAST" ]; then
# Time to send reminder
STATUSCHANGE=true
mv $STATUSFILE.new $STATUSFILE
else
rm $STATUSFILE.new
fi
else
STATUSCHANGE=true
mv $STATUSFILE.new $STATUSFILE
fi
else
# RAID OK
if [ -f $STATUSFILE ] ; then
rm $STATUSFILE
STATUSCHANGE=true
fi
fi
if [ true = "$STATUSCHANGE" ]; then
hostname="`uname -n`"
(
cat <<EOF
This is a RAID status update from cciss-vol-statusd. The cciss_vol_status
program reports that one of the RAIDs changed state:
EOF
if [ -f $STATUSFILE ] ; then
cat $STATUSFILE
else
(cciss_vol_status $ID)
fi
echo
echo "Report from $0 on $hostname"
) | mail -s "info: CCISS raid status change on $hostname" $MAILTO
fi
sleep $PERIOD
done
}
check_daemon() {
# Let's check if there is a daemon which is really running and not timing out
DAEMON_RUN=`ps aux | grep "/etc/init.d/cciss-vol-statusd check_cciss" | grep -v grep | grep -v daemon`
if [ -n "$DAEMON_RUN" ] ; then
return 1;
else
return 0;
fi
}
#
# Function that starts the daemon/service.
#
d_start() {
[ -f $PIDFILE ] && PID="`cat $PIDFILE`"
if [ "$PID" ] ; then
log_progress_msg "Daemon already running. Refusing to start another"
return 0
elif check_daemon ; then
# Use the daemon package to turn this script into a daemon
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--oknodo --exec /usr/bin/daemon /usr/bin/daemon $SCRIPTNAME check_cciss
return 0
else
log_progress_msg "Daemon is already running. Refusing to start another"
return 0
fi
}
#
# Function that stops the daemon/service.
#
d_stop() {
if [ -f $PIDFILE ] ; then
start-stop-daemon --stop --oknodo --quiet --pidfile $PIDFILE > /dev/null 2>&1
rm -f $PIDFILE
else
log_progress_msg "Daemon is already stopped."
return 0
fi
}
# This is a workaround function which does not directly exit and
# therefore can be used by a restart
d_stop_by_restart() {
if [ -f $PIDFILE ] ; then
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE
rm -f $PIDFILE
log_end_msg 0
else
log_progress_msg "Daemon is already stopped."
log_end_msg 0
fi
}
case "$1" in
start)
echo -n ""
log_begin_msg "Starting $DESC: $NAME"
d_start ; CODE=$?
log_end_msg $CODE
;;
stop)
log_begin_msg "Stopping $DESC: $NAME"
d_stop ; CODE=$?
log_end_msg $CODE
;;
check_cciss)
check_cciss
;;
restart|force-reload)
log_begin_msg "Restarting $DESC: $NAME"
d_stop_by_restart
sleep 1
d_start || CODE=$?
log_end_msg $CODE
;;
*)
# echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

1
debian/cciss-vol-status.examples vendored Normal file
View File

@ -0,0 +1 @@
debian/cron.daily-example

67
debian/changelog vendored Normal file
View File

@ -0,0 +1,67 @@
cciss-vol-status (1:1.12-1gohwraid1) UNRELEASED; urgency=medium
* bump to new version
-- Mario Fetka <mario.fetka@gmail.com> Sat, 11 Nov 2017 18:23:49 +0100
cciss-vol-status (1:1.10-1hwraid1) unstable; urgency=low
* New upstream release.
* Drop allow_short_persnickety_option patch.
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Tue, 05 Feb 2013 16:55:37 +0100
cciss-vol-status (1:1.09-2hwraid1) unstable; urgency=low
* Brand new package based on 1.09-2 debian's one.
* Fully backported to debhelper 5 to keep old releases compatibility.
* Improved init script by importing fixes from mpt-status 1.2.0-7 package.
* Add an epoch to be sure it will be installed over debian's official
package (Closes: #90).
* Binary renamed from cciss-vol-status to cciss_vol_status to match
upstream's and Debian's name (Add debian/NEWS).
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Tue, 31 Jan 2012 14:31:50 +0100
cciss-vol-status (1.09-2) unstable; urgency=low
* Switched to minimal rules file, to fix lintian warning
debian-rules-missing-recommended-target.
* Reformatted debian/copyright. Also fixes lintian pedantic check
copyright-refers-to-symlink-license.
* Add patch so the short form of the --persnickety is accepted.
-- Christian Hofstaedtler <christian@hofstaedtler.name> Mon, 29 Aug 2011 01:23:05 +0200
cciss-vol-status (1.09-1) unstable; urgency=low
* New Upstream release 1.09
* Drop patch fix-strnlen-missing-arg, fixed upstream
* Bump Standards-Version to 3.9.2
* Rebuild autotools build system on build, so we don't Depend: on obsolete
automake1.10
* Add cron.daily example (Closes: #597573)
* Set VCS Fields in debian/control
* Update Package description
* Remove empty /usr/sbin directory
* fix example installation
* Do not install useless README
* Update Maintainer email address
-- Christian Hofstaedtler <christian@hofstaedtler.name> Thu, 02 Jun 2011 18:09:06 +0200
cciss-vol-status (1.06-1) unstable; urgency=low
* New upstream release (Closes: #568415)
* Switch to dpkg-source 3.0 (quilt) format
* Bump Standards-Version to 3.8.3
* Fix lintian warnings by adding ${misc:Depends}
-- Christian Hofstaedtler <ch+debian-packages@zeha.at> Thu, 04 Feb 2010 18:39:28 +0000
cciss-vol-status (1.03-1) unstable; urgency=low
* Initial release (Closes: #496788)
-- Christian Hofstaedtler <ch+debian-packages@zeha.at> Wed, 27 Aug 2008 17:52:21 +0200

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
5

21
debian/control vendored Normal file
View File

@ -0,0 +1,21 @@
Source: cciss-vol-status
Section: admin
Priority: extra
Maintainer: Adam Cécile (Le_Vert) <gandalf@le-vert.net>
Build-Depends: debhelper (>= 5), autotools-dev, quilt
Standards-Version: 3.9.2
Homepage: http://cciss.sourceforge.net/
Vcs-Browser: http://github.com/zeha/cciss-vol-status/
Vcs-Git: git://github.com/zeha/cciss-vol-status.git
DM-Upload-Allowed: yes
Package: cciss-vol-status
Architecture: amd64 i386
Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base, daemon, bsd-mailx | mailx
Description: HP SmartArray RAID Volume Status Checker
A RAID monitor for HP SmartArray Controllers, as supported by the "cciss",
"hpsa", "hpahcisr" kernel drivers.
It will check for problems on your configured logical drives, without relying
on the controller's event log.
.
It also supports MSA500 and MSA1000 controllers.

41
debian/copyright vendored Normal file
View File

@ -0,0 +1,41 @@
This work was packaged for Debian by:
Christian Hofstaedtler <christian@hofstaedtler.name> on Wed, 27 Aug 2008 17:52:21 +0200
It was downloaded from:
http://cciss.sourceforge.net/
Upstream Author:
Stephen M. Cameron <smcameron@users.sourceforge.net>
Copyright:
Copyright (C) 2006,2007 Hewlett-Packard Development Company, L.P.
License:
cciss_vol_status is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
cciss_vol_status is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cciss_vol_status; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
The Debian packaging is:
Copyright 2008,2009,2010,2011 Christian Hofstaedtler <christian@hofstaedtler.name>
and is licensed under the GPL version 2 or (at your option) any later version,
see above.

29
debian/cron.daily-example vendored Normal file
View File

@ -0,0 +1,29 @@
#!/bin/sh
# This is an example cron.daily file, which one could use to do a cheap
# daily check of the RAID arrays. You might be better off setting up a
# proper monitoring system though.
test -x /usr/bin/cciss_vol_status || exit 0
STATUS=0
if [ -d /proc/driver/cciss ]; then
DEVS=`grep -h 'cciss/c.*d0:' /proc/driver/cciss/cciss* |awk -F: '{print "/dev/" $1}'`
OUTPUT=`/usr/bin/cciss_vol_status $DEVS`
if [ $? -ne 0 ]; then
printf "%s\n" "$OUTPUT"
exit 1
fi
fi
# FIXME: This cronjob should also look at the scsi generic nodes
# (/dev/sg*?) to cover the hpsa driver, fibre-attached MSA1000 family
# devices, or the hpahcisr software RAID driver (see cciss_vol_status(8)
# about how to choose the correct nodes -- i don't use these other
# devices, so I cannot verify how to check them cleanly)
#
# -- Daniel Kahn Gillmor <dkg@fifthhorseman.net>
# Mon, 20 Sep 2010 18:12:31 -0400
exit 0

68
debian/patches/fix-manpage vendored Normal file
View File

@ -0,0 +1,68 @@
Description: man does not understand LD macro
Author: Christian Hofstaedtler <ch+debian-packages@zeha.at>
Forwarded: no
Last-Update: 2010-02-04
Index: cciss-vol-status-1.06/cciss_vol_status.8
===================================================================
--- cciss-vol-status-1.06.orig/cciss_vol_status.8 2010-02-04 19:13:34.302683423 +0000
+++ cciss-vol-status-1.06/cciss_vol_status.8 2010-02-04 19:14:40.797930573 +0000
@@ -101,7 +101,7 @@
/dev/sg node to use with cciss_vol_status:
.PP
.nf
-.LD
+.PP
wumpus:/home/scameron # ls -l /sys/class/scsi_generic/*
lrwxrwxrwx 1 root root 0 2009-11-18 12:31 /sys/class/scsi_generic/sg0 -> ../../devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:03.0/host0/target0:0:0/0:0:0:0/scsi_generic/sg0
lrwxrwxrwx 1 root root 0 2009-11-18 12:31 /sys/class/scsi_generic/sg1 -> ../../devices/pci0000:00/0000:00:1f.1/host2/target2:0:0/2:0:0:0/scsi_generic/sg1
@@ -128,7 +128,7 @@
which corresponds to the HP P800 RAID controller listed in /proc/scsi/scsi.
.SH EXAMPLE
.nf
-.LD
+.PP
[root@somehost]# cciss_vol_status -q /dev/cciss/c*d0
/dev/cciss/c0d0: (Smart Array P800) RAID 0 Volume 0 status: OK.
/dev/cciss/c0d0: (Smart Array P800) RAID 0 Volume 1 status: OK.
@@ -206,7 +206,7 @@
drive status:
.PP
.nf
-.LD
+.PP
"At least one spare drive designated"
"At least one spare drive activated and currently rebuilding"
"At least one activated on-line spare drive is completely rebuilt on this logical drive"
@@ -220,7 +220,7 @@
physical drives, if more than zero, will be reported as:
.TP
.nf
-.LD
+.PP
"Total of n failed physical drives detected on this logical drive."
.DE
.fi
@@ -231,7 +231,7 @@
power supplies, and temperature are reported as follows:
.PP
.nf
-.LD
+.PP
"Fan failed"
"Temperature problem"
"Door alert"
@@ -265,7 +265,7 @@
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
http://cciss.sourceforge.net
-.SH note 1
+.SH NOTE 1
The /dev/cciss/c*d0 device nodes of the cciss driver do double duty.
They serve as an access point to both the RAID controllers, and to the
first logical drive of each RAID controller. Notice that a /dev/cciss/c*d0
@@ -277,4 +277,3 @@
were statically allocated at compile time, and were in short supply.
Changing this behavior at this point would break lots of userland
programs.
-.FE

1
debian/patches/series vendored Normal file
View File

@ -0,0 +1 @@
fix-manpage

79
debian/rules vendored Executable file
View File

@ -0,0 +1,79 @@
#!/usr/bin/make -f
# Quilt patch system
include /usr/share/quilt/quilt.make
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif
DESTDIR=$(CURDIR)/debian/cciss-vol-status
configure: patch
config.status: configure
dh_testdir
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
./configure $(CROSS) \
--prefix=/usr \
--bindir=/usr/sbin \
--mandir=/usr/share/man \
CFLAGS="$(CFLAGS)" \
LDFLAGS="-Wl,-z,defs"
build: build-arch build-indep
build-indep:
build-arch: config.status
dh_testdir
$(MAKE)
touch $@
clean: unpatch
dh_testdir
dh_testroot
rm -f build-arch
[ ! -f Makefile ] || $(MAKE) distclean
rm -f config.sub config.guess config.log
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) DESTDIR=$(DESTDIR) install
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installman
dh_installinit --name=cciss-vol-statusd
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
1.0

9
debian/watch vendored Normal file
View File

@ -0,0 +1,9 @@
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to find new files on sourceforge, for debscripts >= 2.9
http://sf.net/cciss/cciss_vol_status-(.*)\.tar\.gz