Bug 1067554 - split the pythonic NetworkManager dispatcher script into a minimal script and an updater
Summary: split the pythonic NetworkManager dispatcher script into a minimal script and...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnssec-trigger
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pavel Šimerda (pavlix)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-20 16:09 UTC by Pavel Šimerda (pavlix)
Modified: 2014-09-19 10:06 UTC (History)
4 users (show)

Fixed In Version: dnssec-trigger-0.12-13.fc20
Clone Of:
Environment:
Last Closed: 2014-09-19 10:06:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pavel Šimerda (pavlix) 2014-02-20 16:09:17 UTC
I'm bringing up an idea of splitting the pythonic NetworkManager dispatcher script written by Tomáš into two peaces. The original script doesn't need any modifications and could be installed e.g. as /usr/libexec/dnssec-trigger-update, while the new script will be installed in /etc/NetworkManager/dispatcher.d.

The new script could look like:


#!/bin/sh
#
# Script to notify dnssec-trigger that the DNS configuration in NetworkManager
# may have changed.

# NetworkManager reportedly doesn't pass the PATH environment variable.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Future versions of NetworkManager will have an active unbound/dnssec-trigger
# plugin. Don't intervene when the new plugin is being used.
if [ -e /etc/NetworkManager/NetworkManager.conf ]; then
    grep -q '^dns=unbound\>' /etc/NetworkManager/NetworkManager.conf && exit 0
fi

# Exec the dnssec-trigger update script that uses NetworkManager API to gather
# all the necessary information.
if [ -x /usr/libexec/dnssec-trigger-update ]; then
    exec /usr/libexec/dnssec-trigger-update
fi


Rationale:

1) It will be much cleaner to avoid calling NetworkManager dispatcher.d scripts from anywhere else than NetworkManager dispatcher itself. Currently the dispatcher is being called from systemd services and a /usr/libexec file is much more suitable for that.

2) Notice the check for dns=unbound in NM configuration. Of course the check can be improved or expanded. But the basic idea is that the script will become a no-op when we turn on an actual Unbound plugin.

3) During the early stages of development, the Unbound plugin can simply call /usr/libexec/dnssec-trigger-update which won't have the check and therefore will work properly.

4) For upstream, dnssec-trigger-update can be thought of as a universal integration point, not necessarily specific to NetworkManager.

5) Notice the 'exec' when callling dnssec-trigger-update. If the pythonic update script is not installed, the execution would fall through and there could be a bash fallback right in the script.

6) With that in mind, the new script could including the dns=unbound safeguard could be safely merged into the existing shell script solution.


Further notes:

The dnssec-triggerd.service file would be updated to use the file directly which in turn would mean it could also perform detection of NetworkManager and could notify NetworkManager when appropriate. The good thing about the split is, that NetworkManager dispatcher event would not result in returning the notification back to NetworkManager.

This may also be treated as a preliminary step for the next of NetworkManager dnssec-trigger integration.

Comment 1 Pavel Šimerda (pavlix) 2014-06-06 15:02:15 UTC
Fixed in 0.12, available in rawhide.

Comment 2 Pavel Šimerda (pavlix) 2014-06-06 17:14:11 UTC
I would like to track this for f20 instead.

Comment 3 Fedora Update System 2014-06-30 15:29:50 UTC
dnssec-trigger-0.12-12.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dnssec-trigger-0.12-12.fc20

Comment 4 Fedora Update System 2014-07-01 07:21:29 UTC
Package dnssec-trigger-0.12-12.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnssec-trigger-0.12-12.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7942/dnssec-trigger-0.12-12.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-08-11 11:40:35 UTC
dnssec-trigger-0.12-13.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dnssec-trigger-0.12-13.fc20

Comment 6 Fedora Update System 2014-09-19 10:06:53 UTC
dnssec-trigger-0.12-13.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.