From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- net-nds/portmap/files/portmap-6.0-tcpd.patch | 18 +++++++++ net-nds/portmap/files/portmap.confd | 5 +++ net-nds/portmap/files/portmap.rc6 | 58 ++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 net-nds/portmap/files/portmap-6.0-tcpd.patch create mode 100644 net-nds/portmap/files/portmap.confd create mode 100644 net-nds/portmap/files/portmap.rc6 (limited to 'net-nds/portmap/files') diff --git a/net-nds/portmap/files/portmap-6.0-tcpd.patch b/net-nds/portmap/files/portmap-6.0-tcpd.patch new file mode 100644 index 000000000000..c6af8f8c80b4 --- /dev/null +++ b/net-nds/portmap/files/portmap-6.0-tcpd.patch @@ -0,0 +1,18 @@ +Enable compile without tcp-wrappers + +Patch by Timothy Redaelli + +http://bugs.gentoo.org/178242 + +--- portmap_6.0/pmap_check.c ++++ portmap_6.0/pmap_check.c +@@ -44,7 +44,9 @@ + #include + #include + #endif ++#ifdef HOSTS_ACCESS + #include ++#endif + #include + #include + diff --git a/net-nds/portmap/files/portmap.confd b/net-nds/portmap/files/portmap.confd new file mode 100644 index 000000000000..c2756c992b4a --- /dev/null +++ b/net-nds/portmap/files/portmap.confd @@ -0,0 +1,5 @@ +# /etc/conf.d/portmap: config file for /etc/init.d/portmap + +# Options for `portmap`. +# For a full list, just run `portmap -h`. +#PORTMAP_OPTS="-l" diff --git a/net-nds/portmap/files/portmap.rc6 b/net-nds/portmap/files/portmap.rc6 new file mode 100644 index 000000000000..e123f3df1e6f --- /dev/null +++ b/net-nds/portmap/files/portmap.rc6 @@ -0,0 +1,58 @@ +#!/sbin/openrc-run +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use net + before inetd + before xinetd +} + +checkconfig() { + if [ -e /proc/config.gz ] ; then + if zcat /proc/config.gz | grep -s SUNRPC_REGISTER_V4=y ; then + eerror "portmap does not work with SUNRPC_REGISTER_V4=y;" + eerror "disable it or use the net-nds/rpcbind package." + return 1 + fi + fi + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting portmap" + start-stop-daemon --start --quiet --exec /sbin/portmap -- ${PORTMAP_OPTS} + local ret=$? + eend ${ret} + # without, if a service depending on portmap is started too fast, + # connecting to portmap will fail -- azarah + sleep 1 + return ${ret} +} + +stop() { + ebegin "Stopping portmap" + start-stop-daemon --stop --quiet --exec /sbin/portmap + eend $? +} + +restart() { + # Dump the portmapper's table before stopping + ebegin "Saving portmap table" + local pmap=$(pmap_dump) + eend $? + + # Stop and restart portmapper + svc_stop + sleep 1 + svc_start + + # Reload the portmapper's table + if [ -n "${pmap}" ] ; then + ebegin "Reloading portmap table" + echo "${pmap}" | pmap_set + eend $? + fi +} -- cgit v1.2.3