Bug#660569: leafnode: please migrate away from update-inetd to reconf-inetd as per DEP9

2013-03-25 Thread Serafeim Zanikolas
Control: tag -1 +patch
Control: severity -1 normal
Control: affects 638791 +leafnode

Hi,

Please find attached a patch for migrating your package to reconf-inetd, as
per dep9 [0], in order to eliminate cross-package issues such as #168847.

I'll be happy to answer any questions.

cheers,
sez

[0] http://dep.debian.net/deps/dep9/#index5h1

--
Every great idea is worthless without someone to do the work. --Neil Williams
commit 8b9b33eb0218b54858f574bde051182fdfe712af
Author: Serafeim Zanikolas s...@debian.org
Date:   Sun Mar 24 20:23:40 2013 +0100

inetd.conf entry: migrate away from inetd-conf to reconf-inetd

diff --git a/debian/control b/debian/control
index 9234722..9a89114 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Architecture: any
 Provides: news-transport-system
 Conflicts: news-transport-system, newsx
 Depends: netbase, tcpd, logrotate, openbsd-inetd | inet-superserver,
- ${shlibs:Depends}, ${misc:Depends}
+ reconf-inetd, ${shlibs:Depends}, ${misc:Depends}
 Suggests: slrn | news-reader, ${perl:Depends} 
 Description: NNTP server for small leaf sites
  Leafnode is a news server suitable for small, limited-bandwidth sites 
diff --git a/debian/leafnode.dirs b/debian/leafnode.dirs
index 594cce4..1f3b714 100644
--- a/debian/leafnode.dirs
+++ b/debian/leafnode.dirs
@@ -12,3 +12,4 @@ usr/share/man/man1
 usr/share/man/man8
 usr/share/leafnode
 usr/share/bug
+usr/share/reconf-inetd
diff --git a/debian/leafnode.postinst b/debian/leafnode.postinst
index f7982bb..78e64ab 100644
--- a/debian/leafnode.postinst
+++ b/debian/leafnode.postinst
@@ -188,6 +188,29 @@ NETWORK=permanent\\  /etc/news/leafnode/debian-config  /etc/news/leafnode/deb
 			${TEXPIRE} -r
 		fi
 	fi
+#
+# This enables leafnode in inetd.conf, by removing the line using
+# update-inetd and adding it with reconf-inetd. Assuming that the switch
+# happens in jessie, this whole snippet can be dropped in jessie+1.
+#
+# the exact inetd.conf entry, as previously added using update-inetd
+OLD_INETD_ENTRY=nntp   stream  tcp nowait  news/usr/sbin/tcpd  /usr/sbin/leafnode
+# last package release before switching to reconf-inetd
+REL=2.0.0.alpha20090406a-1
+
+# remove inetd.conf entry if not modified locally, and not managed
+# already by reconf-inetd
+if dpkg --compare-versions $2 le-nl $REL; then
+if fgrep -qx $OLD_INETD_ENTRY /etc/inetd.conf || \
+   fgrep -qx #off# $OLD_INETD_ENTRY /etc/inetd.conf;
+then
+# remove all inetd.conf entries for leafnode
+update-inetd --pattern leafnode --remove nntp || true
+# re-add entries that are managed by reconf-inetd
+reconf-inetd || true
+fi
+fi
+
 fi
 
 # Old versions had this line wrong in the config file. Correct.
@@ -197,13 +220,7 @@ if grep -q maxcount /etc/news/leafnode/config; then
 	rm -f /etc/news/leafnode/config.new
 fi
 
-#
-# This enables leafnode in inetd.conf, so save for last.
-#
 
-update-inetd --comment-chars #disabled# --disable nntp
-update-inetd --group MAIL --add --comment-chars #disabled# \
-	nntp   stream  tcp nowait  news /usr/sbin/tcpd /usr/sbin/leafnode
 
 if [ $1 = purge ]; then
db_purge || true
diff --git a/debian/leafnode.postrm b/debian/leafnode.postrm
index d00d93a..a06a547 100644
--- a/debian/leafnode.postrm
+++ b/debian/leafnode.postrm
@@ -41,8 +41,6 @@ case $1 in
 	fi
   ;;
   remove)
-   update-inetd --remove .*leafnode.*
-   update-inetd --comment-chars #disabled# --enable nntp
   ;;
   upgrade|deconfigure)
   ;;
