aboutsummaryrefslogtreecommitdiffstats
path: root/main/portmap/portmap.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-07-24 08:01:31 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-07-24 08:01:31 +0000
commitb70981b68efcce5256eb11c6cd26ae123b10b6ea (patch)
treea38be6efae5e2ba15c2e839504632f9b7bfd5f91 /main/portmap/portmap.initd
parent2b4df81538b8398442d5296650905c70341dd8d3 (diff)
downloadaports-b70981b68efcce5256eb11c6cd26ae123b10b6ea.tar.bz2
aports-b70981b68efcce5256eb11c6cd26ae123b10b6ea.tar.xz
moved extra/* to main/
and fixed misc build issues
Diffstat (limited to 'main/portmap/portmap.initd')
-rw-r--r--main/portmap/portmap.initd46
1 files changed, 46 insertions, 0 deletions
diff --git a/main/portmap/portmap.initd b/main/portmap/portmap.initd
new file mode 100644
index 0000000000..65d23d7484
--- /dev/null
+++ b/main/portmap/portmap.initd
@@ -0,0 +1,46 @@
+#!/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.12 2007/06/13 07:52:44 vapier Exp $
+
+depend() {
+ use net
+ before inetd
+ before xinetd
+}
+
+start() {
+ 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
+}