icinga-common debconf preconfiguration not working for check_external_commands

Bug #1197361 reported by gschoenberger
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
icinga (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi there,

I am currently trying to preconfigure the debconf question of icinga-common for an unattended installation. In detail I want to enable the check_external_commands, therefore I did:
---------------------
# echo "icinga-common icinga/check_external_commands boolean true" | debconf-set-selections
# export DEBIAN_FRONTEND=noninteractive
# apt-get install icinga-common
---------------------

Unfortunately the check_external_commands debconf value becomes overwritten and so external commands are not activated.
I think I found the reason why the value becomes overwritten, in icinga-common/DEBIAN/config there is the following code:
---------------------
if [ -e "$conffile" ]; then
        check_external_commands="$(grep -E '^ *check_external_commands=' $conffile | sed -e 's|.*check_external_commands=||')"

        # translate icinga option into debconf boolean
        # (this is better than using a select in debconf with Choices-C,
        # otherwise all translators would need to translate 'yes' and 'no').

        case $check_external_commands in
                0)
                        check_external_commands=false
                        ;;

                1)
                        check_external_commands=true
                        ;;
        esac

    db_set icinga/check_external_commands $check_external_commands
    db_input high icinga/check_external_commands || true
    db_go || true
---------------------
In the last statements with db_set I think the debconf preconfigured value is overwritten, as the config file is checked for "check_external_commands=0" and not the value from deconf is taken.

As check_external_commands is a boolean it should be "true" or "false", so in my opinion it should be possible to directly take the return value of "db_input" and not parse the config file.
The fix with the icinga.cfg file and the case statement should then be not necessary, as a result preconfiguration should work also.

System Information
---------------------
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
# uname -r
3.2.0-48-generic

Package Information
---------------------
icinga-common 1.9.1-1~ppa1~precise2

Tags: patch
Revision history for this message
gschoenberger (schoeni-georg) wrote :

I have rebuilded icinga and tested the attached patch.
As far as I can see there are no problems with it and preseeding with debconf works also.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch for check_external_commands in icinga-common.config" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.