summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonny Davies <woodchip@gentoo.org>2001-09-01 07:39:18 +0000
committerDonny Davies <woodchip@gentoo.org>2001-09-01 07:39:18 +0000
commit83ef59c27cfab6929fdab48e6da889702564dd07 (patch)
tree23c5541aca5aa8d58d7e9d6168ab0c39b7ba2048 /sys-apps/xinetd
parentxinet rc6 update (diff)
downloadgentoo-2-83ef59c27cfab6929fdab48e6da889702564dd07.tar.gz
gentoo-2-83ef59c27cfab6929fdab48e6da889702564dd07.tar.bz2
gentoo-2-83ef59c27cfab6929fdab48e6da889702564dd07.zip
rc6 style init file
Diffstat (limited to 'sys-apps/xinetd')
-rw-r--r--sys-apps/xinetd/files/xinetd.rc640
1 files changed, 40 insertions, 0 deletions
diff --git a/sys-apps/xinetd/files/xinetd.rc6 b/sys-apps/xinetd/files/xinetd.rc6
new file mode 100644
index 000000000000..f8fbf94aeaa6
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd.rc6
@@ -0,0 +1,40 @@
+#!/bin/sh
+#RCUPDATE:3 4:72:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+SERVICE=xinetd
+EXE="/usr/sbin/xinetd"
+opts="start stop"
+
+prepconfig() {
+ if [ ! -e /etc/xinetd.conf ] ; then
+ einfo "Creating new config from inetd..."
+ /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf
+ fi
+ if [ /etc/inetd.conf -nt /etc/xinetd.conf ] ; then
+ einfo "Creating new config from inetd..."
+ /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf
+ fi
+ if [ ! -e /etc/xinetd.conf ]
+ then
+ eerror "Xinetd not started. Config file not found."
+ exit 1
+ fi
+}
+
+start() {
+ prepconfig
+ ebegin "Starting ${SERVICE}"
+ start-stop-daemon --start --quiet --exec $EXE 1>&2
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SERVICE}"
+ start-stop-daemon --stop --quiet -u root -n $SERVICE 1>&2
+ eend $?
+}
+
+doservice ${@}
+