diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-07 07:59:53 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-07 08:56:41 +0000 |
commit | a96582b446211fcc07725f3b19240f01863b0354 (patch) | |
tree | 3a8c2a7ed0ee328c6fd986d51240fec30ff5127f /main/quagga | |
parent | ac131f247b8c338fb3925ed1222c2666419fca60 (diff) | |
download | aports-a96582b446211fcc07725f3b19240f01863b0354.tar.bz2 aports-a96582b446211fcc07725f3b19240f01863b0354.tar.xz |
main/quagga: create /var/run/quagga at startup
and refactor the scripts while at it
ref #2294
Diffstat (limited to 'main/quagga')
-rw-r--r-- | main/quagga/APKBUILD | 35 | ||||
-rw-r--r-- | main/quagga/bgpd.initd | 38 | ||||
-rw-r--r-- | main/quagga/ospf6d.initd | 34 | ||||
-rw-r--r-- | main/quagga/ospfd.initd | 34 | ||||
-rw-r--r-- | main/quagga/ripd.initd | 34 | ||||
-rw-r--r-- | main/quagga/ripngd.initd | 34 | ||||
-rw-r--r-- | main/quagga/zebra.initd | 42 |
7 files changed, 41 insertions, 210 deletions
diff --git a/main/quagga/APKBUILD b/main/quagga/APKBUILD index 64b42a9c80..7795e1dda3 100644 --- a/main/quagga/APKBUILD +++ b/main/quagga/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=quagga pkgver=0.99.22.4 -pkgrel=2 +pkgrel=3 pkgdesc="A free routing daemon replacing Zebra supporting RIP, OSPF and BGP." url="http://quagga.net/" arch="all" @@ -15,10 +15,6 @@ pkggroups="quagga" source="http://download.savannah.gnu.org/releases/quagga/quagga-$pkgver.tar.xz musl-fix-headers.patch bgpd.initd - ospf6d.initd - ospfd.initd - ripd.initd - ripngd.initd zebra.initd zebra.confd " @@ -65,36 +61,27 @@ package() { rm "$pkgdir"/usr/lib/*.la || return 1 install -o quagga -g quagga -d "$pkgdir"/var/run/quagga - for i in zebra ripd ospfd bgpd ripngd ospf6d; do + for i in zebra bgpd; do install -Dm755 "$srcdir"/$i.initd "$pkgdir"/etc/init.d/$i done + for i in ripd ospfd ripngd ospf6d; do + ln -s bgpd "$pkgdir"/etc/init.d/$i || return 1 + done install -Dm644 "$srcdir/zebra.confd" "$pkgdir"/etc/conf.d/zebra install -o quagga -g quagga -d -m755 "$pkgdir"/etc/quagga } md5sums="03ef24a448be47beba80efa2152f8a28 quagga-0.99.22.4.tar.xz 27812f0aaaf8507c4338371aca1bd08d musl-fix-headers.patch -ec7ac8cc1103f023cf5b9482b26ece59 bgpd.initd -92aba039c049050c48abf984c2db7e2b ospf6d.initd -878328ead225e6eb5f5f77f05ab39106 ospfd.initd -5945863133a0db33898c5c39ef23663c ripd.initd -cda4115283d9f4a8304fec1b6881a7eb ripngd.initd -172e5b0e3f169e2b3328123e73517084 zebra.initd +e80a3df594eba8b09e19aa28d9283698 bgpd.initd +33d0e34f11460881161ab930d3d3b987 zebra.initd 34e06a1d2bc602ce691abc9ed169dd15 zebra.confd" sha256sums="5e12056692e2dbc272a929f96d0e98d9873f4e7f7ffcca62434b58f6660a6386 quagga-0.99.22.4.tar.xz 19068f58f034891c07b8a1324d0645e0f078e3dc98d1360d51c677cecaae8c9e musl-fix-headers.patch -962afa79a0bcb781acc4c367ed55ccea2fbb927cf1271bc1fefaffcbb2f9389a bgpd.initd -f1017e7681692d99eab6f9842313be18104612055bcdab14dd7ac4ac1be38f53 ospf6d.initd -fed815e6530551f314297704e5491f5d2eeb16e930dcff6f12edc88a78b6023a ospfd.initd -36abd1158130a9268b6b852b7511a3457f8a17528f7d1b8a0b3f8ac41248a3c3 ripd.initd -565b6c0380a0010f464e37490468d58b9867bf6cfcbb36ac682a5e2760c40191 ripngd.initd -ca7c252cc1c79f05a55f933317d9a7f523dc6501bf5c72c553c43da4f8fd68dd zebra.initd +41471bfda120cb57bc0f40e87ec23a4f150d2b97c97ececdda6c408eab7cf9a3 bgpd.initd +d6cc9280df63859ba711ad2071b38b9ce317d718c34840a2b101debef3fa7b56 zebra.initd f7a52d383f60270a5a8fee5d4ac522c5c0ec2b7c4b5252cff54e260f32d9b323 zebra.confd" sha512sums="bcf429e71073e4fc71efc364a21a6c8b70871a17c66bd1328bc57b57962c2c15182436183b2e363c9c1c0e85d84c49d304d4049d40129272f52d6140db330b8a quagga-0.99.22.4.tar.xz 28a1695bd77991790df3b1b5a2c8ced929e6413e9acb87c4a8286569d05b20e65cba466e118fc16a11c264ba11dd1581e4143031ce3bbb478177e900ea68cb07 musl-fix-headers.patch -a865d9f5d2593270abc56dc65785317115337da00e8f389df3bf9af314052a4dc9e8f7af1142f7726637e06f1d8f7640cafd2a9e5ee8a7b4fd6b4e7b7c5bc784 bgpd.initd -f76aaacb1949a528a71a4bb69e9b6fa522c507000e8fa0cd60e0d80b8d2820155fa40fe7dedd86bdf38dc8029b1958c90bfbc8423afc737aae59248adba906b3 ospf6d.initd -fa3edb10d5b543c3f53a4dbd82edcda011be01f2d94b7b208cc02c1137a33adb703b734e7a4f22a51ec4d66203c44918dc9441be02b67248858b413146c61c16 ospfd.initd -95c96968133ed082a9e49661d1ea66fbeeb871d9bdd0dc5602953360e73ec2a83992c787f745211448629e3d90e69dc38a5fcae948825a7a73d3f2e4b8b91cc6 ripd.initd -6dbb662755ef84827768f2ed4779205e52b7eae50d377af5e4a951eb94317dbce3958184deb70dd3aa27f96d614e0be4d0fe2d871d961f4ffceaa84de454181c ripngd.initd -978a61e24ec9fc5558df550894f24cde4b729f88243e3f3d45394ec78009e22a87116c5a1dc4c382c7fa41e888155c8d901fc6028fba1cf9554349d4b432524e zebra.initd +d2bf7e8f2da49d0b039e72e76a77860b5b49d41a80550d6dc84791bbdec1d52e579393c5d42b45aa615991742421fef53ec1b92a5e740779b6060e20f5dd0413 bgpd.initd +a4955fe54729ec8cb17b72f3d2205d0a4ba814a51a5eb3635a85339de9a2d2342e4814ef8b1e011803fa1dc3c6f9a23b178848e0812576876343104854feb723 zebra.initd 900972c6f98e561dfacf384111251db262326e8764b8c763a5ef639fa11c7949c03eef5e3bce324a4b1964fe45416d2db74ae1b6bc967f7d4ba48c2eeda017c4 zebra.confd" diff --git a/main/quagga/bgpd.initd b/main/quagga/bgpd.initd index 92ed536f3d..4607a2ad13 100644 --- a/main/quagga/bgpd.initd +++ b/main/quagga/bgpd.initd @@ -1,34 +1,22 @@ #!/sbin/runscript -# Copyright 1999-2003 DataCore GmbH, Amir Guindehi -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/bgpd.init,v 1.1 2005/09/14 11:11:08 mrness Exp $ + +piddir=/var/run/quagga +pidfile=$piddir/$SVCNAME.pid +command=/usr/sbin/$SVCNAME +command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile" depend() { need net zebra after firewall opennhrp } -checkconfig() { - if [ ! -e /etc/quagga/bgpd.conf ] ; then - eerror "You need to create /etc/quagga/bgpd.conf first." - eerror "An example can be found in /etc/quagga/samples/bgpd.conf.sample" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting bgpd" - start-stop-daemon --start --quiet --exec /usr/sbin/bgpd \ - -- -d -f /etc/quagga/bgpd.conf \ - --pid_file /var/run/quagga/bgpd.pid - result=$? - eend $result +start_pre() { + if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then + eerror "You need to create /etc/quagga/$SVCNAME.conf first." + eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample" + eerror "from quagga-doc package" + return 1 + fi + checkpath --owner quagga:quagga --directory $piddir } -stop() { - ebegin "Stopping bgpd" - start-stop-daemon --stop --quiet --pidfile /var/run/quagga/bgpd.pid - result=$? - eend $result -} diff --git a/main/quagga/ospf6d.initd b/main/quagga/ospf6d.initd deleted file mode 100644 index 884a7e9818..0000000000 --- a/main/quagga/ospf6d.initd +++ /dev/null @@ -1,34 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2003 DataCore GmbH, Amir Guindehi -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/ospf6d.init,v 1.1 2005/09/14 11:11:08 mrness Exp $ - -depend() { - need net zebra - after firewall -} - -checkconfig() { - if [ ! -e /etc/quagga/ospf6d.conf ] ; then - eerror "You need to create /etc/quagga/ospf6d.conf first." - eerror "An example can be found in /etc/quagga/samples/ospf6d.conf.sample" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting ospf6d" - start-stop-daemon --start --quiet --exec /usr/sbin/ospf6d \ - -- -d -f /etc/quagga/ospf6d.conf \ - --pid_file /var/run/quagga/ospf6d.pid - result=$? - eend $result -} - -stop() { - ebegin "Stopping ospf6d" - start-stop-daemon --stop --quiet --pidfile /var/run/quagga/ospf6d.pid - result=$? - eend $result -} diff --git a/main/quagga/ospfd.initd b/main/quagga/ospfd.initd deleted file mode 100644 index 5eeb44677f..0000000000 --- a/main/quagga/ospfd.initd +++ /dev/null @@ -1,34 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2003 DataCore GmbH, Amir Guindehi -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/ospfd.init,v 1.1 2005/09/14 11:11:08 mrness Exp $ - -depend() { - need net zebra - after firewall -} - -checkconfig() { - if [ ! -e /etc/quagga/ospfd.conf ] ; then - eerror "You need to create /etc/quagga/ospfd.conf first." - eerror "An example can be found in /etc/quagga/samples/ospfd.conf.sample" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting ospfd" - start-stop-daemon --start --quiet --exec /usr/sbin/ospfd \ - -- -d -f /etc/quagga/ospfd.conf \ - --pid_file /var/run/quagga/ospfd.pid - result=$? - eend $result -} - -stop() { - ebegin "Stopping ospfd" - start-stop-daemon --stop --quiet --pidfile /var/run/quagga/ospfd.pid - result=$? - eend $result -} diff --git a/main/quagga/ripd.initd b/main/quagga/ripd.initd deleted file mode 100644 index 54458c7238..0000000000 --- a/main/quagga/ripd.initd +++ /dev/null @@ -1,34 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2003 DataCore GmbH, Amir Guindehi -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/ripd.init,v 1.1 2005/09/14 11:11:08 mrness Exp $ - -depend() { - need net zebra - after firewall -} - -checkconfig() { - if [ ! -e /etc/quagga/ripd.conf ] ; then - eerror "You need to create /etc/quagga/ripd.conf first." - eerror "An example can be found in /etc/quagga/samples/ripd.conf.sample" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting ripd" - start-stop-daemon --start --quiet --exec /usr/sbin/ripd \ - -- -d -f /etc/quagga/ripd.conf \ - --pid_file /var/run/quagga/ripd.pid - result=$? - eend $result -} - -stop() { - ebegin "Stopping ripd" - start-stop-daemon --stop --quiet --pidfile /var/run/quagga/ripd.pid - result=$? - eend $result -} diff --git a/main/quagga/ripngd.initd b/main/quagga/ripngd.initd deleted file mode 100644 index 00820e5250..0000000000 --- a/main/quagga/ripngd.initd +++ /dev/null @@ -1,34 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2003 DataCore GmbH, Amir Guindehi -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/ripngd.init,v 1.1 2005/09/14 11:11:08 mrness Exp $ - -depend() { - need net zebra - after firewall -} - -checkconfig() { - if [ ! -e /etc/quagga/ripngd.conf ] ; then - eerror "You need to create /etc/quagga/ripngd.conf first." - eerror "An example can be found in /etc/quagga/samples/ripngd.conf.sample" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting ripngd" - start-stop-daemon --start --quiet --exec /usr/sbin/ripngd \ - -- -d -f /etc/quagga/ripngd.conf \ - --pid_file /var/run/quagga/ripngd.pid - result=$? - eend $result -} - -stop() { - ebegin "Stopping ripngd" - start-stop-daemon --stop --quiet --pidfile /var/run/quagga/ripngd.pid - result=$? - eend $result -} diff --git a/main/quagga/zebra.initd b/main/quagga/zebra.initd index 2e2f2caa46..3f224c3709 100644 --- a/main/quagga/zebra.initd +++ b/main/quagga/zebra.initd @@ -1,42 +1,34 @@ #!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/zebra.init,v 1.2 2007/02/25 09:57:18 mrness Exp $ + +piddir=/var/run/quagga +pidfile=$piddir/$SVCNAME.pid +command=/usr/sbin/$SVCNAME +command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile" depend() { need net after firewall opennhrp } -checkconfig() { - if [ ! -e /etc/quagga/zebra.conf ] ; then - eerror "You need to create /etc/quagga/zebra.conf first." - eerror "An example can be found in /etc/quagga/samples/zebra.conf.sample" - return 1 - fi -} - cleanup() { ebegin "Cleaning up stale zebra routes..." ip route flush proto zebra eend $? } -start() { +checkconfig() { + if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then + eerror "You need to create /etc/quagga/$SVCNAME.conf first." + eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample" + eerror "from quagga-doc package" + return 1 + fi + return 0 +} + +start_pre() { checkconfig || return 1 + checkpath --owner quagga:quagga --directory $piddir cleanup - - ebegin "Starting zebra" - start-stop-daemon --start --quiet --exec /usr/sbin/zebra \ - -- -d -f /etc/quagga/zebra.conf ${ZEBRA_OPTS} \ - --pid_file /var/run/quagga/zebra.pid - result=$? - eend $result } -stop() { - ebegin "Stopping zebra" - start-stop-daemon --stop --quiet --pidfile /var/run/quagga/zebra.pid - result=$? - eend $result -} |