Your message dated Fri, 22 Jul 2016 22:52:53 +0000
with message-id <[email protected]>
and subject line Bug#798802: fixed in xorp 1.8.6~wip.20160715-1
has caused the Debian Bug report #798802,
regarding xorp: systemd integration using sd_notify
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
798802: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798802
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xorp
Version: 1.8.5-4.1
Severity: normal
Tags: patch
Usertags: systemd-units
X-Debbugs-CC: [email protected]

Dear Maintainer,

The attached patch incorporates systemd integration and notifications
via sd_notify to xorp_rtrmgr. It has been tested in a production router,
the tests were limited to the start, stop, restart and logging behaviour.

The patch also routes the log to the journal via stderr, therefore
eliminating the weekly restart performed by logrotate. That restart was
failing in a somewhat loaded router until the proposed changes where
applied. It was also found that the default output log setup was failing
to work with systemd and it was changed to a simple one which, as far as
I know, should be very portable.

The unit file was sent to the systemd maintainers for review and their
helpful directions have been followed.

I hope this patch can be useful.

Regards,


-- System Information:
Debian Release: 8.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=es_VE.UTF-8, LC_CTYPE=es_VE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages xorp depends on:
ii  adduser              3.113+nmu3
ii  init-system-helpers  1.22
ii  libc6                2.19-18+deb8u1
ii  libgcc1              1:4.9.2-10
ii  libncurses5          5.9+20140913-1+b1
ii  libpcap0.8           1.6.2-2
ii  libssl1.0.0          1.0.1k-3+deb8u1
ii  libstdc++6           4.9.2-10
ii  libsystemd0          215-17+deb8u2
ii  libtinfo5            5.9+20140913-1+b1

Versions of packages xorp recommends:
ii  iputils-ping       3:20121221-5+b2
ii  iputils-tracepath  3:20121221-5+b2
ii  traceroute         1:2.0.20-2+b1

xorp suggests no packages.

-- Configuration Files:
/etc/default/xorp changed [not included]
/etc/xorp/config.boot changed [not included]

-- no debconf information



-- 
Dhionel Díaz
Centro Nacional de Desarrollo e Investigación en Tecnologías Libres
Ministerio del Poder Popular para
Educación Universitaria, Ciencia y Tecnología
diff -u xorp-1.8.5/debian/control xorp-1.8.5/debian/control
--- xorp-1.8.5/debian/control
+++ xorp-1.8.5/debian/control
@@ -7,6 +7,7 @@
  scons, libboost-dev,
  autotools-dev, quilt, libssl-dev, 
  libncurses5-dev | ncurses-dev, docbook-to-man, libpcap0.8-dev,
+ dh-systemd, libsystemd-dev, pkg-config,
 Build-Conflicts: iptables-dev
 Standards-Version: 3.9.5
 Homepage: http://www.xorp.org
diff -u xorp-1.8.5/debian/patches/series xorp-1.8.5/debian/patches/series
--- xorp-1.8.5/debian/patches/series
+++ xorp-1.8.5/debian/patches/series
@@ -13,0 +14,2 @@
+default_log_output.patch
+sd_notify_rtrmgr.patch
diff -u xorp-1.8.5/debian/rules xorp-1.8.5/debian/rules
--- xorp-1.8.5/debian/rules
+++ xorp-1.8.5/debian/rules
@@ -22,11 +22,11 @@
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
-# Personall Variables
+# Personal Variables
 PACKNAME=$(shell dh_listpackages)
 PACKAGE=$(shell dh_listpackages)
 
-# Variabels used by the Debian Maintainer exclusively for package
+# Variables used by the Debian Maintainer exclusively for package
 # development.
 SOURCENAME=$(shell dpkg-parsechangelog | grep "Source:" | cut -d ' ' -f 2)
 DEBVER=$(shell dpkg-parsechangelog | grep "Version:" | cut -d ' ' -f 2)
@@ -57,6 +57,7 @@
 		sysconfdir=/etc \
 		with-olsr=true \
 		disable_fw=true \
+		enable_systemd=true \
 		CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS='-Wl,-z,defs'
 
 #SCONSFLAGS += CC=gcc-4.6 CXX=g++-4.6
