* sync xinetd with main arch

This commit is contained in:
Alexander Baldeck 2019-12-20 16:05:32 +01:00
parent 2a5e750143
commit 16542efa96
6 changed files with 95 additions and 13 deletions

View File

@ -4,9 +4,9 @@
pkgname=xinetd
pkgver=2.3.15
pkgrel=5
pkgrel=6
pkgdesc="A secure replacement for inetd"
arch=('x86_64' 'powerpc64le')
arch=(x86_64 powerpc64le)
url="http://www.xinetd.org/"
license=('custom')
depends=('libtirpc')
@ -26,29 +26,29 @@ md5sums=('77358478fd58efa6366accae99b8b04c'
'b14615c73753ceffbcc96d5e08f3c18d')
prepare() {
cd $srcdir/$pkgname-$pkgver
cd $pkgname-$pkgver
sed -i "s#${prefix}/man#${prefix}/share/man#" configure
# fix #37310
# https://bugzilla.redhat.com/show_bug.cgi?id=1006100#c
patch -Np1 -i $srcdir/fix-CVE-2013-4342.patch
patch -Np1 -i "$srcdir"/fix-CVE-2013-4342.patch
}
build() {
cd $srcdir/$pkgname-$pkgver
./configure --build=$CHOST --prefix=/usr --sbindir=/usr/bin --without-libwrap
cd $pkgname-$pkgver
./configure --prefix=/usr --sbindir=/usr/bin --without-libwrap --build=${CHOST}
CFLAGS+=' -I/usr/include/tirpc' LDFLAGS+=' -ltirpc' make
}
package() {
cd $srcdir/$pkgname-$pkgver
make prefix=$pkgdir/usr DAEMONDIR=$pkgdir/usr/bin install
cd $pkgname-$pkgver
make prefix="$pkgdir/usr" DAEMONDIR="$pkgdir/usr/bin" install
install -Dm644 $srcdir/xinetd.conf $pkgdir/etc/xinetd.conf
install -Dm644 $srcdir/servers $pkgdir/etc/xinetd.d/servers
install -Dm644 $srcdir/services $pkgdir/etc/xinetd.d/services
install -Dm644 "$srcdir"/xinetd.conf "$pkgdir"/etc/xinetd.conf
install -Dm644 "$srcdir"/servers "$pkgdir"/etc/xinetd.d/servers
install -Dm644 "$srcdir"/services "$pkgdir"/etc/xinetd.d/services
# install systemd files
install -Dm644 $srcdir/xinetd.service $pkgdir/usr/lib/systemd/system/xinetd.service
install -Dm644 "$srcdir"/xinetd.service "$pkgdir"/usr/lib/systemd/system/xinetd.service
# install license
install -Dm644 COPYRIGHT $pkgdir/usr/share/licenses/$pkgname/COPYRIGHT
install -Dm644 COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/COPYRIGHT
}

10
xinetd/servers Normal file
View File

@ -0,0 +1,10 @@
service servers
{
type = INTERNAL UNLISTED
port = 9099
socket_type = stream
protocol = tcp
wait = no
disable = yes
only_from = 127.0.0.1
}

10
xinetd/services Normal file
View File

@ -0,0 +1,10 @@
service services
{
type = INTERNAL UNLISTED
port = 9098
socket_type = stream
protocol = tcp
wait = no
disable = yes
only_from = 127.0.0.1
}

38
xinetd/xinetd Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
PID=`pidof -o %PPID /usr/sbin/xinetd`
case "$1" in
start)
stat_busy "Starting xinetd"
[ -z "$PID" ] && /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
if [ $? -gt 0 ]; then
stat_fail
else
echo $PID > /var/run/xinetd.pid
add_daemon xinetd
stat_done
fi
;;
stop)
stat_busy "Stopping xinetd"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm -f /var/run/xinetd.pid
rm_daemon xinetd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0

14
xinetd/xinetd.conf Normal file
View File

@ -0,0 +1,14 @@
#
# /etc/xinetd.conf
#
defaults
{
instances = 60
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}
includedir /etc/xinetd.d

10
xinetd/xinetd.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=A secure replacement for inetd
After=network.target
[Service]
ExecStart=/usr/bin/xinetd -dontfork
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target