From a73ddd6fe297cf42469148a46953ad3486309a81 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Mon, 26 Nov 2007 22:15:14 +0100 Subject: [PATCH] prepare the lets be a superserver release. --- debian/changelog | 22 ++++++++++++++++++++++ debian/control | 6 ++++-- debian/xinetd.defaults | 3 +++ debian/xinetd.init | 24 ++++++++++++++---------- debian/xinetd.postinst | 35 +++-------------------------------- debian/xinetd.postrm | 30 +++--------------------------- debian/xinetd.prerm | 7 +++---- 7 files changed, 52 insertions(+), 75 deletions(-) diff --git a/debian/changelog b/debian/changelog index a543f6c..f042642 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +xinetd (1:2.3.14-3) UNRELEASED; urgency=low + + [ The let's try to provide inet-superserver upload ] + + * debian/control: + + add Provides/Conflicts on inet-superserver. + + add dependency on update-inetd. + + add dependency on lsb-base. + + * maintainer scripts: + + preinst: remove diversion of /etc/init.d/inetd. + + other: don't touch /etc/init.d/inetd anymore. + + * debian/xinetd.defaults: enable inetd_compat mode, so that we can + legitimately provide inet-superserver. + + * debian/xinetd.init: + + support the new INETD_COMPAT option. + + be lsb. + + -- Pierre Habouzit Mon, 26 Nov 2007 21:53:25 +0100 + xinetd (1:2.3.14-2) unstable; urgency=low * Adopt package (Closes: 434357), thanks Thomas for your past work. diff --git a/debian/control b/debian/control index a22ebc1..feb91ff 100644 --- a/debian/control +++ b/debian/control @@ -3,14 +3,16 @@ Section: net Priority: extra Maintainer: Pierre Habouzit Standards-Version: 3.7.2 -Build-Depends: debhelper (>> 5.0.0), libwrap0-dev, autotools-dev +Build-Depends: debhelper (>> 5.0.0), libwrap0-dev, autotools-dev, lsb-base Vcs-Git: git://git.madism.org/git/xinetd.git Vcs-Browser: http://git.madism.org/?p=xinetd.git Homepage: www.xinetd.org Package: xinetd Architecture: any -Depends: ${shlibs:Depends}, netbase +Depends: ${shlibs:Depends}, netbase, update-inetd +Provides: inet-superserver +Conflicts: inet-superserver Recommends: sysklogd | system-log-daemon, logrotate Description: replacement for inetd with many enhancements xinetd has access control mechanisms, extensive logging capabilities, diff --git a/debian/xinetd.defaults b/debian/xinetd.defaults index 91aff5b..20a38e3 100644 --- a/debian/xinetd.defaults +++ b/debian/xinetd.defaults @@ -1,6 +1,9 @@ # Default settings for xinetd. This file is sourced by /bin/sh from # /etc/init.d/xinetd +# enable xinetd Inetd compat mode +INETD_COMPAT=Yes + # Options to pass to xinetd # # -stayalive comes by default : it can be removed if xinetd is expected diff --git a/debian/xinetd.init b/debian/xinetd.init index b7fc550..602f052 100644 --- a/debian/xinetd.init +++ b/debian/xinetd.init @@ -9,20 +9,24 @@ if test -f /etc/default/xinetd; then . /etc/default/xinetd fi - test -x /usr/sbin/xinetd || exit 0 +case "$INETD_COMPAT" in + [Yy]*) XINETD_OPTS="$XINETD_OPTS -inetd_compat";; + *);; +esac + checkportmap () { - if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then - if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then - echo - echo "WARNING: portmapper inactive - RPC services unavailable!" - echo " Commenting out or removing the RPC services from" - echo " the /etc/xinetd.conf file will remove this message." - echo + if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then + if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then + echo + echo "WARNING: portmapper inactive - RPC services unavailable!" + echo " Commenting out or removing the RPC services from" + echo " the /etc/xinetd.conf file will remove this message." + echo + fi fi - fi -} +} case "$1" in start) diff --git a/debian/xinetd.postinst b/debian/xinetd.postinst index b4fd5e9..5281388 100644 --- a/debian/xinetd.postinst +++ b/debian/xinetd.postinst @@ -1,40 +1,11 @@ #!/bin/sh -e -# xinetd postinst -# stop inetd and portmap -if [ -x /usr/sbin/inetd ]; then - start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid \ - --exec /usr/sbin/inetd -fi -if [ -x /sbin/portmap ]; then - start-stop-daemon --stop --quiet --oknodo --exec /sbin/portmap -fi - -# stop xinetd itself if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d xinetd stop + invoke-rc.d xinetd stop elif [ -x /etc/init.d/xinetd ]; then - /etc/init.d/xinetd stop >&2 + /etc/init.d/xinetd stop >&2 else - start-stop-daemon --quiet --stop --signal 3 --oknodo --exec /usr/sbin/xinetd + start-stop-daemon --quiet --stop --signal 3 --oknodo --exec /usr/sbin/xinetd fi -# divert inetd's init script -dpkg-divert --package xinetd --add --rename \ - --divert /etc/init.d/inetd.real /etc/init.d/inetd >&2 - -# make dummy /etc/init.d/inetd file -cat <<%EOF% >/etc/init.d/inetd -#!/bin/sh - -# /etc/init.d/inetd has been diverted by the xinetd package. -# The inetd service is provided by xinetd, which means inetd -# doesn't need to be run. -# -# See /etc/init.d/xinetd, or /etc/init.d/inetd.real. - -exit 0 -%EOF% -chmod 755 /etc/init.d/inetd - #DEBHELPER# diff --git a/debian/xinetd.postrm b/debian/xinetd.postrm index a3bb2df..8c3640f 100644 --- a/debian/xinetd.postrm +++ b/debian/xinetd.postrm @@ -1,31 +1,7 @@ #!/bin/sh -e -# xinetd postrm -case "$1" in - remove) - if [ ! -f "/etc/init.d/inetd.real" ]; then - echo "" - echo "WARNING: you don't have an init script for the original" - echo "inetd anymore! You may need to reinstall the netkit-inetd" - echo "package to get it back." - echo "" - fi - rm -f /etc/init.d/inetd - dpkg-divert --package xinetd --remove --rename --divert \ - /etc/init.d/inetd.real /etc/init.d/inetd - if [ -f "/etc/init.d/inetd.real" ]; then - if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d inetd start - elif [ -x /etc/init.d/inetd ]; then - /etc/init.d/inetd start - fi - fi - ;; - purge) - rm -f /etc/xinetd.conf* - rm -f /etc/default/xinetd - rm -rf /etc/xinetd.d/ - ;; -esac +if test "$1" = purge; then + rm -rf /etc/xinetd.d +fi #DEBHELPER# diff --git a/debian/xinetd.prerm b/debian/xinetd.prerm index ed09708..9c852d3 100644 --- a/debian/xinetd.prerm +++ b/debian/xinetd.prerm @@ -1,14 +1,13 @@ #!/bin/sh -e -# xinetd prerm if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d xinetd stop + invoke-rc.d xinetd stop elif [ -x /etc/init.d/xinetd ]; then - /etc/init.d/xinetd stop + /etc/init.d/xinetd stop fi if [ "$1" = "remove" ]; then - echo "Note: all inetd services have been terminated." + echo "Note: all inetd services have been terminated." fi #DEBHELPER# -- 2.20.1