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

View File

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