#!/bin/bash # # Init file for xinetd daemon # # chkconfig: 2345 55 25 # description:netd test # # processname: xinetd # # # # # pidfile: /var/run/xinetd.pid # source function library . /etc/rc.d/init.d/functions # pull in sysconfig settings [ -f /etc/sysconfig/xinetd ] && . /etc/sysconfig/xinetd RETVAL=0 prog="xinetd" # Some functions to make the below more readable XINETD=/usr/sbin/xinetd PID_FILE=/var/run/xinetd.pid start() { echo -n $"Starting $prog:" daemon $XINETD $OPTIONS && success || failure RETVAL=$? [ "$RETVAL" = 0 ] && touch /var/lock/subsys/xinetd echo } stop() { echo -n $"Stopping $prog:" killproc $XINETD -TERM RETVAL=$? [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/xinetd echo } reload() { echo -n $"Reloading $prog:" killproc $XINETD -HUP RETVAL=$? echo } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; reload) reload ;; status) status $XINETD RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" RETVAL=1 esac exit $RETVAL