Discussion:
Bug#599931: zipl hook scripts invoke zipl multiple times
(too old to reply)
Stephen Powell
2010-10-12 14:40:02 UTC
Permalink
Package: s390-tools
Version: 1.8.3-2
Severity: wishlist

The zipl hook scripts, /etc/kernel/postinst.d/zz-zipl and
/etc/kernel/postrm.d/zz-zipl, invoke zipl multiple times. It would be good
to incorporate logic similar to that included in the initramfs-tools hook
script so that zipl only gets invoked once. For example, at the
time of this writing, /etc/kernel/postinst.d/zz-zipl looks something like this:

-----

#!/bin/sh
exec zipl </dev/null >&2

-----

This script is called both for pre-configuration and for configuration,
causing zipl to be invoked twice. Consider instead the following logic:

-----

#!/bin/sh
set -e

# Avoid executing multiple times.
if [ -n "$DEB_MAINT_PARAMS" ];then
eval set -- "$DEB_MAINT_PARAMS"
if [ -z "$1" ] || [ "$1" != "configure" ];then
exit 0
fi
fi


if [ -f /etc/zipl.conf ];then
zipl >&2
else
echo "WARNING, not invoking zipl: /etc/zipl.conf not found" >&2
fi

-----

This script exits without invoking zipl when invoked during pre-configuration,
but does invoke zipl during configuration. (It also does not invoke zipl
if zipl's configuration file is not found.) Similarly,
/etc/kernel/postrm.d/zz-zipl currently looks something like this:

-----

#!/bin/sh
exec zipl </dev/null >&2

-----

This script is invoked for a remove and also for a purge. When a purge is done,
the script is called twice: first for the remove process, then a second time
for the purge process. Thus, zipl gets executed twice. Consider instead
the following logic:

-----

#!/bin/sh

# Avoid executing multiple times.
if [ -n "$DEB_MAINT_PARAMS" ];then
eval set -- "$DEB_MAINT_PARAMS"
if [ -z "$1" ] || [ "$1" != "remove" ];then
exit 0
fi
fi

if [ -f /etc/zipl.conf ];then
zipl >&2
else
echo "WARNING, not invoking zipl: /etc/zipl.conf not found" >&2
fi
exit 0

-----

This logic causes the script to exit without invoking zipl
when called for purge processing, but allows zipl to be invoked
during remove processing. (It also forces a clean exit in case
of an error from zipl, which is desirable during a remove.)
--
.''`. Stephen Powell
: :' :
`. `'`
`-
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Debian Bug Tracking System
2011-10-26 15:30:02 UTC
Permalink
Your message dated Wed, 26 Oct 2011 15:17:45 +0000
with message-id <E1RJ5Ef-0005yv-***@franck.debian.org>
and subject line Bug#599931: fixed in s390-tools 1.14.0-1
has caused the Debian Bug report #599931,
regarding zipl hook scripts invoke zipl multiple times
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ***@bugs.debian.org
immediately.)
--
599931: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599931
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Loading...