Frans Pop wrote:
> I agree with that. One my desktop I currently get a fat red FAILED during
> shutdown because an LVM volume cannot be unmounted as it is in use (or
> maybe it is still #402511, I have not investigated).
> Totally stupid.
I'm not sure what's totally stupid about this, but any stupidity seems
limited to this script, /etc/init.d/lvm2, and not to the lsb init script
interface.
#!/bin/sh
SCRIPTNAME=/etc/init.d/lvm2
. /lib/lsb/init-functions
[ -x /sbin/vgchange ] || exit 0
do_start()
{
/sbin/vgscan --ignorelockingfailure --mknodes || true
/sbin/vgchange -a y --ignorelockingfailure || return 2
}
do_stop()
{
/sbin/vgchange -a n --ignorelockingfailure || return 2
}
case "$1" in
start)
log_begin_msg "Setting up LVM Volume Groups"
do_start
case "$?" in
0|1) log_end_msg 0 ;;
esac
;;
stop)
log_begin_msg "Shutting down LVM Volume Groups"
do_stop
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
restart|force-reload)
;;
*)
echo "Usage: $SCRIPTNAME {start|stop}" >&2
exit 3
;;
esac
The only way this can print a red FAILED at shutdown is if the vgchange
returns nonzero. If the vgchange legitimately returns nonzero during shutdown,
the script could be fixed to deal with that and call log_end_msg 0.
The fact that it always seems to log suggess on startup even if the commands
fail is also .. strange.
--
see shy jo
Attachment:
signature.asc
Description: Digital signature