Analysis: both nagios2 and nagios2-common try to stop nagios2 in prerm. The prerm in nagios2 tries to fail gracefully using a "|| true" stanza:
-----------------------
#!/bin/sh -e
# we attempt to stop nagios2 twice, once in nagios2-common's prerm
# and once here. otherwise, if nagios2+nagios2-common are being purged,
# the /usr/sbin/nagios2 binary could disappear before nagios2-common's
# prerm script runs, which would prevent it from being able to stop
# the binary.
if [ -x "/etc/init.d/nagios2" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d nagios2 stop || true
else
/etc/init.d/nagios2 stop || true
fi
fi
-----------------------
However, usage of "-e" option renders the "|| true" inefficient, prerm returns 3 in invoke-rc.d fails, therefore breaking the update.
Analysis: both nagios2 and nagios2-common try to stop nagios2 in prerm. The prerm in nagios2 tries to fail gracefully using a "|| true" stanza:
------- ------- ------- --
#!/bin/sh -e
# we attempt to stop nagios2 twice, once in nagios2-common's prerm nagios2- common are being purged, d/nagios2" ]; then init.d/ nagios2 stop || true ------- ------- --
# and once here. otherwise, if nagios2+
# the /usr/sbin/nagios2 binary could disappear before nagios2-common's
# prerm script runs, which would prevent it from being able to stop
# the binary.
if [ -x "/etc/init.
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d nagios2 stop || true
else
/etc/
fi
fi
-------
However, usage of "-e" option renders the "|| true" inefficient, prerm returns 3 in invoke-rc.d fails, therefore breaking the update.