auto-import changelog data from openslp-1.2.0-0.fdr.4.1.src.rpm
1.2.0-0.fdr.4 - BR: flex 1.2.0-0.fdr.3 - BR: bison 1.2.0-0.fdr.2 - fix/add condrestart to init script 1.2.0-0.fdr.1 - 1.2.0 - use -pie - don't use Requires(post,postun) 1.0.11-0.fdr.7 - fix for Fedora Core - fix description (main package does *not* include daemon and header files).
This commit is contained in:
parent
4f57eb9581
commit
e872b1e26e
@ -1 +1 @@
|
|||||||
openslp-1.0.11.tar.gz
|
openslp-1.2.0.tar.gz
|
||||||
|
11
openslp-1.2.0-optflags.patch
Normal file
11
openslp-1.2.0-optflags.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- openslp-1.2.0/configure.in.optflags 2004-07-15 09:03:43.000000000 -0500
|
||||||
|
+++ openslp-1.2.0/configure.in 2004-02-04 14:07:33.000000000 -0600
|
||||||
|
@@ -126,7 +126,7 @@
|
||||||
|
CFLAGS="$CFLAGS -Werror"
|
||||||
|
fi
|
||||||
|
if test X"$debug" = X"no"; then
|
||||||
|
- OPTFLAGS="-O3"
|
||||||
|
+ OPTFLAGS="-O3 $RPM_OPT_FLAGS "
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif $CC -V 2>&1 | grep "WorkShop Compilers"; then
|
86
openslp.init
86
openslp.init
@ -1,86 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# $Id: openslp.init,v 1.2 2003/05/30 12:59:30 rexdieter Exp $
|
|
||||||
#
|
|
||||||
# chkconfig: 345 40 60
|
|
||||||
# description: OpenSLP daemon for the Service Location Protocol
|
|
||||||
# processname: slpd
|
|
||||||
|
|
||||||
# Source function library.
|
|
||||||
. /etc/rc.d/init.d/functions
|
|
||||||
|
|
||||||
# Source networking configuration.
|
|
||||||
. /etc/sysconfig/network
|
|
||||||
|
|
||||||
if [ -f /etc/sysconfig/slpd ]; then
|
|
||||||
. /etc/sysconfig/slpd
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check that networking is up.
|
|
||||||
[ ${NETWORKING} = "no" ] && exit 0
|
|
||||||
|
|
||||||
RETVAL=0
|
|
||||||
|
|
||||||
prog="slpd"
|
|
||||||
|
|
||||||
start () {
|
|
||||||
echo -n $"Starting $prog: "
|
|
||||||
daemon $prog
|
|
||||||
RETVAL=$?
|
|
||||||
echo
|
|
||||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
|
|
||||||
return $RETVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
stop () {
|
|
||||||
echo -n $"Stopping $prog: "
|
|
||||||
killproc $prog
|
|
||||||
RETVAL=$?
|
|
||||||
echo
|
|
||||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
|
|
||||||
return $RETVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
reload(){
|
|
||||||
echo -n $"Reloading configuration: "
|
|
||||||
killproc $prog -HUP
|
|
||||||
RETVAL=$?
|
|
||||||
echo
|
|
||||||
return $RETVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
restart () {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
condrestart(){
|
|
||||||
[ -e /var/lock/subsys/$prog ] && restart
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
start
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
stop
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
reload
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
condrestart)
|
|
||||||
condrestart
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
status $prog
|
|
||||||
RETVAL=$?
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|restart|reload|condrestart|status}"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit $RETVAL
|
|
96
openslp.spec
96
openslp.spec
@ -1,20 +1,26 @@
|
|||||||
# $Id: openslp.spec,v 1.1 2004/11/08 04:56:10 cvsextras Exp $
|
# $Id: openslp.spec,v 1.2 2004/11/08 04:56:22 cvsextras Exp $
|
||||||
|
|
||||||
## kde-redhat macros
|
%define pie 1
|
||||||
%define rhversion %(perl -pe '/(\\d+)\\.?(\\d)?/; $_="$1".($2||0)' /etc/redhat-release)
|
|
||||||
|
|
||||||
Summary: OpenSLP implementation of Service Location Protocol V2
|
Summary: OpenSLP implementation of Service Location Protocol V2
|
||||||
Name: openslp
|
Name: openslp
|
||||||
Epoch: 0
|
Epoch: 0
|
||||||
Version: 1.0.11
|
Version: 1.2.0
|
||||||
Release: 0.fdr.6.rh%{rhversion}
|
Release: 0.fdr.4%{?dist_tag}.1
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
License: Caldera Systems (BSD)
|
License: BSD
|
||||||
URL: http://www.openslp.org/
|
#URL: http://www.openslp.org/
|
||||||
|
URL: http://sourceforge.net/projects/openslp/
|
||||||
|
Source: http://dl.sourceforge.net/sourceforge/openslp/openslp-1.2.0.tar.gz
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||||
|
|
||||||
Source0: ftp://openslp.org/pub/openslp/%{name}-%{version}/%{name}-%{version}.tar.gz
|
Source1: slpd.init
|
||||||
Source1: %{name}.init
|
Patch1: openslp-1.2.0-optflags.patch
|
||||||
|
|
||||||
|
BuildRequires: autoconf automake libtool
|
||||||
|
BuildRequires: bison flex
|
||||||
|
#BuildRequires: byacc
|
||||||
|
BuildRequires: openssl-devel
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Service Location Protocol is an IETF standards track protocol that
|
Service Location Protocol is an IETF standards track protocol that
|
||||||
@ -23,8 +29,7 @@ existence, location, and configuration of networked services in
|
|||||||
enterprise networks.
|
enterprise networks.
|
||||||
|
|
||||||
OpenSLP is an open source implementation of the SLPv2 protocol as defined
|
OpenSLP is an open source implementation of the SLPv2 protocol as defined
|
||||||
by RFC 2608 and RFC 2614. This package include the daemon, libraries, header
|
by RFC 2608 and RFC 2614.
|
||||||
files and documentation
|
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: OpenSLP headers and libraries
|
Summary: OpenSLP headers and libraries
|
||||||
@ -33,14 +38,13 @@ Requires: %{name} = %{epoch}:%{version}-%{release}
|
|||||||
%description devel
|
%description devel
|
||||||
OpenSLP header files and libraries.
|
OpenSLP header files and libraries.
|
||||||
|
|
||||||
$Revision: 1.1 $
|
|
||||||
|
|
||||||
%package server
|
%package server
|
||||||
Summary: OpenSLP server daemon
|
Summary: OpenSLP server daemon
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Requires: %{name} = %{epoch}:%{version}-%{release}
|
Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||||
Requires(preun,post): chkconfig
|
Requires(preun): chkconfig /sbin/service
|
||||||
Requires(preun,postun): /sbin/service
|
Requires(post): chkconfig
|
||||||
|
Requires(postun): /sbin/service
|
||||||
%description server
|
%description server
|
||||||
OpenSLP server daemon to dynamically register services.
|
OpenSLP server daemon to dynamically register services.
|
||||||
|
|
||||||
@ -48,20 +52,29 @@ OpenSLP server daemon to dynamically register services.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
|
%patch1 -p1 -b .optflags
|
||||||
|
|
||||||
|
libtoolize --force
|
||||||
|
aclocal
|
||||||
|
autoconf
|
||||||
|
automake --add-missing
|
||||||
|
|
||||||
# remove CVS leftovers...
|
# remove CVS leftovers...
|
||||||
find . -name "CVS" | xargs rm -rf
|
find . -name "CVS" | xargs rm -rf
|
||||||
|
|
||||||
# remove hard-coded compiler flags: -O3 -Wall
|
# remove hard-coded compiler flags: -O3 -Wall
|
||||||
perl -pi -e "s@-O3@@g" configure
|
perl -pi -e "s@-O3@@g" configure
|
||||||
perl -pi -e "s@-Wall@@g" configure
|
#perl -pi -e "s@-Wall@@g" configure
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
|
%{?pie:export CFLAGS="-fPIC $RPM_OPT_FLAGS"; export LDFLAGS="-pie"}
|
||||||
|
|
||||||
%configure \
|
%configure \
|
||||||
--disable-static
|
--disable-static
|
||||||
# --enable-slpv2-security
|
# --enable-slpv2-security
|
||||||
# --enable-async-api
|
# --enable-async-api
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
@ -69,10 +82,9 @@ make %{?_smp_mflags}
|
|||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%makeinstall
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
|
||||||
install -D -m755 %{SOURCE1} \
|
install -p -D -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/slpd
|
||||||
$RPM_BUILD_ROOT%{_initrddir}/slpd
|
|
||||||
|
|
||||||
# nuke unpackaged/unwanted files
|
# nuke unpackaged/unwanted files
|
||||||
rm -rf $RPM_BUILD_ROOT/usr/doc
|
rm -rf $RPM_BUILD_ROOT/usr/doc
|
||||||
@ -89,14 +101,14 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%post server
|
%post server
|
||||||
/sbin/chkconfig --add slpd
|
/sbin/chkconfig --add slpd
|
||||||
|
|
||||||
%preun server
|
%preun server
|
||||||
if [ "$1" == "0" ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
/sbin/service slpd stop >/dev/null 2>&1 ||:
|
/sbin/service slpd stop >/dev/null 2>&1 ||:
|
||||||
/sbin/chkconfig --del slpd
|
/sbin/chkconfig --del slpd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%postun server
|
%postun server
|
||||||
if [ "$1" -ge "1" ]; then
|
if [ $1 -ge 1 ]; then
|
||||||
/sbin/service slpd condrestart >/dev/null 2>&1
|
/sbin/service slpd condrestart >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -127,35 +139,53 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri May 30 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.11-0.fdr.6
|
* Mon Jul 19 2004 Rex Dieter <rexdieter at sf.net> 0:1.2.0-0.fdr.4
|
||||||
|
- BR: flex
|
||||||
|
|
||||||
|
* Fri Jul 16 2004 Rex Dieter <rexdieter at sf.net> 0:1.2.0-0.fdr.3
|
||||||
|
- BR: bison
|
||||||
|
|
||||||
|
* Thu Jul 15 2004 Rex Dieter <rexdieter at sf.net> 0:1.2.0-0.fdr.2
|
||||||
|
- fix/add condrestart to init script
|
||||||
|
|
||||||
|
* Thu Jul 15 2004 Rex Dieter <rexdieter at sf.net> 0:1.2.0-0.fdr.1
|
||||||
|
- 1.2.0
|
||||||
|
- use -pie
|
||||||
|
- don't use Requires(post,postun)
|
||||||
|
|
||||||
|
* Fri Oct 24 2003 Rex Dieter <rexdieter af sf.net> 0:1.0.11-0.fdr.7
|
||||||
|
- fix for Fedora Core
|
||||||
|
- fix description (main package does *not* include daemon and header files).
|
||||||
|
|
||||||
|
* Fri May 30 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.11-0.fdr.6
|
||||||
- -server: Requires(preun,postun): /sbin/service
|
- -server: Requires(preun,postun): /sbin/service
|
||||||
- add a few more %%doc files to base pkg.
|
- add a few more %%doc files to base pkg.
|
||||||
- initscript: add (real) 'reload' action.
|
- initscript: add (real) 'reload' action.
|
||||||
- initscript: use $prog instead of hardcoded slpd.
|
- initscript: use $prog instead of hardcoded slpd.
|
||||||
|
|
||||||
* Fri May 16 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.11-0.fdr.5
|
* Fri May 16 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.11-0.fdr.5
|
||||||
- -server: fix %postun on uninstall
|
- -server: fix %postun on uninstall
|
||||||
|
|
||||||
* Thu May 2 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.11-0.fdr.4
|
* Thu May 2 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.11-0.fdr.4
|
||||||
- *really* do %%config(noreplace) slp.conf
|
- *really* do %%config(noreplace) slp.conf
|
||||||
|
|
||||||
* Thu May 1 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.11-0.fdr.3
|
* Thu May 1 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.11-0.fdr.3
|
||||||
- capitalize Summary's.
|
- capitalize Summary's.
|
||||||
- %%config(noreplace) slp.conf
|
- %%config(noreplace) slp.conf
|
||||||
|
|
||||||
* Thu May 1 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.11-0.fdr.2
|
* Thu May 1 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.11-0.fdr.2
|
||||||
- docs: remove CVS files, include rfc, move ProgrammersGuide to -devel.
|
- docs: remove CVS files, include rfc, move ProgrammersGuide to -devel.
|
||||||
- improve sub-pkg descriptions.
|
- improve sub-pkg descriptions.
|
||||||
- improve server %%preun,%%postun scripts: condrestart on upgrade,
|
- improve server %%preun,%%postun scripts: condrestart on upgrade,
|
||||||
suppress output of server shutdown,restarts.
|
suppress output of server shutdown,restarts.
|
||||||
|
|
||||||
* Thu May 1 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.11-0.fdr.1
|
* Thu May 1 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.11-0.fdr.1
|
||||||
- specfile cleanups for fedora packaging.
|
- specfile cleanups for fedora packaging.
|
||||||
|
|
||||||
* Tue Apr 29 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.11-0.fdr.0
|
* Tue Apr 29 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.11-0.fdr.0
|
||||||
- 1.0.11 release.
|
- 1.0.11 release.
|
||||||
- fedorize things
|
- fedorize things
|
||||||
|
|
||||||
* Mon Feb 03 2003 Rex Dieter <rexdieter at users.sf.net> 0:1.0.10-1.0
|
* Mon Feb 03 2003 Rex Dieter <rexdieter at sf.net> 0:1.0.10-1.0
|
||||||
- sanitize specfile
|
- sanitize specfile
|
||||||
- -devel,-server subpkgs.
|
- -devel,-server subpkgs.
|
||||||
|
256
slpd.init
Normal file
256
slpd.init
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# slpd Start/Stop the OpenSLP SA daemon (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>
|
||||||
|
# -Modified to be MORE agnostic by Erik Ratcliffe <eratcliffe@volutiontech.com>
|
||||||
|
|
||||||
|
# Red Hat "chkconfig" init header:
|
||||||
|
#
|
||||||
|
# chkconfig: 345 13 87
|
||||||
|
# description: slpd - OpenSLP daemon for the Service Location Protocol
|
||||||
|
# processname: slpd
|
||||||
|
|
||||||
|
# LSB init header:
|
||||||
|
#
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: openslp slpd
|
||||||
|
# Required-Start: $named
|
||||||
|
# Required-Stop:
|
||||||
|
# Default-Start: 3 4 5
|
||||||
|
# Default-Stop: 0 1 2 6
|
||||||
|
# Description: slpd - OpenSLP daemon for the Service Location Protocol
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
|
||||||
|
#///////////// multicast_route_set() //////////////#
|
||||||
|
# #
|
||||||
|
# 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'
|
||||||
|
PING_OPTIONS_2='-c1 -i1'
|
||||||
|
MULTICAST_ADDRESS='239.255.255.253'
|
||||||
|
TMP_FILE=/tmp/route.check
|
||||||
|
PING_ERROR_NO_ROUTE='unreachable'
|
||||||
|
|
||||||
|
MSG_FAILED_TO_FIND='Failed to Detect Multicast Route'
|
||||||
|
MSG_SUCCESS_ON_FIND='Multicast Route Enabled'
|
||||||
|
MSG_ADDING_ROUTE='Attempting to Add Multicast Route ...'
|
||||||
|
MSG_FAILED_TO_ADD=' FAILED - Route NOT Added.'
|
||||||
|
MSG_SUCCES_ON_ADD=' SUCCESS - Route Added.'
|
||||||
|
|
||||||
|
CMD_GET_INTERFACE="netstat -i | awk 'BEGIN{}(NR>2)&&(!/^lo*/){print \$1}'"
|
||||||
|
CMD_ADD_ROUTE="route add -net 224.0.0.0 netmask 240.0.0.0"
|
||||||
|
|
||||||
|
ping $PING_OPTIONS_1 $MULTICAST_ADDRESS 2> $TMP_FILE 1> /dev/null
|
||||||
|
|
||||||
|
if [ $? = 2 ]; then
|
||||||
|
ping $PING_OPTIONS_2 $MULTICAST_ADDRESS 2> $TMP_FILE 1> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
grep $PING_ERROR_NO_ROUTE $TMP_FILE > /dev/null 2>&1
|
||||||
|
err_unreachable_found=$?
|
||||||
|
|
||||||
|
#If errors, add route. Otherwise, do nothing
|
||||||
|
if [ -s $TMP_FILE ] && [ $err_unreachable_found = 0 ]; then
|
||||||
|
|
||||||
|
if [ $1 != 0 ]; then
|
||||||
|
echo $MSG_FAILED_TO_FIND
|
||||||
|
echo $MSG_ADDING_ROUTE
|
||||||
|
fi
|
||||||
|
|
||||||
|
$CMD_ADD_ROUTE `eval $CMD_GET_INTERFACE` > /dev/null 2>&1
|
||||||
|
retval=$?
|
||||||
|
|
||||||
|
if [ $1 != 0 ]; then
|
||||||
|
|
||||||
|
if [ $retval = 0 ]; then
|
||||||
|
echo $MSG_SUCCES_ON_ADD
|
||||||
|
else
|
||||||
|
echo $MSG_FAILED_TO_ADD
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ $1 != 0 ]; then
|
||||||
|
echo -n $MSG_SUCCESS_ON_FIND
|
||||||
|
fi
|
||||||
|
retval=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f $TMP_FILE # Clean up
|
||||||
|
return $retval
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NAME=slpd
|
||||||
|
DAEMON=/usr/sbin/$NAME
|
||||||
|
|
||||||
|
|
||||||
|
# Change to root
|
||||||
|
OLDDIR=`pwd`
|
||||||
|
cd /
|
||||||
|
|
||||||
|
|
||||||
|
# Source function library or libraries. Start with the
|
||||||
|
# uncommon ones like /etc[/rc.d]/init.d/functions, and then
|
||||||
|
# source in the LSB functions if they exist (which will
|
||||||
|
# override functions that may be defined in the former
|
||||||
|
# functions library). Finally, if /etc/sysconfig/slpd
|
||||||
|
# exists (like on SCO Linux systems), source it in Just
|
||||||
|
# In Case(tm).
|
||||||
|
if [ -f /etc/rc.d/init.d/functions ]; then
|
||||||
|
. /etc/rc.d/init.d/functions
|
||||||
|
else
|
||||||
|
if [ -f /etc/init.d/functions ]; then
|
||||||
|
. /etc/init.d/functions
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -f /lib/lsb/init-functions ]; then
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
fi
|
||||||
|
if [ -f /etc/sysconfig/$NAME ]; then
|
||||||
|
. /etc/sysconfig/$NAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# No executable daemon, no go...
|
||||||
|
test -x $DAEMON || exit 1
|
||||||
|
|
||||||
|
|
||||||
|
# Lock files seem to be very, very consistent across distros...
|
||||||
|
LOCK=/var/lock/subsys/$NAME
|
||||||
|
|
||||||
|
|
||||||
|
# Run/PID files seem to be consistent as well...
|
||||||
|
RUNPID=/var/run/$NAME
|
||||||
|
|
||||||
|
|
||||||
|
# Make RETVAL default to 0...
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# See how we were called.
|
||||||
|
#
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
# Check if we're already running...
|
||||||
|
if [ ! "$LOCK" = "" ] && [ -f $LOCK ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n 'Starting slpd: '
|
||||||
|
|
||||||
|
# Attempt to guarantee a multicast route...
|
||||||
|
multicast_route_set 1
|
||||||
|
multicast_enabled=$?
|
||||||
|
if [ "$multicast_enabled" != "0" ] ; then
|
||||||
|
echo "Failure: No Route Available for Multicast Traffic"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try to start it up, beginning with LSB, then Red Hat,
|
||||||
|
# then OpenLinux. If there are other methods for starting
|
||||||
|
# daemons and they don't accidentally fall into one of those
|
||||||
|
# categories (look below before jumping to conclusions), let
|
||||||
|
# someone know so this can be fixed...
|
||||||
|
if [ -x /sbin/startproc ]; then
|
||||||
|
startproc $DAEMON $OPTIONS
|
||||||
|
RETVAL=$?
|
||||||
|
elif grep ^startproc\(\) /etc/rc.d/init.d/functions > /dev/null 2>&1 || \
|
||||||
|
grep ^startproc\(\) /etc/init.d/functions > /dev/null 2>&1; then
|
||||||
|
startproc $DAEMON $OPTIONS
|
||||||
|
RETVAL=$?
|
||||||
|
elif grep ^daemon\(\) /etc/rc.d/init.d/functions > /dev/null 2>&1 || \
|
||||||
|
grep ^daemon\(\) /etc/init.d/functions > /dev/null 2>&1; then
|
||||||
|
daemon $DAEMON
|
||||||
|
RETVAL=$?
|
||||||
|
else
|
||||||
|
if [ -x /sbin/ssd ]; then
|
||||||
|
ssd -S -n $NAME -x $DAEMON -- $OPTIONS
|
||||||
|
RETVAL=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $RETVAL -eq 0 ]; then touch $LOCK; fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
# Are we even running? Check first...
|
||||||
|
if [ -f $LOCK ]; then
|
||||||
|
echo -n 'Stopping slpd: '
|
||||||
|
if [ -x /sbin/killproc ]; then
|
||||||
|
killproc $DAEMON
|
||||||
|
RETVAL=$?
|
||||||
|
elif grep killproc\(\) /etc/rc.d/init.d/functions > /dev/null 2>&1 || \
|
||||||
|
grep killproc\(\) /etc/init.d/functions > /dev/null 2>&1; then
|
||||||
|
killproc $DAEMON
|
||||||
|
RETVAL=$?
|
||||||
|
else
|
||||||
|
if [ -x /sbin/ssd ]; then
|
||||||
|
ssd -K -p /var/run/$NAME.pid -n $NAME
|
||||||
|
RETVAL=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $RETVAL -eq 0 ]; then rm -f $LOCK; fi
|
||||||
|
else
|
||||||
|
echo "$NAME is not running"
|
||||||
|
RETVAL=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
;;
|
||||||
|
reload|restart)
|
||||||
|
cd $OLDDIR
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
RETVAL=$?
|
||||||
|
cd /
|
||||||
|
;;
|
||||||
|
condrestart)
|
||||||
|
[ -f $LOCK ] && $0 restart || :
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
if [ -x /sbin/checkproc ]; then
|
||||||
|
/sbin/checkproc $NAME > /dev/null 2>&1
|
||||||
|
elif grep checkproc\(\) /etc/rc.d/init.d/functions > /dev/null 2>&1 || \
|
||||||
|
grep checkproc\(\) /etc/init.d/functions > /dev/null 2>&1; then
|
||||||
|
checkproc $NAME > /dev/null 2>&1
|
||||||
|
elif grep status\(\) /etc/rc.d/init.d/functions > /dev/null 2>&1 || \
|
||||||
|
grep status\(\) /etc/init.d/functions > /dev/null 2>&1; then
|
||||||
|
status $NAME > /dev/null 2>&1
|
||||||
|
else
|
||||||
|
pidof $NAME > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
RETVAL=$?
|
||||||
|
|
||||||
|
if [ $RETVAL -eq 0 ]; then
|
||||||
|
echo "$NAME is running."
|
||||||
|
else
|
||||||
|
echo "$NAME is not running."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: slpd {start|stop|restart|reload|status}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $RETVAL
|
Loading…
Reference in New Issue
Block a user