Remove System V init support

This commit is contained in:
Petr Písař 2012-04-03 17:24:20 +02:00
parent 06e96528b6
commit 4cc2f549f5
2 changed files with 4 additions and 115 deletions

View File

@ -1,102 +0,0 @@
#! /bin/sh
#
# $Id: radvd.init,v 1.6 2009/05/25 06:17:28 psavola Exp $
#
# chkconfig: - 54 46
# 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 \
# Version 6 (IPv6)" (RFC 2461). With these advertisements \
# hosts can automatically configure their addresses and some \
# other parameters. They also can choose a default router \
# based on these advertisements.
#
# processname: radvd
# pidfile: /var/run/radvd/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.
. /etc/rc.d/init.d/functions
# Get config.
. /etc/sysconfig/network
[ -f /etc/sysconfig/radvd ] && . /etc/sysconfig/radvd
RETVAL=0
PROG="radvd"
LOCKFILE=/var/lock/subsys/radvd
PIDFILE=${PIDFILE:-"/var/run/radvd/radvd.pid"}
# 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
;;
stop)
echo -n $"Stopping $PROG: "
killproc radvd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
;;
status)
status radvd
RETVAL=$?
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
reload|force-reload)
$PROG -c
RETVAL=$?
echo -n $"Reloading $PROG: "
if [ $RETVAL -eq 0 ]; then
killproc -p $PIDFILE radvd -HUP
RETVAL=$?
else
echo_failure
echo
echo -n $"not reloading due to configuration syntax error"
fi
echo
;;
condrestart|try-restart)
if [ -f $LOCKFILE ]; then
$0 stop
$0 start
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 2
esac
exit $RETVAL

View File

@ -1,5 +1,3 @@
%define initdir %{_sysconfdir}/rc.d/init.d
%define RADVD_UID 75 %define RADVD_UID 75
Summary: A Router Advertisement daemon Summary: A Router Advertisement daemon
Name: radvd Name: radvd
@ -10,12 +8,11 @@ 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: %{url}dist/%{name}-%{version}.tar.gz Source: %{url}dist/%{name}-%{version}.tar.gz
Source1: radvd.init
Source2: radvd-tmpfs.conf Source2: radvd-tmpfs.conf
Source3: radvd.service Source3: radvd.service
Requires(postun): chkconfig, /usr/sbin/userdel, initscripts, systemd-units Requires(postun): /usr/sbin/userdel, systemd-units
Requires(preun): chkconfig, initscripts, systemd-units Requires(preun): systemd-units
Requires(post): chkconfig, systemd-units Requires(post): systemd-units
Requires(pre): /usr/sbin/useradd Requires(pre): /usr/sbin/useradd
BuildRequires: systemd-units BuildRequires: systemd-units
BuildRequires: flex, flex-static, byacc BuildRequires: flex, flex-static, byacc
@ -53,12 +50,10 @@ make
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
mkdir -p $RPM_BUILD_ROOT%{initdir}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/radvd mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/radvd
mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p $RPM_BUILD_ROOT%{_unitdir}
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 %{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
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
@ -69,7 +64,6 @@ install -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_unitdir}
/bin/systemctl daemon-reload >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ "$1" -ge 1 ]; then if [ "$1" -ge 1 ]; then
/sbin/service radvd condrestart >/dev/null 2>&1
/bin/systemctl try-restart radvd.service >/dev/null 2>&1 || : /bin/systemctl try-restart radvd.service >/dev/null 2>&1 || :
fi fi
@ -81,9 +75,6 @@ fi
%preun %preun
if [ "$1" -eq 0 ]; then if [ "$1" -eq 0 ]; then
/sbin/service radvd stop >/dev/null 2>&1
/sbin/chkconfig --del radvd
/bin/systemctl disable radvd.service > /dev/null 2>&1 || : /bin/systemctl disable radvd.service > /dev/null 2>&1 || :
/bin/systemctl stop radvd.service > /dev/null 2>&1 || : /bin/systemctl stop radvd.service > /dev/null 2>&1 || :
fi fi
@ -100,7 +91,6 @@ exit 0
%config(noreplace) %{_sysconfdir}/radvd.conf %config(noreplace) %{_sysconfdir}/radvd.conf
%config(noreplace) %{_sysconfdir}/sysconfig/radvd %config(noreplace) %{_sysconfdir}/sysconfig/radvd
%config(noreplace) %{_sysconfdir}/tmpfiles.d/radvd.conf %config(noreplace) %{_sysconfdir}/tmpfiles.d/radvd.conf
%{initdir}/radvd
%dir %attr(-,radvd,radvd) %{_localstatedir}/run/radvd/ %dir %attr(-,radvd,radvd) %{_localstatedir}/run/radvd/
%doc radvd.conf.example %doc radvd.conf.example
%{_mandir}/*/* %{_mandir}/*/*
@ -110,6 +100,7 @@ exit 0
%changelog %changelog
* Tue Apr 03 2012 Petr Pisar <ppisar@redhat.com> - 1.8.5-2 * Tue Apr 03 2012 Petr Pisar <ppisar@redhat.com> - 1.8.5-2
- Clean up spec file - Clean up spec file
- Remove System V init support
* Wed Feb 01 2012 Jiri Skala <jskala@redhat.com> - 1.8.5-1 * Wed Feb 01 2012 Jiri Skala <jskala@redhat.com> - 1.8.5-1
- update to latest upstream version 1.8.5 - update to latest upstream version 1.8.5