1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

stop init script from returning w/ non-zero if not really an error

This commit is contained in:
Andres Salomon 2002-02-21 08:30:14 +00:00
parent cc8b2cd706
commit 26075f7a47

34
debian/init.d vendored
View File

@ -16,23 +16,39 @@ set -e
case "$1" in
start)
echo -n "Initializing $DESC: "
modprobe dm-mod >/dev/null 2>&1
vgchange -a y 2>/dev/null
# TODO: attempt to mount all lvm devices; mount -a?
echo "$NAME."
modprobe dm-mod >/dev/null 2>&1 && CONT=1
if test "$CONT"; then
vgchange -a y 2>/dev/null
# TODO: attempt to mount all lvm devices; mount -a?
echo "$NAME."
else
echo "device-mapper kernel module not loaded; refusing to init LVM"
fi
;;
stop)
echo -n "Shutting down $DESC: "
# TODO: attempt to umount all lvm devices; umount -a?
vgchange -a n 2>/dev/null
rmmod dm-mod >/dev/null 2>&1
vgchange -a n 2>/dev/null && CONT=1
if test "$CONT"; then
rmmod dm-mod >/dev/null 2>&1
fi
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
stop
sleep 1
start
# TODO: attempt to umount all lvm devices; umount -a?
vgchange -a n 2>/dev/null && CONT=1
if test "$CONT"; then
rmmod dm-mod >/dev/null 2>&1
sleep 1
modprobe dm-mod >/dev/null 2>&1
vgchange -a y 2>/dev/null
# TODO: attempt to mount all lvm devices; mount -a?
fi
echo "$NAME."
;;
*)