diff --git a/README.md b/README.md index 876ed0b..ca5f1e9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # xinetd +Xinetd is a powerful inetd replacement. Xinetd has access control mechanisms, extensive logging capabilities, the ability to make services available based on time, can place limits on the number of servers that can be started, and has a configurable defence mechanism to protect against port scanners, among other things. + diff --git a/xinetd-conf b/xinetd-conf new file mode 100644 index 0000000..eb199a6 --- /dev/null +++ b/xinetd-conf @@ -0,0 +1,15 @@ +# +# Simple configuration file for xinetd +# +# Some defaults, and include /etc/xinetd.d/ + +defaults +{ + instances = 60 + log_type = SYSLOG authpriv + log_on_success = HOST PID + log_on_failure = HOST + cps = 25 30 +} + +includedir /etc/xinetd.d diff --git a/xinetd-initscript b/xinetd-initscript new file mode 100644 index 0000000..4880a50 --- /dev/null +++ b/xinetd-initscript @@ -0,0 +1,56 @@ +#!/bin/bash +# +# xinetd This starts and stops xinetd. +# +# Begin $rc_base/init.d/xinetd +# Based on sysklogd script from LFS-3.1 and earlier. +# +# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org +# Modified by Silvan Calarco - silvan.calarco@qilinux.it +# +# chkconfig: 345 40 30 +# description: xinetd is a powerful replacement for inetd. \ +# xinetd has access control machanisms, extensive \ +# logging capabilities, the ability to make services \ +# available based on time, and can place \ +# limits on the number of servers that can be started, \ +# among other things. +# +# processname: /usr/sbin/xinetd +# config: /etc/xinetd.conf +# pidfile: /run/xinetd.pid + +source /etc/sysconfig/rc +source $rc_functions + +case "$1" in + start) + echo -n "Starting xinetd: " + loadproc /usr/sbin/xinetd -pidfile /run/xinetd.pid + echo + ;; + stop) + echo -n "Stopping xinetd: " + killproc /usr/sbin/xinetd + echo + ;; + reload) + echo -n "Reloading xinetd: " + reloadproc xinetd + echo + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + statusproc /usr/sbin/xinetd + ;; + *) + echo "Usage: $0 {start|stop|reload|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/xinetd diff --git a/xinetd.spec b/xinetd.spec new file mode 100644 index 0000000..cffcbfe --- /dev/null +++ b/xinetd.spec @@ -0,0 +1,125 @@ +Name: xinetd +Version: 2.3.15 +Summary: A better and secure replacement for inetd +Group: System/Servers +Release: 3mamba +License: BSD +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.xinetd.org/ +Source0: http://www.xinetd.org/xinetd-%{version}.tar.gz +Source1: xinetd-initscript +Source2: xinetd-etc.tar.bz2 +Source3: xinetd-conf +Provides: inetd +Prereq: /sbin/chkconfig +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libtirpc-devel +BuildRequires: libwrap-devel +## AUTOBUILDREQ-END +BuildRequires: tcp_wrappers +Obsoletes: inetd +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Requires: tcp_wrappers >= 7.6 + +%description +Xinetd is a powerful inetd replacement. Xinetd has access control mechanisms, extensive logging capabilities, the ability to make services available based on time, can place limits on the number of servers that can be started, and has a configurable defence mechanism to protect against port scanners, among other things. + +%prep +%setup -q -a 2 + +%build +export LDFLAGS=-ltirpc +%configure \ + --with-libwrap \ + --with-inet6 + +%make + +%install +test x"$RPM_BUILD_ROOT" != x/ && rm -rf "$RPM_BUILD_ROOT" +mkdir -p $RPM_BUILD_ROOT%{_initrddir} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d + +make install \ + prefix=$RPM_BUILD_ROOT%{_prefix} \ + DAEMONDIR=$RPM_BUILD_ROOT%{_sbindir} \ + MANDIR=$RPM_BUILD_ROOT%{_mandir} + +install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/xinetd +install -m 600 etc/xinetd.d/* $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d +install -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.conf + +%clean +test x"$RPM_BUILD_ROOT" != x/ && rm -rf "$RPM_BUILD_ROOT" + +%post +if [ $1 -eq 1 ]; then +# new install + chkconfig --add xinetd +fi +if [ $1 -gt 1 ]; then +# upgrade + service xinetd restart +fi +: + +%preun +if [ $1 -eq 0 ]; then +#erase + service xinetd stop + chkconfig --del xinetd +fi +: + +%files +%defattr(-, root, root) +%dir %{_sysconfdir}/xinetd.d +%config(noreplace) %{_sysconfdir}/xinetd.d/* +%config(noreplace) %{_sysconfdir}/xinetd.conf +%config %{_initrddir}/xinetd +%{_sbindir}/xinetd +%{_sbindir}/itox +%{_sbindir}/xconv.pl +%{_mandir}/*/* +%doc COPYRIGHT xinetd/sample.conf +%doc CHANGELOG README + +%changelog +* Sat Apr 13 2013 Silvan Calarco 2.3.15-3mamba +- initscript: start with -pidfile for systemd to detect it is running + +* Sat May 12 2012 Silvan Calarco 2.3.15-2mamba +- restart service on upgrade; fixes some specfile oldies + +* Thu May 10 2012 Automatic Build System 2.3.15-1mamba +- automatic version update by autodist + +* Sun Dec 27 2009 Silvan Calarco 2.3.14-3mamba +- rebuilt to remove executable requirements + +* Tue Jun 03 2008 Silvan Calarco 2.3.14-2mamba +- specfile updated + +* Thu Dec 01 2005 Silvan Calarco 2.3.14-1qilnx +- update to version 2.3.14 by autospec + +* Mon Nov 29 2004 Silvan Calarco 2.3.13-2qilnx +- added tcp_wrapper requirement +- don't start service on install, just chkconfig it + +* Fri Mar 12 2004 Davide Madrisan 2.3.13-1qilnx +- updated specfile and init file +- new version rebuild + +* Tue Dec 02 2003 Silvan Calarco 2.3.12-1qilnx +- new version rebuild +- fixed initscript reload + +* Fri May 24 2003 Silvan Calarco +- fixed configuration and initscripts to make it work correctly + +* Tue Apr 17 2003 Luca Tinelli +- first build