fixes #712467 - type in init.d script causes strange message on boot

This commit is contained in:
Jiri Skala 2011-06-23 08:27:54 +02:00
parent 2a7688441f
commit 093e5c6f4c
2 changed files with 59 additions and 79 deletions

View File

@ -1,6 +1,6 @@
diff -up quagga-0.99.16/redhat/bgpd.init.posix quagga-0.99.16/redhat/bgpd.init
--- quagga-0.99.16/redhat/bgpd.init.posix 2010-03-17 14:11:26.681170285 +0100
+++ quagga-0.99.16/redhat/bgpd.init 2010-03-17 14:13:47.943170024 +0100
diff -up quagga-0.99.18/redhat/bgpd.init.posix quagga-0.99.18/redhat/bgpd.init
--- quagga-0.99.18/redhat/bgpd.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/bgpd.init 2011-06-23 07:59:24.667297792 +0200
@@ -1,10 +1,12 @@
#!/bin/bash
-#
@ -31,16 +31,13 @@ diff -up quagga-0.99.16/redhat/bgpd.init.posix quagga-0.99.16/redhat/bgpd.init
-[ -f /etc/quagga/bgpd.conf ] || exit 0
RETVAL=0
-prog="bgpd"
+PROG="bgpd"
prog="bgpd"
+cmd=bgpd
+LOCK_FILE=/var/lock/subsys/bgpd
+CONF_FILE=/etc/quagga/bgpd.conf
case "$1" in
start)
- echo -n $"Starting $prog: "
- daemon /usr/sbin/bgpd -d $BGPD_OPTS
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
@ -51,7 +48,8 @@ diff -up quagga-0.99.16/redhat/bgpd.init.posix quagga-0.99.16/redhat/bgpd.init
+ exit 4
+ fi
+
+ echo -n $"Starting $PROG: "
echo -n $"Starting $prog: "
- daemon /usr/sbin/bgpd -d $BGPD_OPTS
+ daemon $cmd -d $BGPD_OPTS
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
@ -59,9 +57,8 @@ diff -up quagga-0.99.16/redhat/bgpd.init.posix quagga-0.99.16/redhat/bgpd.init
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc bgpd
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd
@ -96,9 +93,9 @@ diff -up quagga-0.99.16/redhat/bgpd.init.posix quagga-0.99.16/redhat/bgpd.init
esac
exit $RETVAL
diff -up quagga-0.99.16/redhat/isisd.init.posix quagga-0.99.16/redhat/isisd.init
--- quagga-0.99.16/redhat/isisd.init.posix 2010-03-17 14:11:26.704385156 +0100
+++ quagga-0.99.16/redhat/isisd.init 2010-03-17 14:13:47.943170024 +0100
diff -up quagga-0.99.18/redhat/isisd.init.posix quagga-0.99.18/redhat/isisd.init
--- quagga-0.99.18/redhat/isisd.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/isisd.init 2011-06-23 08:00:18.521827074 +0200
@@ -1,40 +1,44 @@
#!/bin/bash
-#
@ -129,23 +126,21 @@ diff -up quagga-0.99.16/redhat/isisd.init.posix quagga-0.99.16/redhat/isisd.init
-
RETVAL=0
-
-prog="isisd"
+PROG="isisd"
prog="isisd"
+cmd=isisd
+LOCK_FILE=/var/lock/subsys/isisd
+CONF_FILE=/etc/quagga/isisd.conf
case "$1" in
start)
- echo -n $"Starting $prog: "
- daemon /usr/sbin/isisd -d
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
+ # The process must be configured first.
+ [ -f $CONF_FILE] || exit 6
+
+ echo -n $"Starting $PROG: "
echo -n $"Starting $prog: "
- daemon /usr/sbin/isisd -d
+ daemon $cmd -d
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/isisd
@ -153,9 +148,8 @@ diff -up quagga-0.99.16/redhat/isisd.init.posix quagga-0.99.16/redhat/isisd.init
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc isisd
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/isisd
@ -186,9 +180,9 @@ diff -up quagga-0.99.16/redhat/isisd.init.posix quagga-0.99.16/redhat/isisd.init
esac
exit $RETVAL
diff -up quagga-0.99.16/redhat/ospf6d.init.posix quagga-0.99.16/redhat/ospf6d.init
--- quagga-0.99.16/redhat/ospf6d.init.posix 2010-03-17 14:11:26.707387563 +0100
+++ quagga-0.99.16/redhat/ospf6d.init 2010-03-17 14:13:47.944168987 +0100
diff -up quagga-0.99.18/redhat/ospf6d.init.posix quagga-0.99.18/redhat/ospf6d.init
--- quagga-0.99.18/redhat/ospf6d.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/ospf6d.init 2011-06-23 08:01:10.300338342 +0200
@@ -1,11 +1,13 @@
#!/bin/bash
-#
@ -219,16 +213,13 @@ diff -up quagga-0.99.16/redhat/ospf6d.init.posix quagga-0.99.16/redhat/ospf6d.in
-[ -f /etc/quagga/ospf6d.conf ] || exit 0
-
RETVAL=0
-prog="ospf6d"
+PROG="ospf6d"
prog="ospf6d"
+cmd=ospf6d
+LOCK_FILE=/var/lock/subsys/ospf6d
+CONF_FILE=/etc/quagga/ospf6d.conf
case "$1" in
start)
- echo -n $"Starting $prog: "
- daemon /usr/sbin/ospf6d -d $OSPF6D_OPTS
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
@ -239,7 +230,8 @@ diff -up quagga-0.99.16/redhat/ospf6d.init.posix quagga-0.99.16/redhat/ospf6d.in
+ exit 4
+ fi
+
+ echo -n $"Starting $PROG: "
echo -n $"Starting $prog: "
- daemon /usr/sbin/ospf6d -d $OSPF6D_OPTS
+ daemon $cmd -d $OSPF6D_OPTS
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospf6d
@ -247,9 +239,8 @@ diff -up quagga-0.99.16/redhat/ospf6d.init.posix quagga-0.99.16/redhat/ospf6d.in
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc ospf6d
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospf6d
@ -279,14 +270,14 @@ diff -up quagga-0.99.16/redhat/ospf6d.init.posix quagga-0.99.16/redhat/ospf6d.in
*)
- echo $"Usage: $prog {start|stop|restart|reload|condrestart|status}"
- exit 1
+ echo $"Usage: $PROG {start|stop|restart|reload|force-reload|try-restart|status}"
+ echo $"Usage: $prog {start|stop|restart|reload|force-reload|try-restart|status}"
+ exit 2
esac
exit $RETVAL
diff -up quagga-0.99.16/redhat/ospfd.init.posix quagga-0.99.16/redhat/ospfd.init
--- quagga-0.99.16/redhat/ospfd.init.posix 2010-03-17 14:11:26.709400924 +0100
+++ quagga-0.99.16/redhat/ospfd.init 2010-03-17 14:13:47.944168987 +0100
diff -up quagga-0.99.18/redhat/ospfd.init.posix quagga-0.99.18/redhat/ospfd.init
--- quagga-0.99.18/redhat/ospfd.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/ospfd.init 2011-06-23 08:05:18.015727018 +0200
@@ -1,11 +1,13 @@
#!/bin/bash
-#
@ -318,16 +309,13 @@ diff -up quagga-0.99.16/redhat/ospfd.init.posix quagga-0.99.16/redhat/ospfd.init
-
RETVAL=0
-
-prog="ospfd"
+PROG="ospfd"
prog="ospfd"
+cmd=ospfd
+LOCK_FILE=/var/lock/subsys/ospfd
+CONF_FILE=/etc/quagga/ospfd.conf
case "$1" in
start)
- echo -n $"Starting $prog: "
- daemon /usr/sbin/ospfd -d $OSPFD_OPTS
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
@ -338,7 +326,8 @@ diff -up quagga-0.99.16/redhat/ospfd.init.posix quagga-0.99.16/redhat/ospfd.init
+ exit 4
+ fi
+
+ echo -n $"Starting $PROG: "
echo -n $"Starting $prog: "
- daemon /usr/sbin/ospfd -d $OSPFD_OPTS
+ daemon $cmd -d $OSPFD_OPTS
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd
@ -346,9 +335,8 @@ diff -up quagga-0.99.16/redhat/ospfd.init.posix quagga-0.99.16/redhat/ospfd.init
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc ospfd
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospfd
@ -378,14 +366,14 @@ diff -up quagga-0.99.16/redhat/ospfd.init.posix quagga-0.99.16/redhat/ospfd.init
*)
- echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
- exit 1
+ echo $"Usage: $PROG {start|stop|restart|reload|force-reload|try-restart|status}"
+ echo $"Usage: $0 {start|stop|restart|reload|force-reload|try-restart|status}"
+ exit 2
esac
exit $RETVAL
diff -up quagga-0.99.16/redhat/ripd.init.posix quagga-0.99.16/redhat/ripd.init
--- quagga-0.99.16/redhat/ripd.init.posix 2010-03-17 14:11:26.711384881 +0100
+++ quagga-0.99.16/redhat/ripd.init 2010-03-17 14:13:47.944168987 +0100
diff -up quagga-0.99.18/redhat/ripd.init.posix quagga-0.99.18/redhat/ripd.init
--- quagga-0.99.18/redhat/ripd.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/ripd.init 2011-06-23 08:02:29.469123630 +0200
@@ -1,11 +1,13 @@
#!/bin/bash
-#
@ -416,16 +404,13 @@ diff -up quagga-0.99.16/redhat/ripd.init.posix quagga-0.99.16/redhat/ripd.init
-[ -f /etc/quagga/ripd.conf ] || exit 0
-
RETVAL=0
-prog="ripd"
+PROG="ripd"
prog="ripd"
+cmd=ripd
+LOCK_FILE=/var/lock/subsys/ripd
+CONF_FILE=/etc/quagga/ripd.conf
case "$1" in
start)
- echo -n $"Starting $prog: "
- daemon /usr/sbin/ripd -d $RIPD_OPTS
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
@ -436,7 +421,8 @@ diff -up quagga-0.99.16/redhat/ripd.init.posix quagga-0.99.16/redhat/ripd.init
+ exit 4
+ fi
+
+ echo -n $"Starting $PROG: "
echo -n $"Starting $prog: "
- daemon /usr/sbin/ripd -d $RIPD_OPTS
+ daemon $cmd -d $RIPD_OPTS
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd
@ -444,9 +430,8 @@ diff -up quagga-0.99.16/redhat/ripd.init.posix quagga-0.99.16/redhat/ripd.init
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc ripd
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripd
@ -481,9 +466,9 @@ diff -up quagga-0.99.16/redhat/ripd.init.posix quagga-0.99.16/redhat/ripd.init
esac
exit $RETVAL
diff -up quagga-0.99.16/redhat/ripngd.init.posix quagga-0.99.16/redhat/ripngd.init
--- quagga-0.99.16/redhat/ripngd.init.posix 2010-03-17 14:11:26.713385042 +0100
+++ quagga-0.99.16/redhat/ripngd.init 2010-03-17 14:13:47.945166204 +0100
diff -up quagga-0.99.18/redhat/ripngd.init.posix quagga-0.99.18/redhat/ripngd.init
--- quagga-0.99.18/redhat/ripngd.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/ripngd.init 2011-06-23 08:03:56.861960182 +0200
@@ -1,11 +1,13 @@
#!/bin/bash
-#
@ -514,16 +499,13 @@ diff -up quagga-0.99.16/redhat/ripngd.init.posix quagga-0.99.16/redhat/ripngd.in
-[ -f /etc/quagga/ripngd.conf ] || exit 0
-
RETVAL=0
-prog="ripngd"
+PROG="ripngd"
prog="ripngd"
+cmd=ripngd
+LOCK_FILE=/var/lock/subsys/ripngd
+CONF_FILE=/etc/quagga/ripngd.conf
case "$1" in
start)
- echo -n $"Starting $prog: "
- daemon /usr/sbin/ripngd -d $RIPNGD_OPTS
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
@ -534,7 +516,8 @@ diff -up quagga-0.99.16/redhat/ripngd.init.posix quagga-0.99.16/redhat/ripngd.in
+ exit 4
+ fi
+
+ echo -n $"Starting $PROG: "
echo -n $"Starting $prog: "
- daemon /usr/sbin/ripngd -d $RIPNGD_OPTS
+ daemon $cmd -d $RIPNGD_OPTS
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripngd
@ -542,9 +525,8 @@ diff -up quagga-0.99.16/redhat/ripngd.init.posix quagga-0.99.16/redhat/ripngd.in
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc ripngd
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripngd
@ -579,9 +561,9 @@ diff -up quagga-0.99.16/redhat/ripngd.init.posix quagga-0.99.16/redhat/ripngd.in
esac
exit $RETVAL
diff -up quagga-0.99.16/redhat/watchquagga.init.posix quagga-0.99.16/redhat/watchquagga.init
--- quagga-0.99.16/redhat/watchquagga.init.posix 2010-03-17 14:11:26.715399800 +0100
+++ quagga-0.99.16/redhat/watchquagga.init 2010-03-17 14:13:47.945166204 +0100
diff -up quagga-0.99.18/redhat/watchquagga.init.posix quagga-0.99.18/redhat/watchquagga.init
--- quagga-0.99.18/redhat/watchquagga.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/watchquagga.init 2011-06-23 07:56:03.668356453 +0200
@@ -1,9 +1,10 @@
#!/bin/bash
-#
@ -608,8 +590,7 @@ diff -up quagga-0.99.16/redhat/watchquagga.init.posix quagga-0.99.16/redhat/watc
-[ -z "$WATCH_DAEMONS" ] && exit 0
-
RETVAL=0
-prog="watchquagga"
+PROG="watchquagga"
prog="watchquagga"
+cmd=watchquagga
+LOCK_FILE=/var/lock/subsys/watchquagga
@ -630,9 +611,8 @@ diff -up quagga-0.99.16/redhat/watchquagga.init.posix quagga-0.99.16/redhat/watc
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc watchquagga
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/watchquagga
@ -663,9 +643,9 @@ diff -up quagga-0.99.16/redhat/watchquagga.init.posix quagga-0.99.16/redhat/watc
esac
exit $RETVAL
diff -up quagga-0.99.16/redhat/zebra.init.posix quagga-0.99.16/redhat/zebra.init
--- quagga-0.99.16/redhat/zebra.init.posix 2010-03-17 14:11:26.717385084 +0100
+++ quagga-0.99.16/redhat/zebra.init 2010-03-17 14:13:47.945166204 +0100
diff -up quagga-0.99.18/redhat/zebra.init.posix quagga-0.99.18/redhat/zebra.init
--- quagga-0.99.18/redhat/zebra.init.posix 2011-03-21 10:43:52.000000000 +0100
+++ quagga-0.99.18/redhat/zebra.init 2011-06-23 08:02:51.437338441 +0200
@@ -1,64 +1,72 @@
#!/bin/bash
-#
@ -696,15 +676,13 @@ diff -up quagga-0.99.16/redhat/zebra.init.posix quagga-0.99.16/redhat/zebra.init
-
RETVAL=0
-
-prog="zebra"
+PROG="zebra"
prog="zebra"
+cmd=zebra
+LOCK_FILE=/var/lock/subsys/zebra
+CONF_FILE=/etc/quagga/zebra.conf
case "$1" in
start)
- echo -n $"Starting $prog: "
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
@ -715,7 +693,7 @@ diff -up quagga-0.99.16/redhat/zebra.init.posix quagga-0.99.16/redhat/zebra.init
+ exit 4
+ fi
+
+ echo -n $"Starting $PROG: "
echo -n $"Starting $prog: "
/sbin/ip route flush proto zebra
@ -727,9 +705,8 @@ diff -up quagga-0.99.16/redhat/zebra.init.posix quagga-0.99.16/redhat/zebra.init
echo
;;
stop)
- echo -n $"Shutting down $prog: "
echo -n $"Shutting down $prog: "
- killproc zebra
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra

View File

@ -32,7 +32,7 @@
Summary: Routing daemon
Name: quagga
Version: 0.99.18
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
Group: System Environment/Daemons
Source0: http://www.quagga.net/download/%{name}-%{version}.tar.gz
@ -381,6 +381,9 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
* Thu Jun 23 2011 Jiri Skala <jskala@redhat.com> - 0.99.18-2
- fixes #712467 - type in init.d script causes strange message on boot
* Wed Mar 23 2011 Jiri Skala <jskala@redhat.com> - 0.99.18-1
- fixes #689852 - CVE-2010-1674 CVE-2010-1675 quagga various flaws
- fixes #689763 - updated to latest upstream version 0.99.18