summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/python/files/pydoc.init')
-rwxr-xr-xdev-lang/python/files/pydoc.init26
1 files changed, 26 insertions, 0 deletions
diff --git a/dev-lang/python/files/pydoc.init b/dev-lang/python/files/pydoc.init
new file mode 100755
index 000000000000..8e436db3eec2
--- /dev/null
+++ b/dev-lang/python/files/pydoc.init
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public Licence v2
+# $Header:
+
+depend() {
+ need net
+}
+
+start() {
+ if [ -z $PYDOC_PORT ] ; then
+ eerror "Port not set"
+ return 1
+ fi
+ ebegin "Starting pydoc server on port $PYDOC_PORT"
+ start-stop-daemon --start --background --make-pidfile \
+ --pidfile /var/run/pydoc.pid \
+ --startas /usr/bin/pydoc -- -p $PYDOC_PORT
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping pydoc server"
+ start-stop-daemon --stop --quiet --pidfile /var/run/pydoc.pid
+ eend $?
+}