|
|
8d7ee0 |
diff -up openslp-2.0.0/etc/slpd.all_init.orig openslp-2.0.0/etc/slpd.all_init
|
|
|
8d7ee0 |
--- openslp-2.0.0/etc/slpd.all_init.orig 2012-11-28 18:07:04.000000000 +0100
|
|
|
8d7ee0 |
+++ openslp-2.0.0/etc/slpd.all_init 2017-10-04 12:50:36.672953246 +0200
|
|
|
8d7ee0 |
@@ -1,28 +1,5 @@
|
|
|
8d7ee0 |
#!/bin/bash
|
|
|
8d7ee0 |
-#
|
|
|
8d7ee0 |
-# /etc/rc.d/init.d/slpd
|
|
|
8d7ee0 |
-#
|
|
|
8d7ee0 |
-# slpd Start/Stop the OpenSLP SA daemon (slpd).
|
|
|
8d7ee0 |
-#
|
|
|
8d7ee0 |
-# chkconfig: 345 13 87
|
|
|
8d7ee0 |
-# description: OpenSLP daemon for the Service Location Protocol
|
|
|
8d7ee0 |
-# processname: slpd
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
|
|
|
8d7ee0 |
-# Modified for RHS Linux by Damien Neil
|
|
|
8d7ee0 |
-# Modified for COL by Raymund Will, <ray@lst.de>
|
|
|
8d7ee0 |
-# Modified for OpenSLP by Matt Peterson <mpeterson@calderasystems.com>
|
|
|
8d7ee0 |
-# Modified to be distribution agnostic by Bart Whiteley <bart@caldera.com>
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-#//////////////////////////////////////////////////#
|
|
|
8d7ee0 |
-# Does nothing if a route exists that supports #
|
|
|
8d7ee0 |
-# multicast traffic. If no routes supporting #
|
|
|
8d7ee0 |
-# multicast traffic exists, the function tries to #
|
|
|
8d7ee0 |
-# add one. A 0 is returned on success and a 1 #
|
|
|
8d7ee0 |
-# on failure. One parameter must be passed in. #
|
|
|
8d7ee0 |
-# This variable determins verbosity. If parameter #
|
|
|
8d7ee0 |
-# is non-zero debugging will appear #
|
|
|
8d7ee0 |
-#//////////////////////////////////////////////////#
|
|
|
8d7ee0 |
+
|
|
|
8d7ee0 |
multicast_route_set()
|
|
|
8d7ee0 |
{
|
|
|
8d7ee0 |
PING_OPTIONS_1='-c1 -w1'
|
|
|
8d7ee0 |
@@ -36,8 +13,8 @@ multicast_route_set()
|
|
|
8d7ee0 |
MSG_FAILED_TO_ADD=' FAILED - Route NOT Added.'
|
|
|
8d7ee0 |
MSG_SUCCES_ON_ADD=' SUCCESS - Route Added.'
|
|
|
8d7ee0 |
|
|
|
8d7ee0 |
- CMD_GET_INTERFACE="netstat -i | awk 'BEGIN{}(NR>2)&&(!/^lo*/){print \$1}'"
|
|
|
8d7ee0 |
- CMD_ADD_ROUTE="route add -net 224.0.0.0 netmask 240.0.0.0"
|
|
|
8d7ee0 |
+ CMD_GET_INTERFACE="ip -o link show | awk 'BEGIN{FS=\": \"}!/^:digit:+: lo:.*/{print \$2}'"
|
|
|
8d7ee0 |
+ CMD_ADD_ROUTE="ip route add 224.0.0.0/4 dev"
|
|
|
8d7ee0 |
|
|
|
8d7ee0 |
err_unreachable_found=`ping $PING_OPTIONS_1 $MULTICAST_ADDRESS 2>&1 1>/dev/null`
|
|
|
8d7ee0 |
|
|
|
8d7ee0 |
@@ -91,94 +68,11 @@ multicast_route_set()
|
|
|
8d7ee0 |
return $retval
|
|
|
8d7ee0 |
}
|
|
|
8d7ee0 |
|
|
|
8d7ee0 |
-NAME=slpd
|
|
|
8d7ee0 |
-DAEMON=/usr/sbin/$NAME
|
|
|
8d7ee0 |
-SUSE=0
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-# Change to root
|
|
|
8d7ee0 |
-OLDDIR=`pwd`
|
|
|
8d7ee0 |
-cd /
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-# Source function library.
|
|
|
8d7ee0 |
-if [ -f /etc/rc.d/init.d/functions ]; then
|
|
|
8d7ee0 |
- . /etc/rc.d/init.d/functions
|
|
|
8d7ee0 |
-else
|
|
|
8d7ee0 |
- SUSE=1
|
|
|
8d7ee0 |
-fi
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-test -x $DAEMON || exit 0
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-if [ ! "$SVIlock" = "" ]; then
|
|
|
8d7ee0 |
- unset LOCK
|
|
|
8d7ee0 |
-else
|
|
|
8d7ee0 |
- LOCK=/var/lock/subsys/slpd
|
|
|
8d7ee0 |
+multicast_route_set 1
|
|
|
8d7ee0 |
+multicast_enabled=$?
|
|
|
8d7ee0 |
+if [ "$multicast_enabled" != "0" ] ; then
|
|
|
8d7ee0 |
+ echo "Failure: No Route Available for Multicast Traffic"
|
|
|
8d7ee0 |
+ exit 1
|
|
|
8d7ee0 |
fi
|
|
|
8d7ee0 |
|
|
|
8d7ee0 |
-RETVAL=0
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-#
|
|
|
8d7ee0 |
-# See how we were called.
|
|
|
8d7ee0 |
-#
|
|
|
8d7ee0 |
-case "$1" in
|
|
|
8d7ee0 |
- start)
|
|
|
8d7ee0 |
- # Check if atd is already running
|
|
|
8d7ee0 |
- # RH style
|
|
|
8d7ee0 |
- if [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ -f $LOCK ]; then
|
|
|
8d7ee0 |
- exit 0
|
|
|
8d7ee0 |
- fi
|
|
|
8d7ee0 |
- # Caldera Style
|
|
|
8d7ee0 |
- if [ ! "$SVIlock" = "" ] && [ -f $SVIlock ]; then
|
|
|
8d7ee0 |
- exit 0
|
|
|
8d7ee0 |
- fi
|
|
|
8d7ee0 |
- echo -n 'Starting slpd: '
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
- multicast_route_set 1
|
|
|
8d7ee0 |
- multicast_enabled=$?
|
|
|
8d7ee0 |
- if [ "$multicast_enabled" != "0" ] ; then
|
|
|
8d7ee0 |
- echo "Failure: No Route Available for Multicast Traffic"
|
|
|
8d7ee0 |
- exit 1
|
|
|
8d7ee0 |
- fi
|
|
|
8d7ee0 |
- if [ $SUSE -eq 0 ]; then
|
|
|
8d7ee0 |
- if [ -x /sbin/ssd ]; then
|
|
|
8d7ee0 |
- ssd -S -n $NAME -x $DAEMON -- $OPTIONS
|
|
|
8d7ee0 |
- [ ! "$SVIlock" = "" ] && touch $SVIlock
|
|
|
8d7ee0 |
- else
|
|
|
8d7ee0 |
- daemon $DAEMON
|
|
|
8d7ee0 |
- RETVAL=$?
|
|
|
8d7ee0 |
- fi
|
|
|
8d7ee0 |
- else
|
|
|
8d7ee0 |
- startproc $DAEMON $OPTIONS
|
|
|
8d7ee0 |
- fi
|
|
|
8d7ee0 |
- [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && touch $LOCK
|
|
|
8d7ee0 |
- echo
|
|
|
8d7ee0 |
- ;;
|
|
|
8d7ee0 |
- stop)
|
|
|
8d7ee0 |
- echo -n 'Stopping slpd: '
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
- if [ -x /sbin/ssd ]; then
|
|
|
8d7ee0 |
- ssd -K -p /var/run/$NAME.pid -n $NAME
|
|
|
8d7ee0 |
- [ ! "$SVIlock" = "" ] && rm -f $SVIlock
|
|
|
8d7ee0 |
- else
|
|
|
8d7ee0 |
- killproc $DAEMON
|
|
|
8d7ee0 |
- RETVAL=$?
|
|
|
8d7ee0 |
- fi
|
|
|
8d7ee0 |
- [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && rm -f $LOCK
|
|
|
8d7ee0 |
- echo
|
|
|
8d7ee0 |
- ;;
|
|
|
8d7ee0 |
- reload|restart)
|
|
|
8d7ee0 |
- cd $OLDDIR
|
|
|
8d7ee0 |
- $0 stop
|
|
|
8d7ee0 |
- $0 start
|
|
|
8d7ee0 |
- cd /
|
|
|
8d7ee0 |
- RETVAL=$?
|
|
|
8d7ee0 |
- ;;
|
|
|
8d7ee0 |
- status)
|
|
|
8d7ee0 |
- status /usr/sbin/slpd
|
|
|
8d7ee0 |
- RETVAL=$?
|
|
|
8d7ee0 |
- ;;
|
|
|
8d7ee0 |
- *)
|
|
|
8d7ee0 |
- echo "Usage: /etc/rc.d/init.d/slpd {start|stop|restart|reload|status}"
|
|
|
8d7ee0 |
- exit 1
|
|
|
8d7ee0 |
-esac
|
|
|
8d7ee0 |
-
|
|
|
8d7ee0 |
-exit $RETVAL
|
|
|
8d7ee0 |
+exit 0
|