Merge ~sergiodj/ubuntu/+source/postfix:support-netword-dispatcher into ubuntu/+source/postfix:ubuntu/devel

Proposed by Sergio Durigan Junior
Status: Merged
Merged at revision: 172181b9e9d0d3bff1406efcfd0d9a8c3f433af9
Proposed branch: ~sergiodj/ubuntu/+source/postfix:support-netword-dispatcher
Merge into: ubuntu/+source/postfix:ubuntu/devel
Diff against target: 43 lines (+13/-0)
3 files modified
debian/changelog (+9/-0)
debian/postfix.dirs (+2/-0)
debian/rules (+2/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server Pending
Review via email: mp+412054@code.launchpad.net

Description of the change

This MP fixes bug 1718227 and implements support for networkd-dispatcher on postfix.

This has been submitted (a while ago) to Debian here:

https://salsa.debian.org/postfix-team/postfix-dev/-/merge_requests/13

After waiting a long time without replies, I decided to file a bug there:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=999867

Let's hope this gets some attention now.

The gist of the feature is simple: Ubuntu is moving towards deprecating and removing ifupdown, and therefore we need to make sure that the existing ifupdown scripts are converted to networkd-dispatcher. For postfix specifically, this task was easy because the script is compatible with both services.

The idea, then, is to simply install the scripts inside the /usr/lib/networkd-dispatcher/{routable,off}./ directories. The routable.d one is the equivalent of the "up" script, and the off.d one is the equivalent of "down".

I tested this inside an Ubuntu VM and verified that it works as expected:

# ip link set enp5s0 down
Oct 14 18:45:25 ifupdown-bug1718227 systemd-networkd[286]: enp5s0: Link DOWN
Oct 14 18:45:25 ifupdown-bug1718227 systemd-networkd[286]: enp5s0: Lost carrier
...
Oct 14 18:45:25 ifupdown-bug1718227 systemd[1]: Reloading Postfix Mail Transport Agent (instance -).
Oct 14 18:45:25 ifupdown-bug1718227 postfix/postfix-script[5970]: refreshing the Postfix mail system
Oct 14 18:45:25 ifupdown-bug1718227 postfix/master[5888]: reload -- version 3.5.6, configuration /etc/postfix
Oct 14 18:45:25 ifupdown-bug1718227 systemd[1]: Reloaded Postfix Mail Transport Agent (instance -).
Oct 14 18:45:25 ifupdown-bug1718227 systemd[1]: Reloading Postfix Mail Transport Agent.
Oct 14 18:45:25 ifupdown-bug1718227 systemd[1]: Reloaded Postfix Mail Transport Agent.

# ip link set enp5s0 up
Oct 14 18:45:43 ifupdown-bug1718227 systemd-networkd[286]: enp5s0: Link UP
Oct 14 18:45:43 ifupdown-bug1718227 systemd-networkd[286]: enp5s0: Gained carrier
...
Oct 14 18:45:43 ifupdown-bug1718227 systemd[1]: Reloading Postfix Mail Transport Agent (instance -).
Oct 14 18:45:43 ifupdown-bug1718227 postfix/postfix-script[6005]: refreshing the Postfix mail system
Oct 14 18:45:43 ifupdown-bug1718227 postfix/master[5888]: reload -- version 3.5.6, configuration /etc/postfix
Oct 14 18:45:43 ifupdown-bug1718227 systemd[1]: Reloaded Postfix Mail Transport Agent (instance -).
Oct 14 18:45:43 ifupdown-bug1718227 systemd[1]: Reloading Postfix Mail Transport Agent.
Oct 14 18:45:43 ifupdown-bug1718227 systemd[1]: Reloaded Postfix Mail Transport Agent.

There's a PPA with the proposed changes here:

https://launchpad.net/~sergiodj/+archive/ubuntu/postfix-bugfix/+packages

autopkgtest is still happy:

autopkgtest [18:23:19]: @@@@@@@@@@@@@@@@@@@@ summary
postfix PASS

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Something I forgot to mention: I'm purposedly leaving the Debian BTS reference in the d/changelog entry. This is to signal future contributors that there is a Debian bug related to this feature.

Revision history for this message
Bryce Harrington (bryce) wrote :
Download full text (4.2 KiB)

I think it's fine to leave the debian bug reference, however for clarity I'd suggest changing 'Closes' to something like 'Debian BTS' or similar. Debian's 6-digit bug numbers are close enough to Launchpad's that confusion is not unlikely; mentioning Deb or Debian somewhere will be enough clue.

Not sure if a vm is required for proper testing, but I manually built and installed postfix_3.5.13-1ubuntu2_amd64.deb, and ran the checks mentioned in the MP description and got similar results:

root@merges-jammy:/home/bryce/pkg/Postfix/review-mp412054# ip link set eth0 down
root@merges-jammy:/home/bryce/pkg/Postfix/review-mp412054# ip link set eth0 up

-- Journal begins at Tue 2021-11-16 18:45:49 UTC. --
Nov 18 17:26:08 merges-jammy postfix/master[484944]: reload -- version 3.5.13, configuration /etc/postfix
Nov 18 17:26:08 merges-jammy systemd[1]: Reloaded Postfix Mail Transport Agent (instance -).
Nov 18 17:26:08 merges-jammy systemd[1]: Reloading Postfix Mail Transport Agent.
Nov 18 17:26:08 merges-jammy systemd[1]: Reloaded Postfix Mail Transport Agent.
Nov 18 17:26:09 merges-jammy systemd-networkd[146]: eth0: Gained IPv6LL
Nov 18 17:26:16 merges-jammy sudo[485862]: bryce : TTY=pts/3 ; PWD=/home/bryce/pkg/Postfix/review-mp412054 ; USER=root ; COMMAND=/bin/bash
Nov 18 17:26:16 merges-jammy sudo[485862]: pam_unix(sudo:session): session opened for user root by (uid=1000)
Nov 18 17:26:38 merges-jammy systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Nov 18 17:27:12 merges-jammy sudo[485876]: bryce : TTY=pts/1 ; PWD=/home/bryce/pkg/Dovecot/fix-lp1945763/dovecot-gu ; USER=root ; COMMAND=/bin/bash
Nov 18 17:27:12 merges-jammy sudo[485876]: pam_unix(sudo:session): session opened for user root by (uid=1000)
Nov 18 17:27:41 merges-jammy systemd-networkd[146]: eth0: Link DOWN
Nov 18 17:27:41 merges-jammy systemd-networkd[146]: eth0: Lost carrier
Nov 18 17:27:41 merges-jammy systemd-networkd[146]: eth0: DHCP lease lost
Nov 18 17:27:41 merges-jammy systemd-networkd[146]: eth0: DHCPv6 lease lost
Nov 18 17:27:41 merges-jammy dbus-daemon[164]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.0' (uid=100 pid=146 comm="/lib/systemd/systemd-networkd " label="unconfined")
Nov 18 17:27:41 merges-jammy systemd[1]: Starting Hostname Service...
Nov 18 17:27:41 merges-jammy systemd[1]: Reloading Postfix Mail Transport Agent (instance -).
Nov 18 17:27:41 merges-jammy dbus-daemon[164]: [system] Successfully activated service 'org.freedesktop.hostname1'
Nov 18 17:27:41 merges-jammy systemd[1]: Started Hostname Service.
Nov 18 17:27:41 merges-jammy systemd-hostnamed[485888]: Hostname set to <merges-jammy> (static)
Nov 18 17:27:41 merges-jammy postfix/postfix-script[485908]: refreshing the Postfix mail system
Nov 18 17:27:41 merges-jammy postfix/master[484944]: reload -- version 3.5.13, configuration /etc/postfix
Nov 18 17:27:41 merges-jammy systemd[1]: Reloaded Postfix Mail Transport Agent (instance -).
Nov 18 17:27:41 merges-jammy systemd[1]: Reloading Postfix Mail Transport Agent.
Nov 18 17:27:41 merges-jammy systemd[1]: Reloaded Postfix Mail Transport Agent.
Nov 1...

Read more...

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Thursday, November 18 2021, Bryce Harrington wrote:

> Review: Approve

Thanks for the review, Bryce.

> I think it's fine to leave the debian bug reference, however for
> clarity I'd suggest changing 'Closes' to something like 'Debian BTS'
> or similar. Debian's 6-digit bug numbers are close enough to
> Launchpad's that confusion is not unlikely; mentioning Deb or Debian
> somewhere will be enough clue.

Fair enough. I've changed the entry to read:

  * Support networkd-dispatcher. (LP: #1718227) (Debian BTS #999867)
    - d/postfix.dirs: Add usr/lib/networkd-dispatcher/{routable,off}.d.
    - d/rules: Install debian/ip-{up,down}.d scripts into
      usr/lib/networkd-dispatcher/{routable,off}.d, respectively.

> Not sure if a vm is required for proper testing, but I manually built
> and installed postfix_3.5.13-1ubuntu2_amd64.deb, and ran the checks
> mentioned in the MP description and got similar results:
[...]
> I didn't run the autopkgtests but trust your results. The packaging and debian changes all LGTM, +1.

Thanks. Uploaded:

$ dput postfix_3.5.13-1ubuntu2_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/postfix/postfix_3.5.13-1ubuntu2_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/postfix/postfix_3.5.13-1ubuntu2.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading postfix_3.5.13-1ubuntu2.dsc: done.
  Uploading postfix_3.5.13-1ubuntu2.debian.tar.xz: done.
  Uploading postfix_3.5.13-1ubuntu2_source.buildinfo: done.
  Uploading postfix_3.5.13-1ubuntu2_source.changes: done.
Successfully uploaded packages.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 3eff35c..452fbf8 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+postfix (3.5.13-1ubuntu2) jammy; urgency=medium
7+
8+ * Support networkd-dispatcher. (LP: #1718227) (Debian BTS #999867)
9+ - d/postfix.dirs: Add usr/lib/networkd-dispatcher/{routable,off}.d.
10+ - d/rules: Install debian/ip-{up,down}.d scripts into
11+ usr/lib/networkd-dispatcher/{routable,off}.d, respectively.
12+
13+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Wed, 17 Nov 2021 18:03:41 -0500
14+
15 postfix (3.5.13-1ubuntu1) jammy; urgency=medium
16
17 * Merge with Debian unstable. (LP: #1946838)
18diff --git a/debian/postfix.dirs b/debian/postfix.dirs
19index b44997d..fbb6d9b 100644
20--- a/debian/postfix.dirs
21+++ b/debian/postfix.dirs
22@@ -5,6 +5,8 @@ etc/ppp/ip-up.d
23 etc/ppp/ip-down.d
24 etc/network/if-up.d
25 etc/network/if-down.d
26+usr/lib/networkd-dispatcher/routable.d
27+usr/lib/networkd-dispatcher/off.d
28 etc/postfix/dynamicmaps.cf.d
29 etc/postfix/postfix-files.d
30 etc/postfix/sasl
31diff --git a/debian/rules b/debian/rules
32index 1cd22f6..07e10f9 100755
33--- a/debian/rules
34+++ b/debian/rules
35@@ -212,6 +212,8 @@ install-arch: build-arch
36 install debian/ip-down.d ${base}/etc/ppp/ip-down.d/postfix
37 install debian/ip-up.d ${base}/etc/network/if-up.d/postfix
38 install debian/ip-down.d ${base}/etc/network/if-down.d/postfix
39+ install debian/ip-up.d ${base}/usr/lib/networkd-dispatcher/routable.d/postfix
40+ install debian/ip-down.d ${base}/usr/lib/networkd-dispatcher/off.d/postfix
41 install debian/update-libc.d ${base}/etc/resolvconf/update-libc.d/postfix
42 install debian/postfix-cdb.lintian-override ${base}-cdb/usr/share/lintian/overrides/${package}-cdb
43 install debian/postfix-ldap.lintian-override ${base}-ldap/usr/share/lintian/overrides/${package}-ldap

Subscribers

People subscribed via source and target branches