Bug#427499: improved clvmd init script compliant with Debian Policy 9.3

andremachado andremachado at techforce.com.br
Mon Jun 4 14:39:29 UTC 2007


Package: clvm
Version: 2.02.06-4
Severity: normal
Tags: patch

--- Please enter the report below this line. ---
Hello,
please, include the improved clvmd init script.
It had been discussed with other developers, being fully compliant with  Debian Policy 9.3 guidelines.
The start and stop commands leverage use of Debian scripts for daemons, and that must not have more than one instance allowed.
Also, start and stop errors must "bubble up" to the script caller (postinst or command line).
Restart, reload and force-reload do not issue an error to caller when there is not a previous running daemon.
But issue error when fail to start.
Usage message enforces Debian Policy for init scripts.

Also, I suggest to modify the script run levels (with other related scripts) to
update-rc.d ccs defaults 71 29
update-rc.d cman defaults 72 28
update-rc.d fence defaults 73 27
update-rc.d clvmd defaults 74 26
in order to allow remote access (open ssh) to nodes even when a failure happens.


This bug report patch solves / supersedes the bugs:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=336258
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=400205
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=336258

Regards.
Andre Felipe Machado
http://www.techfoce.com.br





#! /bin/sh

# clvmd         Start/Stop script for the cluster LVM daemon
# Author:       Daniel Bertolo daniel at bertolo.com
# Version:      @(#)clvmd  1.00  25-Jun-2006  daniel.bertolo at kinderheim-buehl.ch
# Version:      @(#)clvmd  1.01  22-May-2007  andremachado % techforce.com.br
# Version:      @(#)clvmd  2.00  04-Jun-2007  andremachado % techforce.com.br

# Script compliant with Debian Policy 9.3
set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="The cluster LVM daemon"
NAME=clvmd
DAEMON=/sbin/$NAME

if [ -f /etc/default/$NAME ]; then
    . /etc/default/$NAME
fi

test -x $DAEMON || exit 0

d_start() {
        start-stop-daemon --start --exec $DAEMON
}

d_stop() {
        start-stop-daemon --stop $1 $2 $3 $4 --exec $DAEMON
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME "
        d_start || exit 1
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME "
        d_stop || exit 1
        echo "."
        ;;
  restart)
        echo  -n "Restarting $DESC: $NAME "
        d_stop --oknodo  --quiet --retry 10 || sleep 5
        d_start || sleep 5
        echo "."
        ;;
  reload|force-reload)
        echo  -n "Reloading $DESC: $NAME "
        d_stop --oknodo  --quiet --retry 10 --signal HUP || sleep 5
        d_start || sleep 5
        echo "."
        ;;
  *)
        echo "Usage: invoke-rc.d $NAME {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac
exit 0




--- System information. ---
Architecture: i386
Kernel: Linux 2.6.18-4-xen-686

Debian Release: 4.0
500 stable www.debian-multimedia.org
500 stable security.debian.org
500 stable ftp.br.debian.org

--- Package information. ---
Depends (Version) | Installed
=====================================-+-=================
libc6 (>= 2.3.6-6) | 2.3.6.ds1-13
libdevmapper1.02 (>= 2:1.02.02-2) | 2:1.02.08-1
libncurses5 (>= 5.4-5) | 5.5-5
libreadline5 (>= 5.2) | 5.2-2
libselinux1 (>= 1.32) | 1.32-3
libsepol1 (>= 1.14) | 1.14-2
lvm2 (>> 2.0.23) | 2.02.06-4






More information about the pkg-lvm-maintainers mailing list