You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
3.3 KiB
135 lines
3.3 KiB
5 years ago
|
diff -up openslp-2.0.0/etc/slpd.all_init.orig openslp-2.0.0/etc/slpd.all_init
|
||
|
--- openslp-2.0.0/etc/slpd.all_init.orig 2012-11-28 18:07:04.000000000 +0100
|
||
|
+++ openslp-2.0.0/etc/slpd.all_init 2013-06-24 13:27:34.375575496 +0200
|
||
|
@@ -1,28 +1,5 @@
|
||
|
#!/bin/bash
|
||
|
-#
|
||
|
-# /etc/rc.d/init.d/slpd
|
||
|
-#
|
||
|
-# slpd Start/Stop the OpenSLP SA daemon (slpd).
|
||
|
-#
|
||
|
-# chkconfig: 345 13 87
|
||
|
-# description: OpenSLP daemon for the Service Location Protocol
|
||
|
-# processname: slpd
|
||
|
-
|
||
|
-# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
|
||
|
-# Modified for RHS Linux by Damien Neil
|
||
|
-# Modified for COL by Raymund Will, <ray@lst.de>
|
||
|
-# Modified for OpenSLP by Matt Peterson <mpeterson@calderasystems.com>
|
||
|
-# Modified to be distribution agnostic by Bart Whiteley <bart@caldera.com>
|
||
|
-
|
||
|
-#//////////////////////////////////////////////////#
|
||
|
-# Does nothing if a route exists that supports #
|
||
|
-# multicast traffic. If no routes supporting #
|
||
|
-# multicast traffic exists, the function tries to #
|
||
|
-# add one. A 0 is returned on success and a 1 #
|
||
|
-# on failure. One parameter must be passed in. #
|
||
|
-# This variable determins verbosity. If parameter #
|
||
|
-# is non-zero debugging will appear #
|
||
|
-#//////////////////////////////////////////////////#
|
||
|
+
|
||
|
multicast_route_set()
|
||
|
{
|
||
|
PING_OPTIONS_1='-c1 -w1'
|
||
|
@@ -91,94 +68,11 @@ multicast_route_set()
|
||
|
return $retval
|
||
|
}
|
||
|
|
||
|
-NAME=slpd
|
||
|
-DAEMON=/usr/sbin/$NAME
|
||
|
-SUSE=0
|
||
|
-
|
||
|
-# Change to root
|
||
|
-OLDDIR=`pwd`
|
||
|
-cd /
|
||
|
-
|
||
|
-# Source function library.
|
||
|
-if [ -f /etc/rc.d/init.d/functions ]; then
|
||
|
- . /etc/rc.d/init.d/functions
|
||
|
-else
|
||
|
- SUSE=1
|
||
|
-fi
|
||
|
-
|
||
|
-test -x $DAEMON || exit 0
|
||
|
-
|
||
|
-if [ ! "$SVIlock" = "" ]; then
|
||
|
- unset LOCK
|
||
|
-else
|
||
|
- LOCK=/var/lock/subsys/slpd
|
||
|
+multicast_route_set 1
|
||
|
+multicast_enabled=$?
|
||
|
+if [ "$multicast_enabled" != "0" ] ; then
|
||
|
+ echo "Failure: No Route Available for Multicast Traffic"
|
||
|
+ exit 1
|
||
|
fi
|
||
|
|
||
|
-RETVAL=0
|
||
|
-
|
||
|
-#
|
||
|
-# See how we were called.
|
||
|
-#
|
||
|
-case "$1" in
|
||
|
- start)
|
||
|
- # Check if atd is already running
|
||
|
- # RH style
|
||
|
- if [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ -f $LOCK ]; then
|
||
|
- exit 0
|
||
|
- fi
|
||
|
- # Caldera Style
|
||
|
- if [ ! "$SVIlock" = "" ] && [ -f $SVIlock ]; then
|
||
|
- exit 0
|
||
|
- fi
|
||
|
- echo -n 'Starting slpd: '
|
||
|
-
|
||
|
- multicast_route_set 1
|
||
|
- multicast_enabled=$?
|
||
|
- if [ "$multicast_enabled" != "0" ] ; then
|
||
|
- echo "Failure: No Route Available for Multicast Traffic"
|
||
|
- exit 1
|
||
|
- fi
|
||
|
- if [ $SUSE -eq 0 ]; then
|
||
|
- if [ -x /sbin/ssd ]; then
|
||
|
- ssd -S -n $NAME -x $DAEMON -- $OPTIONS
|
||
|
- [ ! "$SVIlock" = "" ] && touch $SVIlock
|
||
|
- else
|
||
|
- daemon $DAEMON
|
||
|
- RETVAL=$?
|
||
|
- fi
|
||
|
- else
|
||
|
- startproc $DAEMON $OPTIONS
|
||
|
- fi
|
||
|
- [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && touch $LOCK
|
||
|
- echo
|
||
|
- ;;
|
||
|
- stop)
|
||
|
- echo -n 'Stopping slpd: '
|
||
|
-
|
||
|
- if [ -x /sbin/ssd ]; then
|
||
|
- ssd -K -p /var/run/$NAME.pid -n $NAME
|
||
|
- [ ! "$SVIlock" = "" ] && rm -f $SVIlock
|
||
|
- else
|
||
|
- killproc $DAEMON
|
||
|
- RETVAL=$?
|
||
|
- fi
|
||
|
- [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && rm -f $LOCK
|
||
|
- echo
|
||
|
- ;;
|
||
|
- reload|restart)
|
||
|
- cd $OLDDIR
|
||
|
- $0 stop
|
||
|
- $0 start
|
||
|
- cd /
|
||
|
- RETVAL=$?
|
||
|
- ;;
|
||
|
- status)
|
||
|
- status /usr/sbin/slpd
|
||
|
- RETVAL=$?
|
||
|
- ;;
|
||
|
- *)
|
||
|
- echo "Usage: /etc/rc.d/init.d/slpd {start|stop|restart|reload|status}"
|
||
|
- exit 1
|
||
|
-esac
|
||
|
-
|
||
|
-exit $RETVAL
|
||
|
+exit 0
|