Comment 5 for bug 220208

Revision history for this message
Thierry Carrez (ttx) wrote :

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.