Public bug reported: Please sync smcroute 2.4.4-3 (universe) from Debian unstable (main)
Explanation of FeatureFreeze exception: This updated version of smcroute fixes a racy systemd service unit and makes the autopkgtests much more reliable (Debian debbugs #924361). Changelog entries since current smcroute version 2.4.4-1: smcroute (2.4.4-3) unstable; urgency=medium * debian/tests: Skip multicast cache tests on systems without multicast capable interfaces. -- Micha Lenk <mi...@debian.org> Mon, 01 Mar 2021 09:22:50 +0100 smcroute (2.4.4-2) unstable; urgency=medium * debian/changelog: Mark bug #952418 as closed in 2.4.4-1 * Add sd_notify.patch teaching smcrouted to call sd_notify() when up and running. This fixes the systemd race condition that causes CI tests to fail on slow systems (closes: #924361). * autopkgtests: daemon-init-scripts: Revert the sleeps that were trying to "make tricky operations succeed". This is now fixed properly (see above). * Add build dependency on libsystemd-dev. -- Micha Lenk <mi...@debian.org> Sun, 28 Feb 2021 16:30:39 +0100 The debdiff output for the source package changes since smcroute 2.4.4-1 is: diff -Nru smcroute-2.4.4/debian/changelog smcroute-2.4.4/debian/changelog --- smcroute-2.4.4/debian/changelog 2021-02-25 13:28:54.000000000 +0100 +++ smcroute-2.4.4/debian/changelog 2021-03-01 09:22:50.000000000 +0100 @@ -1,7 +1,27 @@ +smcroute (2.4.4-3) unstable; urgency=medium + + * debian/tests: Skip multicast cache tests on systems without multicast + capable interfaces. + + -- Micha Lenk <mi...@debian.org> Mon, 01 Mar 2021 09:22:50 +0100 + +smcroute (2.4.4-2) unstable; urgency=medium + + * debian/changelog: Mark bug #952418 as closed in 2.4.4-1 + * Add sd_notify.patch teaching smcrouted to call sd_notify() when up and + running. This fixes the systemd race condition that causes CI tests to fail + on slow systems (closes: #924361). + * autopkgtests: daemon-init-scripts: Revert the sleeps that were trying to + "make tricky operations succeed". This is now fixed properly (see above). + * Add build dependency on libsystemd-dev. + + -- Micha Lenk <mi...@debian.org> Sun, 28 Feb 2021 16:30:39 +0100 + smcroute (2.4.4-1) unstable; urgency=medium [ Adrien ] - * Remove invalid comma in "After" list of systemd service file. + * Remove invalid comma in "After" list of systemd service file (closes: + #952418). [ Micha Lenk ] * New upstream version 2.4.4. diff -Nru smcroute-2.4.4/debian/control smcroute-2.4.4/debian/control --- smcroute-2.4.4/debian/control 2021-02-25 12:27:21.000000000 +0100 +++ smcroute-2.4.4/debian/control 2021-03-01 09:22:50.000000000 +0100 @@ -3,7 +3,11 @@ Priority: optional Maintainer: Micha Lenk <mi...@debian.org> Uploaders: Joachim Nilsson <troglo...@gmail.com> -Build-Depends: debhelper-compat (= 13), libcap-dev, systemd, pkg-config +Build-Depends: debhelper-compat (= 13), + libcap-dev [!kfreebsd-any], + libsystemd-dev [!kfreebsd-any], + pkg-config, + systemd [!kfreebsd-any] Standards-Version: 4.5.1 Homepage: http://troglobit.com/smcroute.html Vcs-Browser: https://salsa.debian.org/debian/smcroute diff -Nru smcroute-2.4.4/debian/patches/sd_notify.patch smcroute-2.4.4/debian/patches/sd_notify.patch --- smcroute-2.4.4/debian/patches/sd_notify.patch 1970-01-01 01:00:00.000000000 +0100 +++ smcroute-2.4.4/debian/patches/sd_notify.patch 2021-02-28 16:41:59.000000000 +0100 @@ -0,0 +1,113 @@ +Author: Micha Lenk <mi...@debian.org> +Summary: Switch to systemd service type 'notify' for synchronous service management + By calling sd_notify() the smcroute daemon (smcrouted) can tell the systemd + service manager when it is fully up and running. This allows systemd to manage + services synchronously (service type 'notify') so that dependent tasks can + rely on smcrouted being fully up and running. +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=924361 +Forwarded-Upstream: no +Last-Update: 2021-02-28 + +diff --git a/src/Makefile.am b/src/Makefile.am +index ae2bcdc..51d24af 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -30,3 +30,7 @@ if USE_DOTCONF + smcrouted_SOURCES += conf.c conf.h + endif + ++if HAVE_LIBSYSTEMD ++smcrouted_CFLAGS += $(LIBSYSTEMD_CFLAGS) ++smcrouted_LDADD += $(LIBSYSTEMD_LIBS) ++endif +diff --git a/src/smcrouted.c b/src/smcrouted.c +index 74076c6..d87e242 100644 +--- a/src/smcrouted.c ++++ b/src/smcrouted.c +@@ -23,12 +23,17 @@ + #include <errno.h> + #include <getopt.h> + #include <stdio.h> ++#include <stdbool.h> + #include <signal.h> + #include <unistd.h> + #include <arpa/inet.h> + #include <sys/time.h> /* gettimeofday() */ + #include <sys/un.h> + ++#if HAVE_LIBSYSTEMD ++#include <systemd/sd-daemon.h> ++#endif ++ + #include "cap.h" + #include "ipc.h" + #include "log.h" +@@ -136,13 +141,31 @@ static int server_loop(void) + { + script_init(script); + mrdisc_init(interval); ++#if HAVE_LIBSYSTEMD ++ bool need_sd_notify_ready = true; ++#endif + + while (running) { + if (reloading) { ++#if HAVE_LIBSYSTEMD ++ sd_notify(0, "RELOADING=1\n" ++ "STATUS=Reloading configuration...\n"); ++ need_sd_notify_ready = true; ++#endif ++ + reload(); + reloading = 0; + } + ++ ++#if HAVE_LIBSYSTEMD ++ if (need_sd_notify_ready) { ++ sd_notify(0, "READY=1\n" ++ "STATUS=Configuration loaded.\n"); ++ need_sd_notify_ready = false; ++ } ++#endif ++ + socket_poll(NULL); + } + +diff --git a/configure.ac b/configure.ac +index bafccfa..7514e97 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -106,6 +106,17 @@ AS_IF([test "x$with_systemd" != "xno"], + [AC_SUBST([systemddir], [$with_systemd])]) + AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemd" != "xno"]) + ++have_libsystemd=no ++AS_IF([test "x$with_systemd" != "xno"], ++ [PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd, ++ [AC_DEFINE(HAVE_LIBSYSTEMD, 1, [Enable libsystemd integration]) ++ have_libsystemd=yes])] ++) ++AS_IF([test "x$have_libsystemd" = "xyes"], ++ [AC_SUBST([systemd_service_type], [notify])], ++ [AC_SUBST([systemd_service_type], [simple])]) ++AM_CONDITIONAL([HAVE_LIBSYSTEMD], [test "x$have_libsystemd" = "xyes"]) ++ + # Check if we need -lpthread (building statically) and -lrt (older GLIBC) + # Unset cached values when retrying with -lpthread and reset LIBS for each API + need_librt=no +diff --git a/smcroute.service.in b/smcroute.service.in +index 910f486..42fdb0e 100644 +--- a/smcroute.service.in ++++ b/smcroute.service.in +@@ -8,8 +8,9 @@ After=network-online.target + Requires=network-online.target + + [Service] +-Type=simple ++Type=@systemd_service_type@ + ExecStart=@SBINDIR@/smcrouted -n -s ++NotifyAccess=main + + # Hardening settings + NoNewPrivileges=true diff -Nru smcroute-2.4.4/debian/patches/series smcroute-2.4.4/debian/patches/series --- smcroute-2.4.4/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ smcroute-2.4.4/debian/patches/series 2021-02-28 16:30:22.000000000 +0100 @@ -0,0 +1 @@ +sd_notify.patch diff -Nru smcroute-2.4.4/debian/rules smcroute-2.4.4/debian/rules --- smcroute-2.4.4/debian/rules 2021-02-25 12:27:21.000000000 +0100 +++ smcroute-2.4.4/debian/rules 2021-03-01 09:22:50.000000000 +0100 @@ -6,14 +6,20 @@ export DEB_CFLAGS_MAINT_APPEND = -Werror -ggdb export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Determine whether or not to build with libcap depending on architecture +extraconfflags = --with-systemd --with-libcap +include /usr/share/dpkg/architecture.mk +ifeq (kfreebsd,$(DEB_HOST_ARCH_OS)) +extraconfflags = --without-systemd --without-libcap +endif + %: dh $@ override_dh_auto_configure: dh_auto_configure -- \ --bindir=/usr/sbin \ - --with-systemd \ - --with-libcap \ + $(extraconfflags) \ --enable-mrdisc override_dh_auto_install: diff -Nru smcroute-2.4.4/debian/tests/daemon-init-scripts smcroute-2.4.4/debian/tests/daemon-init-scripts --- smcroute-2.4.4/debian/tests/daemon-init-scripts 2021-02-25 13:18:44.000000000 +0100 +++ smcroute-2.4.4/debian/tests/daemon-init-scripts 2021-03-01 08:57:12.000000000 +0100 @@ -15,32 +15,28 @@ pass($startup); # Verify that smcroute is running -my $initial_smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcroute'; chomp $initial_smcroute_pid; +my $initial_smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcrouted'; chomp $initial_smcroute_pid; is $EXITVAL, 0, "smcroute is running".( $EXITVAL ? '' : " (pid $initial_smcroute_pid)" ); # Try to stop the daemon my $stop_output = capture EXIT_ANY, INIT_SCRIPT, 'stop'; is $EXITVAL, 0, "stopping smcroute"; -my $smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcroute'; chomp $smcroute_pid; +my $smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcrouted'; chomp $smcroute_pid; is $EXITVAL, 1, "smcroute is really stopped".( $EXITVAL ? '' : " (pid $smcroute_pid)" ); my $double_stop_output = capture EXIT_ANY, INIT_SCRIPT, 'stop'; is $EXITVAL, 0, "stopping smcroute twice in a row"; -$smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcroute'; chomp $smcroute_pid; +$smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcrouted'; chomp $smcroute_pid; is $EXITVAL, 1, "smcroute is really stopped".( $EXITVAL ? '' : " (pid $smcroute_pid)" ); # Try to start the daemon again -sleep(1); my $start_output = capture EXIT_ANY, INIT_SCRIPT, 'start'; is $EXITVAL, 0, "starting smcroute"; -sleep(1); -my $new_smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcroute'; chomp $new_smcroute_pid; +my $new_smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcrouted'; chomp $new_smcroute_pid; is $EXITVAL, 0, "smcroute is really running".( $EXITVAL ? '' : " (pid $new_smcroute_pid)" ); isnt $new_smcroute_pid, $initial_smcroute_pid, "smcroute pid changed ($new_smcroute_pid != $initial_smcroute_pid)"; -sleep(1); my $double_start_output = capture EXIT_ANY, INIT_SCRIPT, 'start'; is $EXITVAL, 0, "starting smcroute twice in a row"; -sleep(1); -$smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcroute'; chomp $smcroute_pid; +$smcroute_pid = capture EXIT_ANY, 'pgrep', 'smcrouted'; chomp $smcroute_pid; is $EXITVAL, 0, "smcroute is really running".( $EXITVAL ? '' : " (pid $smcroute_pid)" ); diff -Nru smcroute-2.4.4/debian/tests/mr-cache-ipv4 smcroute-2.4.4/debian/tests/mr-cache-ipv4 --- smcroute-2.4.4/debian/tests/mr-cache-ipv4 2021-02-24 12:04:39.000000000 +0100 +++ smcroute-2.4.4/debian/tests/mr-cache-ipv4 2021-03-01 09:22:50.000000000 +0100 @@ -20,39 +20,42 @@ } # Verify that smcroute is running -my $smcroute_pid = capture( EXIT_ANY, 'pgrep', 'smcroute' ); +my $smcroute_pid = capture( EXIT_ANY, 'pgrep', 'smcrouted' ); chomp $smcroute_pid; is $EXITVAL, 0, "smcroute is running".( $EXITVAL ? '' : " (pid $smcroute_pid)" ); # Get a valid multicast interface my @interfaces = get_multicast_interfaces(); my $first_itf = $interfaces[0]; -ok @interfaces >= 1, "At least one multicast capable interface found: $first_itf" - or diag read_file(VIF_TABLE); - -# Verify that there are no multicast routes when we start -my @routes = get_multicast_routes(); -is @routes, 0, "Multicast routing cache is empty" - or diag read_file(MR_CACHE); - -# Add a multicast route -my $route_txt = MC_SENDER."->$first_itf->$first_itf->".MC_GROUP; -my $output = capture( EXIT_ANY, 'smcroute', '-a', $first_itf, MC_SENDER, MC_GROUP, $first_itf); -is $EXITVAL, 0, "adding multicast route $route_txt doesn't fail (return code: $EXITVAL)"; -is $output, '', "adding multicast route $route_txt doesn't generate any console output" - or diag "Unexpected output\n$output"; -@routes = get_multicast_routes(); -is @routes, 1, "Multicast routing cache now contains one entry"; -diag read_file(MR_CACHE); - -# Remove the multicast route again -$output = capture( EXIT_ANY, 'smcroute', '-r', $first_itf, MC_SENDER, MC_GROUP); -is $EXITVAL, 0, "removing multicast route $route_txt doesn't fail (return code: $EXITVAL)"; -is $output, '', "removing multicast route $route_txt doesn't generate any console output" - or diag "Unexpected output\n$output"; -@routes = get_multicast_routes(); -is @routes, 0, "Multicast routing cache is empty again" - or diag read_file(MR_CACHE); +SKIP: { + skip "No multicast capable interfaces found", 8 unless @interfaces >= 1; + pass "At least one multicast capable interface found: $first_itf"; + diag read_file(VIF_TABLE) unless @interfaces >= 1; + + # Verify that there are no multicast routes when we start + my @routes = get_multicast_routes(); + is @routes, 0, "Multicast routing cache is empty" + or diag read_file(MR_CACHE); + + # Add a multicast route + my $route_txt = MC_SENDER."->$first_itf->$first_itf->".MC_GROUP; + my $output = capture( EXIT_ANY, 'smcroute', '-a', $first_itf, MC_SENDER, MC_GROUP, $first_itf); + is $EXITVAL, 0, "adding multicast route $route_txt doesn't fail (return code: $EXITVAL)"; + is $output, '', "adding multicast route $route_txt doesn't generate any console output" + or diag "Unexpected output\n$output"; + @routes = get_multicast_routes(); + is @routes, 1, "Multicast routing cache now contains one entry"; + diag read_file(MR_CACHE); + + # Remove the multicast route again + $output = capture( EXIT_ANY, 'smcroute', '-r', $first_itf, MC_SENDER, MC_GROUP); + is $EXITVAL, 0, "removing multicast route $route_txt doesn't fail (return code: $EXITVAL)"; + is $output, '', "removing multicast route $route_txt doesn't generate any console output" + or diag "Unexpected output\n$output"; + @routes = get_multicast_routes(); + is @routes, 0, "Multicast routing cache is empty again" + or diag read_file(MR_CACHE); +}; #################################################################################### # sub routines diff -Nru smcroute-2.4.4/debian/tests/mr-cache-ipv6 smcroute-2.4.4/debian/tests/mr-cache-ipv6 --- smcroute-2.4.4/debian/tests/mr-cache-ipv6 2021-02-24 12:04:39.000000000 +0100 +++ smcroute-2.4.4/debian/tests/mr-cache-ipv6 2021-03-01 09:21:57.000000000 +0100 @@ -20,39 +20,42 @@ } # Verify that smcroute is running -my $smcroute_pid = capture( EXIT_ANY, 'pgrep', 'smcroute' ); +my $smcroute_pid = capture( EXIT_ANY, 'pgrep', 'smcrouted' ); chomp $smcroute_pid; is $EXITVAL, 0, "smcroute is running".( $EXITVAL ? '' : " (pid $smcroute_pid)" ); # Get a valid multicast interface my @interfaces = get_multicast_interfaces(); my $first_itf = $interfaces[0]; -ok @interfaces >= 1, "At least one multicast capable interface found: $first_itf" - or diag read_file(VIF_TABLE); - -# Verify that there are no multicast routes when we start -my @routes = get_multicast_routes(); -is @routes, 0, "Multicast routing cache is empty" - or diag read_file(MR_CACHE); - -# Add a multicast route -my $route_txt = MC_SENDER."->$first_itf->$first_itf->".MC_GROUP; -my $output = capture( EXIT_ANY, 'smcroute', '-a', $first_itf, MC_SENDER, MC_GROUP, $first_itf); -is $EXITVAL, 0, "adding multicast route $route_txt doesn't fail (return code: $EXITVAL)"; -is $output, '', "adding multicast route $route_txt doesn't generate any console output" - or diag "Unexpected output\n$output"; -@routes = get_multicast_routes(); -is @routes, 1, "Multicast routing cache now contains one entry"; -diag read_file(MR_CACHE); - -# Remove the multicast route again -$output = capture( EXIT_ANY, 'smcroute', '-r', $first_itf, MC_SENDER, MC_GROUP); -is $EXITVAL, 0, "removing multicast route $route_txt doesn't fail (return code: $EXITVAL)"; -is $output, '', "removing multicast route $route_txt doesn't generate any console output" - or diag "Unexpected output\n$output"; -@routes = get_multicast_routes(); -is @routes, 0, "Multicast routing cache is empty again" - or diag read_file(MR_CACHE); +SKIP: { + skip "No multicast capable interfaces found", 8 unless @interfaces >= 1; + pass "At least one multicast capable interface found: $first_itf"; + diag read_file(VIF_TABLE) unless @interfaces >= 1; + + # Verify that there are no multicast routes when we start + my @routes = get_multicast_routes(); + is @routes, 0, "Multicast routing cache is empty" + or diag read_file(MR_CACHE); + + # Add a multicast route + my $route_txt = MC_SENDER."->$first_itf->$first_itf->".MC_GROUP; + my $output = capture( EXIT_ANY, 'smcroute', '-a', $first_itf, MC_SENDER, MC_GROUP, $first_itf); + is $EXITVAL, 0, "adding multicast route $route_txt doesn't fail (return code: $EXITVAL)"; + is $output, '', "adding multicast route $route_txt doesn't generate any console output" + or diag "Unexpected output\n$output"; + @routes = get_multicast_routes(); + is @routes, 1, "Multicast routing cache now contains one entry"; + diag read_file(MR_CACHE); + + # Remove the multicast route again + $output = capture( EXIT_ANY, 'smcroute', '-r', $first_itf, MC_SENDER, MC_GROUP); + is $EXITVAL, 0, "removing multicast route $route_txt doesn't fail (return code: $EXITVAL)"; + is $output, '', "removing multicast route $route_txt doesn't generate any console output" + or diag "Unexpected output\n$output"; + @routes = get_multicast_routes(); + is @routes, 0, "Multicast routing cache is empty again" + or diag read_file(MR_CACHE); +}; #################################################################################### # sub routines ** Affects: smcroute (Ubuntu) Importance: Undecided Status: New ** Affects: smcroute (Debian) Importance: Unknown Status: Unknown -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1918260 Title: FFe: Sync smcroute 2.4.4-3 (universe) from Debian unstable (main) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/smcroute/+bug/1918260/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs