postinst: try to force kill collectd process

Needs reallife testing, supposed to address our
"collectd still running and breaking our upgrade process"
issue.

From: Michael Prokop <mprokop@sipwise.com>
remotes/svn/trunk
Michael Prokop 15 years ago
parent 91877ffdf5
commit 2bc7935307

@ -19,12 +19,25 @@ set -e
if [ -x "/etc/init.d/collectd" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d collectd restart || exit $?
invoke-rc.d collectd restart || true
else
/etc/init.d/collectd restart || exit $?
/etc/init.d/collectd restart || true
fi
fi
# the init script waits for MAXWAIT (as defined in /etc/default/collectd),
# if the process is still running then this might break our upgrade process,
# so try to clean up then...
for pidfile in /var/run/collectd.pid /var/run/collectdmon.pid ; do
if [ -r "$pidfile" ] ; then
PID=$(cat "$pidfile" 2>/dev/null) || true
if [ -n "$PID" ] ; then
echo "Force killing collectd process (${PID})"
kill -9 "$PID" || true
fi
fi
done
# replace the directory provided by older versions of the package with a
# symlink; dpkg does not handle that according to policy 6.6
if [ "$1" = "configure" ] \

Loading…
Cancel
Save