From 86a5c32b78a36075f71701c4a1b10f87f6b428d4 Mon Sep 17 00:00:00 2001 From: Jiri Skala Date: Wed, 19 Jan 2011 10:01:06 +0100 Subject: [PATCH] - fixes #670380 - added /etc/sysconfig/rdisc, modified initscript - initscript moved to git --- .gitignore | 2 -- iputils.spec | 10 +++++- rdisc.initd | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ rdisc.sysconfig | 1 + sources | 1 - 5 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 rdisc.initd create mode 100644 rdisc.sysconfig diff --git a/.gitignore b/.gitignore index 2b0ee47..4f44bfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ iputils-s20100418.tar.bz2 -rdisc.initd ifenslave.tar.gz /iputils-s20101006.tar.bz2 /ifenslave.tar.gz -/rdisc.initd diff --git a/iputils.spec b/iputils.spec index 5d414c8..8ed5ae2 100644 --- a/iputils.spec +++ b/iputils.spec @@ -1,7 +1,7 @@ Summary: Network monitoring tools including ping Name: iputils Version: 20101006 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD URL: http://www.skbuff.net/iputils Group: System Environment/Daemons @@ -10,6 +10,7 @@ Source0: http://www.skbuff.net/iputils/%{name}-s%{version}.tar.bz2 Source1: ifenslave.tar.gz Source3: rdisc.initd Source4: rdisc.service +Source5: rdisc.sysconfig Patch0: iputils-20020927-rh.patch Patch1: iputils-20020124-countermeasures.patch @@ -84,6 +85,7 @@ rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} mkdir -p ${RPM_BUILD_ROOT}/{bin,sbin} mkdir -p $RPM_BUILD_ROOT/lib/systemd/system +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig install -c clockdiff ${RPM_BUILD_ROOT}%{_sbindir}/ install -cp arping ${RPM_BUILD_ROOT}/sbin/ @@ -112,6 +114,7 @@ ln -s tracepath.8.gz ${RPM_BUILD_ROOT}%{_mandir}/man8/tracepath6.8.gz install -dp ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d install -m 755 -p %SOURCE3 ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d/rdisc +install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/rdisc install -m 644 %SOURCE4 ${RPM_BUILD_ROOT}/lib/systemd/system iconv -f ISO88591 -t UTF8 RELNOTES -o RELNOTES.tmp @@ -164,8 +167,13 @@ rm -rf ${RPM_BUILD_ROOT} %{_sbindir}/tracepath6 %attr(644,root,root) %{_mandir}/man8/* %{_sysconfdir}/rc.d/init.d/rdisc +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/rdisc %changelog +* Wed Jan 19 2011 Jiri Skala - 20101006-5 +- fixes #670380 - added /etc/sysconfig/rdisc, modified initscript +- initscript moved to git + * Wed Dec 15 2010 Jiri Skala - 20101006-4 - fixes #662720 - Providing native systemd file - freeing memory when capabilities are dropped diff --git a/rdisc.initd b/rdisc.initd new file mode 100644 index 0000000..a70e0da --- /dev/null +++ b/rdisc.initd @@ -0,0 +1,87 @@ +#!/bin/bash +# +# $Id: rdisc,v 1.5 2005/04/05 10:06:01 bastian Exp $ +# +### BEGIN INIT INFO +# Provides: rdisc +# Short-Description: This is a daemon which discovers routers on the local subnet. +# Description: This is a daemon which discovers routers on the local subnet. +### END INIT INFO + +# chkconfig: - 41 89 +# config: /etc/sysconfig/rdisc + +# Source function library. +. /etc/init.d/functions +. /etc/sysconfig/network + +LOCKFILE=/var/lock/subsys/rdisc + +# Set default options in /etc/sysconfig/rdisc +[ -f /etc/sysconfig/rdisc ] && . /etc/sysconfig/rdisc +RDISCOPTS=${RDISCOPTS:-"-s"} + +start() { + # Check that networking is configured. + [ ${NETWORKING} = "no" ] && exit 1 + + echo -n $"Starting router discovery: " + if [ $UID -ne 0 ]; then + RETVAL=4 + failure + else + daemon /sbin/rdisc $RDISCOPTS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch $LOCKFILE + fi; + echo + return $RETVAL +} + +stop() { + echo -n $"Shutting down router discovery services: " + if [ $UID -ne 0 ]; then + RETVAL=4 + failure + else + killproc /sbin/rdisc + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE + fi; + echo + return $RETVAL +} + +restart() { + stop + start +} + +RETVAL=0 + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status rdisc + ;; + restart|reload) + restart + ;; + condrestart) + if status $prog > /dev/null; then + stop + start + fi + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|reload}" + exit 2 +esac + +exit $? diff --git a/rdisc.sysconfig b/rdisc.sysconfig new file mode 100644 index 0000000..bd11c2a --- /dev/null +++ b/rdisc.sysconfig @@ -0,0 +1 @@ +RDISCOPTS="-s" diff --git a/sources b/sources index 18607d1..8dfcea7 100644 --- a/sources +++ b/sources @@ -1,3 +1,2 @@ a36c25e9ec17e48be514dc0485e7376c iputils-s20101006.tar.bz2 5f2b3099a83a9561c98d5ee6b7c4f634 ifenslave.tar.gz -b044213f027e70a2cc1aa882e21fba3b rdisc.initd