diff --git a/debian/reconf-inetd/leafnode.tcp b/debian/reconf-inetd/leafnode.tcp
new file mode 100644
index 000..3c509ea
--- /dev/null
+++ b/debian/reconf-inetd/leafnode.tcp
@@ -0,0 +1,9 @@
+service nntp
+{
+	socket_type = stream
+	protocol = tcp
+	wait = no
+	user = news
+	server = /usr/sbin/tcpd
+	server_args = /usr/sbin/leafnode
+}
diff --git a/debian/reconf-inetd/leafnode.tcp6 b/debian/reconf-inetd/leafnode.tcp6
new file mode 100644
index 000..dc6b950
--- /dev/null
+++ b/debian/reconf-inetd/leafnode.tcp6
@@ -0,0 +1,9 @@
+service nntp
+{
+	socket_type = stream
+	protocol = tcp6
+	wait = no
+	user = news
+	server = /usr/sbin/tcpd
+	server_args = /usr/sbin/leafnode
+}
diff --git a/debian/rules b/debian/rules
index 0d70ec1..9a86053 100755
--- a/debian/rules
+++ b/debian/rules
@@ -57,6 +57,7 @@ binary-arch: build
 	(cd debian/leafnode/usr/share/doc/leafnode/examples ; ln -s ../../../leafnode/config.example . )
 	mv debian/leafnode/usr/share/man/man5/moderators.5 debian/leafnode/usr/share/man/man5/leafnode-moderators.5
 	touch debian/leafnode/etc/news/leafnode/local.groups
+	cp debian/reconf-inetd/leafnode.tcp debian/reconf-inetd/leafnode.tcp6 debian/leafnode/usr/share/reconf-inetd
 	dh_installmenu
 	dh_installdebconf
 	dh_installcron


Bug#660569: leafnode: please migrate away from update-inetd to reconf-inetd as per DEP9

2012-04-22 Thread Serafeim Zanikolas
Hi Robert,

On Mon, Apr 09, 2012 at 09:56:44AM +0200, Serafeim Zanikolas wrote [edited]:
 Thanks for the effort! Unfortunately reconf-inetd does not support yet tcpd(8)
 (as mentioned in the reconf-inetd README file), and I see that leafnode is
 meant to be configured with tcpd.

I've added support for tcpd-enabled entries in reconf-inetd. Please check out
the updated manpage and give it another try sometime.

-- 
Every great idea is worthless without someone to do the work. --Neil Williams



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#660569: leafnode: please migrate away from update-inetd to reconf-inetd as per DEP9

2012-04-09 Thread Serafeim Zanikolas
block 660569 668140
thanks

Hi Robert,

On Sat, Apr 07, 2012 at 09:33:16AM +0200, Robert Grimm wrote:
 On Sun, 19 February 2012, you wrote:
  I've developed a replacement of update-inetd that fixes these issues. The
  replacement is called reconf-inetd and is documented in DEP9.
  
  Please consult the section below on how to migrate away from update-inetd.
  I'd be happy to provide a patch if that would speed up things.
 
 I tried to migrate during the last days, but to no avail. I would
 be glad if you could provide a patch or more explicit documentation.
 
 I'm not sure what I've done wrong.

Thanks for the effort! Unfortunately reconf-inetd does not support yet tcpd(8)
(as mentioned in the reconf-inetd README file), and I see that leafnode is
meant to be configured with tcpd.

I've opened a bug report for tcpd support, and made it a blocker for the
leafnode transition.

Cheers,
sez

-- 
Every great idea is worthless without someone to do the work. --Neil Williams



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#660569: leafnode: please migrate away from update-inetd to reconf-inetd as per DEP9

2012-04-07 Thread Robert Grimm
On Sun, 19 February 2012, you wrote:
 I've developed a replacement of update-inetd that fixes these issues. The
 replacement is called reconf-inetd and is documented in DEP9.
 
 Please consult the section below on how to migrate away from update-inetd.
 I'd be happy to provide a patch if that would speed up things.

I tried to migrate during the last days, but to no avail. I would
be glad if you could provide a patch or more explicit documentation.

I'm not sure what I've done wrong.

TIA,
Robert


signature.asc
Description: Digital signature


Bug#660569: leafnode: please migrate away from update-inetd to reconf-inetd as per DEP9

2012-02-27 Thread Robert Grimm
On Mon, 20 February 2012, you wrote:
  As you might know, update-inetd has issues that cause cross-package bugs, 
  eg.
  #168847. leafnode relies on update-inetd and has been hit before by such
  bugs.

I will try reconf-inetd later this week.

 btw the leafnode-specific bug is #638791.
 
Thanks,
Rob


signature.asc
Description: Digital signature


Bug#660569: leafnode: please migrate away from update-inetd to reconf-inetd as per DEP9

2012-02-19 Thread Serafeim Zanikolas
Package: leafnode
Severity: wishlist

Hi,

As you might know, update-inetd has issues that cause cross-package bugs, eg.
#168847. leafnode relies on update-inetd and has been hit before by such
bugs.

I've developed a replacement of update-inetd that fixes these issues. The
replacement is called reconf-inetd and is documented in DEP9.

Please consult the section below on how to migrate away from update-inetd.
I'd be happy to provide a patch if that would speed up things.

http://dep.debian.net/deps/dep9/#index5h1

cheers,
sez



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#660569: leafnode: please migrate away from update-inetd to reconf-inetd as per DEP9

2012-02-19 Thread Serafeim Zanikolas
 As you might know, update-inetd has issues that cause cross-package bugs, eg.
 #168847. leafnode relies on update-inetd and has been hit before by such
 bugs.

btw the leafnode-specific bug is #638791.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org