summaryrefslogtreecommitdiff
path: root/network/xinetd/rc.xinetd
diff options
context:
space:
mode:
authorChris Abela <chris.abela@maltats.com>2010-11-25 15:59:16 -0600
committerHeinz Wiesinger <pprkut@slackbuilds.org>2010-11-29 12:45:55 +0100
commitb213fa89dee3d2e9189a9f4cc69806ae22f9de9e (patch)
tree524cca84b0d7dfb66c7616edf9a102cec54b23bb /network/xinetd/rc.xinetd
parent135174bdcbad5aed51bf7306587d01a7c8c57549 (diff)
downloadslackbuilds-b213fa89dee3d2e9189a9f4cc69806ae22f9de9e.tar.gz
network/xinetd: Added (inetd replacement)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/xinetd/rc.xinetd')
-rw-r--r--network/xinetd/rc.xinetd103
1 files changed, 103 insertions, 0 deletions
diff --git a/network/xinetd/rc.xinetd b/network/xinetd/rc.xinetd
new file mode 100644
index 0000000000..44f153b1ba
--- /dev/null
+++ b/network/xinetd/rc.xinetd
@@ -0,0 +1,103 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+RETVAL=0
+
+start(){
+ echo "Starting xinetd: /usr/sbin/xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid "
+ # Need to get rid of localization for external services -
+ # it doesn't make much sense to have i18n on the server side here
+ LANG=en_US
+ LC_TIME=en_US
+ LC_ALL=en_US
+ LC_MESSAGES=en_US
+ LC_NUMERIC=en_US
+ LC_MONETARY=en_US
+ LC_COLLATE=en_US
+ export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE
+ unset HOME MAIL USER USERNAME
+ /usr/sbin/xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
+ RETVAL=$?
+ [ "$RETVAL" = 0 ] && touch /var/lock/subsys/xinetd
+ return $RETVAL
+}
+
+stop(){
+ echo "Stopping xinetd... "
+ killall xinetd 2>/dev/null
+ RETVAL=$?
+ rm -f /var/lock/subsys/xinetd
+ return $RETVAL
+}
+
+restart(){
+ stop
+ sleep 1
+ start
+}
+
+reload(){
+ echo "Reloading xinetd configuration..."
+ killall -HUP xinetd 2>/dev/null
+ return $?
+}
+
+dump(){
+ echo -n $"Dumping configuration: "
+ killall -USR1 xinetd
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+check(){
+ echo $"Performing Consistency Check: "
+ /bin/kill -s IOT xinetd
+ RETVAL=$?
+ return $RETVAL
+}
+
+status(){
+ echo -n $"Checking xinetd: "
+ /bin/kill -s IOT xinetd 2>/dev/null
+ RETVAL=$?
+ if [ $RETVAL = 0 ]; then
+ echo "xinetd is running"
+ else
+ echo "xinetd is not running"
+ fi
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ reload)
+ reload
+ ;;
+ dump)
+ dump
+ ;;
+ check)
+ check
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|dump|check|status}"
+ RETVAL=1
+esac
+
+exit $RETVAL
+
+