@@ -165,7 +166,9 @@
 	dh_installdocs
 	dh_installexamples -pxorp rtrmgr/config/*.boot debian/config.boot.mcast  rtrmgr/config/README
 	dh_installlogrotate
+	dh_systemd_enable
 	dh_installinit
+	dh_systemd_start
 	dh_installman 
 	dh_link
 	dh_strip
diff -u xorp-1.8.5/debian/xorp.postinst xorp-1.8.5/debian/xorp.postinst
--- xorp-1.8.5/debian/xorp.postinst
+++ xorp-1.8.5/debian/xorp.postinst
@@ -41,6 +41,7 @@
 	        --system \
 		--ingroup $XORPGROUP \
 		--no-create-home \
+		--home $LOGDIR \
 		--disabled-password \
 		$XORPUSER 2>/dev/null || true
 	fi
only in patch2:
unchanged:
--- xorp-1.8.5.orig/debian/patches/default_log_output.patch
+++ xorp-1.8.5/debian/patches/default_log_output.patch
@@ -0,0 +1,34 @@
+Description: Simplify and fix default log output setup.
+Author: Dhionel Díaz <[email protected]>
+Last-Update: 2015-09-09
+
+---
+--- a/libxorp/xlog.c
++++ b/libxorp/xlog.c
+@@ -798,24 +798,8 @@
+ 	return (xlog_add_output(fp));
+ 
+ #else /* !HOST_OS_WINDOWS */
+-
+-    const char* defaults[] = {	/* The default outputs (in preference order) */
+-	"/dev/stderr",		/* XXX: temporary this is the default */
+-	"/dev/console",
+-	"/dev/stdout"
+-    };
+-    size_t ndefaults = sizeof(defaults) / sizeof(defaults[0]);
+-    size_t i;
+-
+-    /*
+-     * Attempt to open default output stream, console first in case
+-     * we are root, then stderr.
+-     */
+-    for (i = 0; fp_default == NULL && i < ndefaults; i++) {
+-	if ((fp_default = fopen(defaults[i], "w")) != NULL) {
+-	    return (xlog_add_output(fp_default));
+-	}
+-    }
++    if((fp_default = fdopen(dup(STDERR_FILENO), "w")) != NULL)
++	return (xlog_add_output(fp_default));
+ #endif /* HOST_OS_WINDOWS */
+ 
+     return -1;
only in patch2:
unchanged:
--- xorp-1.8.5.orig/debian/patches/sd_notify_rtrmgr.patch
+++ xorp-1.8.5/debian/patches/sd_notify_rtrmgr.patch
@@ -0,0 +1,104 @@
+Description: Add support to systemd integration via status notifications
+Author: Dhionel Díaz <[email protected]>
+Last-Update: 2015-09-10
+
+---
+--- a/rtrmgr/main_rtrmgr.cc
++++ b/rtrmgr/main_rtrmgr.cc
+@@ -65,6 +65,9 @@
+ #include <getopt.h>
+ #endif
+ 
++#ifdef XORP_USE_SYSTEMD
++#include <systemd/sd-daemon.h>
++#endif
+ 
+ //
+ // Default values
+@@ -358,6 +361,11 @@
+ 	}
+ 
+ 	_ready = true;
++#ifdef XORP_USE_SYSTEMD
++	// Notify systemd that service startup has been successfully completed
++	sd_notify(0, "READY=1\n"
++		"STATUS=Startup successfully completed.");
++#endif
+ 	//
+ 	// Loop while handling configuration events and signals
+ 	//
+@@ -369,6 +377,11 @@
+ 	}
+ 	fflush(stdout);
+ 	_ready = false;
++#ifdef XORP_USE_SYSTEMD
++	// Notify systemd that the service is beginning its shutdown
++	sd_notify(0, "STOPPING=1\n"
++		"STATUS=Shutdown process started.");
++#endif
+ 
+ 	//
+ 	// Shutdown everything
+@@ -782,5 +795,9 @@
+     xlog_stop();
+     xlog_exit();
+ 
++#ifdef XORP_USE_SYSTEMD
++	// Send final status message to systemd
++	sd_notify(0, "STATUS=Exiting.");
++#endif
+     exit(errcode);
+ }
+--- a/SConstruct
++++ b/SConstruct
+@@ -83,6 +83,7 @@
+     BoolVariable('disable_profile',  'Disable Xorp Profiler feature', False),
+     BoolVariable('enable_boost',  'Use BOOST', False),
+     BoolVariable('enable_ustl',  'Use uSTL', False),
++    BoolVariable('enable_systemd',  'Use systemd', False),
+     BoolVariable('enable_bgp',  'Build BGP', True),
+     BoolVariable('enable_buildinfo',  'Build Info, see libxorp/create_buildinfo.sh', True),
+     BoolVariable('enable_olsr',  'Build OLSR', True),
+@@ -274,6 +275,7 @@
+ print 'Enable BuildInfo: ', env['enable_buildinfo']
+ print 'Try Enable BOOST: ', env['enable_boost']
+ print 'Try Enable uSTL : ', env['enable_ustl']
++print 'Try Enable systemd: ', env['enable_systemd']
+ print 'Disable IPv6:     ', env['disable_ipv6']
+ print 'Disable libtecla: ', env['disable_libtecla']
+ print 'Disable Firewall: ', env['disable_fw']
+@@ -396,6 +398,12 @@
+ else:
+     env['enable_ustl'] = False
+ 
++tst = ARGUMENTS.get('enable_systemd', False)
++if tst and not (tst == "no"):
++    env['enable_systemd'] = True
++else:
++    env['enable_systemd'] = False
++
+ tst = ARGUMENTS.get('enable_tests', False)
+ if tst and not (tst == "no"):
+     env['enable_tests'] = True
+@@ -654,6 +662,9 @@
+         #  so just over-ride it here and assume it exists.
+         conf.Define('HAS_BOOST_NONCOPYABLE_INC')
+ 
++    if env['enable_systemd']:
++        conf.Define('XORP_USE_SYSTEMD')
++
+     # Big ball of mud.
+     from config.allconfig import DoAllConfig
+     DoAllConfig(env, conf, host_os)
+--- a/rtrmgr/SConscript
++++ b/rtrmgr/SConscript
+@@ -175,6 +175,9 @@
+ 
+     rtrmgr_env.Append(LIBS = ['xorp_core', 'crypto'])
+ 
++if rtrmgr_env['enable_systemd']:
++    rtrmgr_env.ParseConfig("pkg-config --cflags --libs libsystemd")
++
+ 
+ rtrmgr_srcs = [
+ 	'main_rtrmgr.cc',
only in patch2:
unchanged:
--- xorp-1.8.5.orig/debian/xorp.service
+++ xorp-1.8.5/debian/xorp.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=eXtensible Open Router Platform
+After=network.target
+
+[Service]
+Type=notify
+EnvironmentFile=-/etc/default/xorp
+ExecStart=/usr/sbin/xorp_rtrmgr $DAEMON_OPTS
+TimeoutStopSec=233
+Restart=always
+
+[Install]
+WantedBy=multi-user.target


Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Source: xorp
Source-Version: 1.8.6~wip.20160715-1

We believe that the bug you reported is fixed in the latest version of
xorp, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jose M Calhariz <[email protected]> (supplier of updated xorp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 22 Jul 2016 22:18:18 +0100
Source: xorp
Binary: xorp
Architecture: source
Version: 1.8.6~wip.20160715-1
Distribution: unstable
Urgency: low
Maintainer: Jose M Calhariz <[email protected]>
Changed-By: Jose M Calhariz <[email protected]>
Description:
 xorp       - eXtensible Open Router Platform
Closes: 798802 798902 811943 831429
Changes:
 xorp (1.8.6~wip.20160715-1) unstable; urgency=low
 .
   * New upstream release, (Closes: #811943)
   * Update email of Maintainer.
   * wrap-and-sort -at.
   * Bump Standards-Version 3.9.8 nothing changed.
   * Drop patches fea_mfea_mrouter.cc__build_with_gcc-4.7, use_cpp-4.6 and
     experimental_ftbfs_cpp-4.7 because they are no longer needed.
   * Fix lintian error
     maintainer-script-should-not-use-adduser-system-without-home.
   * Don't "scons -c" if file libxorp/build_info.cc don't exist.
   * xorp now Build-Depends on bison and flex.
   * Enable hardening build flags, thanks to Dhionel Díaz
     <[email protected]> for the patch to support CPPFLAGS.  (Closes:
     #798902).
   * Add support to systemd (Closes: #798802), thank you Dhionel Díaz for
     the patches.
   * Acknwoledge NMU, thank you Matthias Klose <[email protected]>.
   * Make build reproducible, (Closes: #831429).
   * Increase compat level to 9.
   * Drop old Buil-Depends on quilt.
   * Updated the list or support architectures, add pcc64el and replace
     s390 by s390x.
   * Drop patches accepted by upstream fix-return-void
     fix-route_table_ribin.cc-lookup_route-misleading-indentation
     fix-trie.hh-find-bounds-mislideading-indentation.
   * Disable -Werr and remove -Wno-error=*.
   * Removed obsolete READMEs.
   * Removed helper files for backport, gone obsolete.
   * Removed personal targets and variables from debian/rules.
Checksums-Sha1:
 99dd9a13d0997011b423c9e3486587394e487758 2172 xorp_1.8.6~wip.20160715-1.dsc
 0d86125028752dfcc300ed5014da975cf5f365ac 2611732 
xorp_1.8.6~wip.20160715.orig.tar.xz
 131ef6de2ba165677113637c733688e24ebc50e4 32716 
xorp_1.8.6~wip.20160715-1.debian.tar.xz
Checksums-Sha256:
 345566dbd777eb97ed4842b547e0c0e7af8bca9eb3d420adbbea7ba923934318 2172 
xorp_1.8.6~wip.20160715-1.dsc
 a9dfa199985a9a8e14beacc75f30d3a9ebd6906a3cc05db38a236c34002e25bd 2611732 
xorp_1.8.6~wip.20160715.orig.tar.xz
 3a3edc963c3a1c2c9b1b3f8fe97fba45d13358aeb6c9649c4f11bf593d6c766b 32716 
xorp_1.8.6~wip.20160715-1.debian.tar.xz
Files:
 1789687f183710c81a018856dfbf5cd3 2172 net extra xorp_1.8.6~wip.20160715-1.dsc
 009417e7d9bb9a696e57027b7ceec897 2611732 net extra 
xorp_1.8.6~wip.20160715.orig.tar.xz
 f4e4cf38910b6e4fa3e798e1dd94535d 32716 net extra 
xorp_1.8.6~wip.20160715-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJXkqIyAAoJEEsEP825REVACWsP/1JJ4qN46Ecx/SQyfx2fSr28
49qMKrgvPOb7OZDFh+NRwaBKQBo1RLpNUIHXcBS5EXEdWX4e5enQApzSGwfcEwqL
U0UPgAEHak+ykohqeGoxTD8wm1YVczTIzuPPD3cNVXOVBNTA+psjG6pt+xkj5IeI
H1c4yfe5ZPAWuXNoZFfdf5foPEfWtsO/isbflRZi+89jYcdRN8eLXLvEacX7yBJc
mNQBpVgQsPiezwKXE0PdPu6V1BMtjHzGZXD+OYpTIq/gu5Lf4Wt/9OwBDDQz7y6Q
GnzSGlzaHuWJbMxCQXlLMezfaC1Cn0oboWVe+nAnsZCvH5RzMC1zNtVjTsMATACj
or1mI8UpbsVPiCxX3fHE7H94mLQhDE31xZF7DSO58HSGVuqVvvGNVOyWkZ8oNfUT
csFAdhACLGCSXm+liMYZtfJjOJuG+o5smMS3AGP4gwDEz3AnjhVKfEcEgy4R7cxV
qqYXEzOiw+Q+0l1Obe5U8nHayDrPottU0gmSkW9dAXD9abnKWP4JA7NQQZI44WYP
sqUb5D7X9QQOAJZSyuTzepwsUjvdWpoXKOSTMKMHJSRVHvkAHkHZNwQKUsedo7pr
8UfKmhVNC6DPFx9HjPsjLd8dzbHOS9TfGNEcOeCnD8WRAbqxqo2+IlGnRaiEHjEK
cjDmjOecwDBHGL/hw2eh
=HpeA
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to