From: frank Date: Sat, 28 Jan 2012 21:38:36 +0000 (+0100) Subject: committing changes in /etc after emerge run X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=2e64035be70869af7d4273eaa109b803705ebf6c;p=config%2Fuhu1%2Fetc.git committing changes in /etc after emerge run Package changes: +net-nds/portmap-6.0 --- diff --git a/.etckeeper b/.etckeeper index 89b46af..3b8caa0 100755 --- a/.etckeeper +++ b/.etckeeper @@ -132,6 +132,7 @@ maybe chmod 0644 './conf.d/network' maybe chmod 0644 './conf.d/ntp-client' maybe chmod 0644 './conf.d/ntpd' maybe chmod 0644 './conf.d/pciparm' +maybe chmod 0644 './conf.d/portmap' maybe chmod 0644 './conf.d/pydoc-2.7' maybe chmod 0644 './conf.d/pydoc-3.1' maybe chmod 0644 './conf.d/rsyncd' @@ -559,6 +560,7 @@ maybe chmod 0755 './init.d/ntpd' maybe chmod 0755 './init.d/numlock' maybe chmod 0755 './init.d/pciparm' maybe chmod 0755 './init.d/php-fpm' +maybe chmod 0755 './init.d/portmap' maybe chmod 0755 './init.d/procfs' maybe chmod 0755 './init.d/pwcheck' maybe chmod 0755 './init.d/pydoc-2.7' diff --git a/conf.d/portmap b/conf.d/portmap new file mode 100644 index 0000000..c2756c9 --- /dev/null +++ b/conf.d/portmap @@ -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/init.d/portmap b/init.d/portmap new file mode 100755 index 0000000..bbffd6c --- /dev/null +++ b/init.d/portmap @@ -0,0 +1,59 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-nds/portmap/files/portmap.rc6,v 1.13 2009/05/30 20:50:39 vapier Exp $ + +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 +}