Package: dictd
Version: 1.12.1+dfsg-4
Severity: normal
Tags: patch

Dear Maintainer,

installing dictd on a clean sid chroot fails, since update-inetd was
upgraded from 4.45 to 4.46.
The root cause here is, that it is possible to install and use
update-inetd without installing some inetd package, which results in
update-inetd trying to access /etc/inetd.conf, which may not exist.

Up to update-inetd 4.45 this was silently ignored, but update-inetd
4.46 now checks the existence of /etc/inetd.conf and fails with non
null return code, if it does not exist.  I think that this change of
behavior is a bug in update-inetd (see #905964), but maybe it would be
a good idea to make dictd more robust against this issue by checking
for existence of /etc/inetd.conf before calling update-inetd.

The attached patch implements this.

This would repair the continous integration of my package ding, which
currently fails, because it isn't able to install dictd as a
prerequisite of a test case: https://ci.debian.net/packages/d/ding/

Greetings
Roland
diff --git a/debian/changelog b/debian/changelog
index 2646e91..651d80a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+dictd (1.12.1+dfsg-7.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Do not run update-inetd, if inetd.conf does not exist.  This is a
+    workaround to #905964.
+
+ -- Roland Rosenfeld <[email protected]>  Fri, 17 Aug 2018 13:12:01 +0200
+
 dictd (1.12.1+dfsg-7) unstable; urgency=medium
 
   * Add dependency on $network and $local_fs to init.d file (closes: #902408).
diff --git a/debian/dictd.postinst b/debian/dictd.postinst
index f9948f8..966df4e 100644
--- a/debian/dictd.postinst
+++ b/debian/dictd.postinst
@@ -23,14 +23,16 @@ updateRunMode()
     DICTD_ARGS=""
     . "$DEFAULTSFILE"
 
-    if [ "$RUN_MODE" = "inetd" ] ; then
-        # Add service to /etc/inetd.conf
-        update-inetd \
-            --group OTHER \
-            --add "dict\tstream\ttcp\tnowait\tdictd.dictd\t/usr/sbin/tcpd\t/usr/sbin/dictd $DICTD_ARGS --inetd"
-        update-inetd --enable dict
-    else
-        update-inetd --disable dict
+    if [ -f /etc/inetd.conf ] ; then
+	if [ "$RUN_MODE" = "inetd" ] ; then
+            # Add service to /etc/inetd.conf
+            update-inetd \
+		--group OTHER \
+		--add "dict\tstream\ttcp\tnowait\tdictd.dictd\t/usr/sbin/tcpd\t/usr/sbin/dictd $DICTD_ARGS --inetd"
+            update-inetd --enable dict
+	else
+            update-inetd --disable dict
+	fi
     fi
 }
 
diff --git a/debian/dictd.postrm b/debian/dictd.postrm
index f0477b4..fc16207 100644
--- a/debian/dictd.postrm
+++ b/debian/dictd.postrm
@@ -38,7 +38,7 @@ case "$1" in
         cleanupUcf
 
         # remove inetd entry
-        ! which update-inetd >/dev/null || update-inetd --remove "dict" || true
+        ! which update-inetd >/dev/null || ! [ -f /etc/inetd.conf ] || update-inetd --remove "dict" || true
 
         # remove user, group and home directory dictd
         deluser --remove-home dictd >/dev/null 2>&1 || true

Attachment: signature.asc
Description: PGP signature

Reply via email to