config is in irqbalance 1.3.0-0.1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #!/bin/sh
set -e
. /usr/share/debconf/confmodule
db_version 2.0
CONF=/etc/default/irqbalance
CONFCONVERT=/etc/default/irqbalance.dpkg-needs-convert
# config has no way to detect upgrade vs fresh installs,
# so preinst hands us a flag files.
UPGRADE_FLAG_FILE=/run/irqbalance.dpkg-upgrade
INSTALL_FLAG_FILE=/run/irqbalance.dpkg-install
is_irqbalance_enabled() {
# If we are upgrading from a version without the .service file, we cannot
# rely on systemctl is-enabled to tell us if the service was enabled or
# not, we need to check if the LSB service was enabled in at least one
# runlevel even if we are running systemd.
if dpkg --compare-versions -- "$2" le-nl "1.1.0-2.2~"; then
if ls /etc/rc*.d/S*irqbalance >/dev/null 2>&1; then
return 0
else
return 1
fi
else
# See https://bugs.debian.org/705254 but lets try ourselves for now...
if [ -e /run/systemd/system ]; then
if systemctl -q is-enabled irqbalance.service; then
return 0
else
return 1
fi
else
if ls /etc/rc*.d/S*irqbalance >/dev/null 2>&1; then
return 0
else
return 1
fi
fi
fi
}
if test -e $CONF || test -e $CONFCONVERT; then
test -e $CONF && . $CONF || true
test -e $CONFCONVERT && . $CONFCONVERT || true
# ENABLED is the old format up for conversion,
# will be switched to update-rc.d handling in postinst...
if [ "$ENABLED" = "0" ]; then
db_set irqbalance/enable false
elif [ -e $UPGRADE_FLAG_FILE ] && ! is_irqbalance_enabled $*; then
db_set irqbalance/enable false
elif [ ! -e $INSTALL_FLAG_FILE ] && [ ! -e $UPGRADE_FLAG_FILE ]; then
# dpkg-reconfigure
if is_irqbalance_enabled $*; then
db_set irqbalance/enable true
else
db_set irqbalance/enable false
fi
else
db_set irqbalance/enable true
fi
# We no longer need flag files, clean up....
rm -f $UPGRADE_FLAG_FILE $INSTALL_FLAG_FILE
# ONESHOT is the old format used before conversion.
# Note: irqbalance.c treats IRQBALANCE_ONESHOT as active if set to
# anything (even empty string).
if [ "$ONESHOT" = "1" ] || [ ! -z ${IRQBALANCE_ONESHOT+x} ]; then
db_set irqbalance/oneshot true
else
db_set irqbalance/oneshot false
fi
fi
db_input low irqbalance/enable || true
db_input medium irqbalance/oneshot || true
db_go || true
exit 0
|