3 # Start only if at least on xinetd based service
6 test "$(ls -A ###ROOT###/etc/xinetd.d/)" ||
exit 5
8 PIDFILE
=###ROOT###/tmp/run/xinetd.pid
9 DAEMON
=/usr
/sbin
/xinetd
10 OPTS
="-pidfile ###ROOT###/tmp/run/xinetd.pid -filelog ###ROOT###/var/log/xinetd.log -f ###ROOT###/etc/xinetd.conf"
14 echo -n 'Starting xinetd...'
15 if [ -e "$PIDFILE" ] ; then
17 if [ -n "$PID" ] && ps
$PID > /dev
/null
2>&1 ; then
18 echo "still running with pid $PID! Aborting!"
21 echo "removing stale pid file..."
25 # Do not use usual system daemon path. Some start script
26 # (e.g. SLES) will think that the system xinetd is already
27 # running and do not start it if the OMD xinetd is running.
28 mkdir
-p $OMD_ROOT/var
/tmp
29 cp $DAEMON $OMD_ROOT/var
/tmp
/xinetd
30 $OMD_ROOT/var
/tmp
/xinetd
$OPTS
34 echo -n 'Stopping xinetd...'
35 PID
=$
(cat $PIDFILE 2>/dev
/null
)
36 if [ -z "$PID" ] ; then
38 elif kill "$PID" ; then
43 rm -f $OMD_ROOT/var
/tmp
/xinetd
50 echo -n 'Reloading xinetd...'
51 if [ -e "$PIDFILE" ] ; then
66 echo -n 'Checking status of xinetd...'
67 if [ -e "$PIDFILE" ] ; then
69 if [ -n "$PID" ] && ps
$PID > /dev
/null
2>&1 ; then
78 echo "Usage: $0 {start|stop|restart|reload|status}"