initscript: start with -pidfile for systemd to detect it is running [release 2.3.15-3mamba;Sat Apr 13 2013]

This commit is contained in:
Silvan Calarco 2024-01-05 19:43:01 +01:00
parent f0d47137ec
commit a44540545a
4 changed files with 198 additions and 0 deletions

View File

@ -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.

15
xinetd-conf Normal file
View File

@ -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

56
xinetd-initscript Normal file
View File

@ -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

125
xinetd.spec Normal file
View File

@ -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 <silvan.calarco@mambasoft.it>
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 <silvan.calarco@mambasoft.it> 2.3.15-3mamba
- initscript: start with -pidfile for systemd to detect it is running
* Sat May 12 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.15-2mamba
- restart service on upgrade; fixes some specfile oldies
* Thu May 10 2012 Automatic Build System <autodist@mambasoft.it> 2.3.15-1mamba
- automatic version update by autodist
* Sun Dec 27 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.14-3mamba
- rebuilt to remove executable requirements
* Tue Jun 03 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.14-2mamba
- specfile updated
* Thu Dec 01 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.14-1qilnx
- update to version 2.3.14 by autospec
* Mon Nov 29 2004 Silvan Calarco <silvan.calarco@qiinux.it> 2.3.13-2qilnx
- added tcp_wrapper requirement
- don't start service on install, just chkconfig it
* Fri Mar 12 2004 Davide Madrisan <davide.madrisan@qiinux.it> 2.3.13-1qilnx
- updated specfile and init file
- new version rebuild
* Tue Dec 02 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.12-1qilnx
- new version rebuild
- fixed initscript reload
* Fri May 24 2003 Silvan Calarco <silvan.calarco@qinet.it>
- fixed configuration and initscripts to make it work correctly
* Tue Apr 17 2003 Luca Tinelli <luca.tinelli@qinet.it>
- first build