- spec file uses Source1 for radvd.init no more init from tarball

- radvd.init modified to make rmplint more silent
- removed userdel usage from postun
This commit is contained in:
Jiri Skala 2010-01-25 15:18:04 +00:00
parent 87712e97c6
commit 22fa413590
2 changed files with 59 additions and 55 deletions

View File

@ -1,11 +1,8 @@
#! /bin/sh
#
# $Id: radvd.init,v 1.4 2007/12/01 08:50:16 psavola Exp $
# $Id: radvd.init,v 1.6 2009/05/25 06:17:28 psavola Exp $
#
### BEGIN INIT INFO
# provides: radvd
# chkconfig: - 54 46
# short-Description: router advertisement daemon for IPv6
# description: radvd is the router advertisement daemon for IPv6. It \
# listens to router solicitations and sends router \
# advertisements as described in "Neighbor Discovery for IP \
@ -18,6 +15,10 @@
# pidfile: /var/run/radvd.pid
# config: /etc/radvd.conf
# config: /etc/sysconfig/radvd
### BEGIN INIT INFO
# Provides: radvd
# Short-Description: router advertisement daemon for IPv6
### END INIT INFO
# Source function library.
@ -35,58 +36,58 @@ LOCKFILE=/var/lock/subsys/radvd
# See how we were called.
case "$1" in
start)
if [ ! -f /etc/radvd.conf ]; then
echo $"Configuration file /etc/radvd.conf missing" 1>&2
exit 6
fi
if [ `id -u` -ne 0 ]; then
echo $"Insufficient privilege" 1>&2
exit 4
fi
echo -n $"Starting $PROG: "
daemon radvd $OPTIONS
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
touch $LOCKFILE
else
if [ -f $LOCKFILE ]; then
RETVAL=0
fi
fi
;;
if [ ! -f /etc/radvd.conf ]; then
echo $"Configuration file /etc/radvd.conf missing" 1>&2
exit 6
fi
if [ `id -u` -ne 0 ]; then
echo $"Insufficient privilege" 1>&2
exit 4
fi
echo -n $"Starting $PROG: "
daemon radvd $OPTIONS
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
touch $LOCKFILE
else
if [ -f $LOCKFILE ]; then
RETVAL=0
fi
fi
;;
stop)
echo -n $"Stopping $PROG: "
killproc radvd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
;;
echo -n $"Stopping $PROG: "
killproc radvd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
;;
status)
status radvd
RETVAL=$?
;;
status radvd
RETVAL=$?
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
$0 stop
$0 start
RETVAL=$?
;;
reload|force-reload)
echo -n $"Reloading $PROG: "
killproc radvd -HUP
RETVAL=$?
echo
;;
echo -n $"Reloading $PROG: "
killproc radvd -HUP
RETVAL=$?
echo
;;
condrestart|try-restart)
if [ -f $LOCKFILE ]; then
$0 stop
$0 start
RETVAL=$?
fi
;;
if [ -f $LOCKFILE ]; then
$0 stop
$0 start
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 2
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 2
esac
exit $RETVAL

View File

@ -5,12 +5,13 @@
Summary: A Router Advertisement daemon
Name: radvd
Version: 1.5
Release: 2%{?dist}
Release: 3%{?dist}
# The code includes the advertising clause, so it's GPL-incompatible
License: BSD with advertising
Group: System Environment/Daemons
URL: http://www.litech.org/radvd/
Source: http://www.litech.org/radvd/dist/%{name}-%{version}.tar.gz
Source1: radvd.init
Requires(postun): chkconfig, /usr/sbin/userdel, initscripts
Requires(preun): chkconfig, initscripts
Requires(post): chkconfig
@ -57,7 +58,7 @@ mkdir -p $RPM_BUILD_ROOT%{initdir}
mkdir -p $RPM_BUILD_ROOT/var/run/radvd
install -m 644 redhat/radvd.conf.empty $RPM_BUILD_ROOT%{_sysconfdir}/radvd.conf
install -m 755 redhat/radvd.init $RPM_BUILD_ROOT%{initdir}/radvd
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{initdir}/radvd
install -m 644 redhat/radvd.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/radvd
%clean
@ -67,9 +68,6 @@ install -m 644 redhat/radvd.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ra
if [ "$1" -ge "1" ]; then
/sbin/service radvd condrestart >/dev/null 2>&1
fi
if [ $1 = 0 ]; then
/usr/sbin/userdel radvd > /dev/null 2>&1 || :
fi
%post
/sbin/chkconfig --add radvd
@ -97,6 +95,11 @@ fi
%{_sbindir}/radvdump
%changelog
* Mon Jan 25 2010 Jiri Skala <jskala@redhat.com> - 1.5-3
- spec file uses Source1 for radvd.init no more init from tarball
- radvd.init modified to make rmplint more silent
- removed userdel usage from postun
* Wed Jan 13 2010 Jan Gorig <jgorig@redhat.com> - 1.5-2
- mistake in last build