focal bind9 package uses "named.service" whereas charm still checks for bind9

Bug #1929770 reported by Zachary Zehring
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Designate-Bind Charm
Fix Released
Critical
Alex Kavanagh

Bug Description

During a series upgrade from bionic to focal, the designate-bind units went into a blocked state, saying that "bind9.service" was not running. However in focal, bind9 package uses the "named.service" and does not have a
"bind9.service" defined:

ubuntu@juju-ba2deb-5-lxd-4:/etc$ dpkg -L bind9 | grep service
/lib/systemd/system/named-resolvconf.service
/lib/systemd/system/named.service

Looking at the code in DesignateBindCharm class, it only defines the bind9 service. To work around this issue, I changed the code to check for "named.service" instead.

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Triage; it sounds like the charm doesn't support focal properly.

tags: added: series-upgrade
Changed in charm-designate-bind:
importance: Undecided → Critical
status: New → Triaged
Changed in charm-designate-bind:
assignee: nobody → Alex Kavanagh (ajkavanagh)
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

So a fresh deploy on focal also has the key "bind9" for the service, and "systemctl status bind9" does indicate that the 'named' service is running. So there's clearly some deprecated support for using bind9 in focal (when the daemon and service is called named). I'll do a series-upgrade and confirm.

Changed in charm-designate-bind:
status: Triaged → In Progress
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

So confirmed that there is different behaviour between a focal installed bind9 and a bionic->focal upgrade bind9. There is probably something going on in the maintainer scripts due to the upgrade where it doesn't add the alias for named if bind9 is upgraded rather than installed.

If the designate unit is paused during a juju series-upgrade then the hook fails due to the lack of bind9 service.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate-bind (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate-bind (master)

Reviewed: https://review.opendev.org/c/openstack/charm-designate-bind/+/794045
Committed: https://opendev.org/openstack/charm-designate-bind/commit/ba7e3ac9e47314de9593f16e62445f271627add8
Submitter: "Zuul (22348)"
Branch: master

commit ba7e3ac9e47314de9593f16e62445f271627add8
Author: Alex Kavanagh <email address hidden>
Date: Wed Jun 2 10:18:59 2021 +0100

    Fix charm so that on focal it uses named service

    Pre-focal the service was called 'bind9'. On focal+ it is called
    'named'. This patch introduces a number of changes to make this
    possible:

     * Modify existing charm class "DesignateBindCharm" to include a check
       to see if the distro version is "focal" or higher; if so switch
       the service name to 'named'.

    Change-Id: Ida65c620fa81715d37e468217aea28f160cf31ee
    Closes-Bug: #1929770

Changed in charm-designate-bind:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate-bind (stable/21.04)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-designate-bind (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate-bind (master)

Reviewed: https://review.opendev.org/c/openstack/charm-designate-bind/+/799677
Committed: https://opendev.org/openstack/charm-designate-bind/commit/5205bceedf8efcda08d8e6b3c09d162a3872bb65
Submitter: "Zuul (22348)"
Branch: master

commit 5205bceedf8efcda08d8e6b3c09d162a3872bb65
Author: Alex Kavanagh <email address hidden>
Date: Tue Jul 6 15:21:39 2021 +0100

    Fix charm so that on focal it uses named service - 2

    Pre-focal the service was called 'bind9'. On focal+ it is called
    'named'. A previous commit [1] (also be me) didn't actually catch all of
    the uses of bind9 as a service, so this concludes the set.

    [1] Ida65c620fa81715d37e468217aea28f160cf31ee

    Change-Id: Ifb5adfbb5a69a9b12ef9fb7c214b192642d11344
    Closes-Bug: #1929770

Changed in charm-designate-bind:
milestone: none → 21.10
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-designate-bind (stable/21.04)

Reviewed: https://review.opendev.org/c/openstack/charm-designate-bind/+/795375
Committed: https://opendev.org/openstack/charm-designate-bind/commit/cc2629b514e363f785e37ee6ec237bf7563b2328
Submitter: "Zuul (22348)"
Branch: stable/21.04

commit cc2629b514e363f785e37ee6ec237bf7563b2328
Author: Alex Kavanagh <email address hidden>
Date: Wed Jun 2 10:13:42 2021 +0100

    Fix charm so that on focal it uses named service

    This is a cherry-pick/squash of three commits:

     8949ab2 Switch Helper to use c.openstack PatchHelper
     ba7e3ac Fix charm so that on focal it uses named service
     5205bce Fix charm so that on focal it uses named service - 2

    For the purposes of the backport, they have been squashed into this
    single commit. The Change-Id is from ba7e3ac.

    Original commit messages (minus change ids):

    ba7e3ac Fix charm so that on focal it uses named service

    Pre-focal the service was called 'bind9'. On focal+ it is called
    'named'. This patch introduces a number of changes to make this
    possible:

     * Modify existing charm class "DesignateBindCharm" to include a check
       to see if the distro version is "focal" or higher; if so switch
       the service name to 'named'.

    8949ab2 Switch Helper to use c.openstack PatchHelper

    Switch Helper to use c.openstack PatchHelper

    This charms.openstack PatchHelper class is a better version of the
    Helper class in test_lib_charm_openstack_designate_bind.py as it allows
    patching by fully qualified class string. This simplifies the patching
    in the tests.

    Change-Id: Ida65c620fa81715d37e468217aea28f160cf31ee
    Closes-Bug: #1929770

Changed in charm-designate-bind:
status: Fix Committed → Fix Released
Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :

Environment with the reported issue cannot be resolved by upgrading the designate-bind charm to 21.04/21.10 stable release which has the fix (tested with juju 2.9.16).

For workaround please see bug https://bugs.launchpad.net/juju/+bug/1948906

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.