Mail archive
alpine-aports

[alpine-aports] [PATCH V2] main/quagga: Cleanups and fixups in init.d and conf.d files.

From: Valery Kartel <valery.kartel_at_gmail.com>
Date: Fri, 10 Jun 2016 13:19:29 +0300

--
I forgot about checksums in previous patch ...
---
 main/quagga/APKBUILD     | 29 +++++++++++++++--------------
 main/quagga/bgpd.initd   |  9 ++++-----
 main/quagga/quagga.confd |  5 +++++
 main/quagga/zebra.confd  |  7 -------
 main/quagga/zebra.initd  | 26 ++++++++------------------
 5 files changed, 32 insertions(+), 44 deletions(-)
 create mode 100644 main/quagga/quagga.confd
 delete mode 100644 main/quagga/zebra.confd
diff --git a/main/quagga/APKBUILD b/main/quagga/APKBUILD
index 48523f8..58d6339 100644
--- a/main/quagga/APKBUILD
+++ b/main/quagga/APKBUILD
_at_@ -1,7 +1,8 @@
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
+# Contributor: Valery Kartel <valery.kartel_at_gmail.com>
 pkgname=quagga
 pkgver=1.0.20160315
-pkgrel=1
+pkgrel=2
 pkgdesc="A free routing daemon replacing Zebra supporting RIP, OSPF and BGP."
 url="http://quagga.net/"
 arch="all"
_at_@ -14,10 +15,9 @@ pkgusers="quagga"
 pkggroups="quagga"
 source="http://download.savannah.gnu.org/releases/quagga/quagga-$pkgver.tar.xz
 	dont-hook-core-signals.patch
-
+	quagga.confd
 	bgpd.initd
 	zebra.initd
-	zebra.confd
 	"
 
 _builddir="$srcdir"/$pkgname-$pkgver
_at_@ -61,28 +61,29 @@ package() {
 	cd "$_builddir"
 	make DESTDIR="$pkgdir" install || return 1
 
-	install -o quagga -g quagga -d "$pkgdir"/var/run/quagga
 	for i in zebra bgpd; do
 		install -Dm755 "$srcdir"/$i.initd "$pkgdir"/etc/init.d/$i
+		install -Dm644 "$srcdir"/quagga.confd "$pkgdir"/etc/conf.d/$i
 	done
 	for i in ripd ospfd ripngd ospf6d; do
 		ln -s bgpd "$pkgdir"/etc/init.d/$i || return 1
+		install -Dm644 "$srcdir"/quagga.confd "$pkgdir"/etc/conf.d/$i
 	done
-	install -Dm644 "$srcdir/zebra.confd" "$pkgdir"/etc/conf.d/zebra
 	install -o quagga -g quagga -d -m755 "$pkgdir"/etc/quagga
 }
+
 md5sums="61bfd0c8fb696dd778234ee8b05821bc  quagga-1.0.20160315.tar.xz
 1224ba91ea6b6e81f583bad7813aba98  dont-hook-core-signals.patch
-09a77e2e84e71c43f5a449738c026261  bgpd.initd
-916f1dd1a286ee7b862cda4fe56cbf21  zebra.initd
-34e06a1d2bc602ce691abc9ed169dd15  zebra.confd"
+b3641b95e14dddda1f383ec63efda6ae  quagga.confd
+b12ed2591a13bb7942b853da0d87fd5b  bgpd.initd
+6c69b4911f78e88a647e7b5c03cd38e4  zebra.initd"
 sha256sums="d284af5dd875dbba90ab875d40db5d68fdc9ede17a76f2af525f85344be56767  quagga-1.0.20160315.tar.xz
 4b71588e34ac14f8d6e72e6064b5e4ec302f286ebbe43df94c97411cceb66a23  dont-hook-core-signals.patch
-aab037454c6a70cd5cb45e14c47b7dfea358f8d81c7d12418edcf7e58a86c679  bgpd.initd
-c1d7526581927e990e687cbd5d08447eb060f76a439475572785b5b90c60c460  zebra.initd
-f7a52d383f60270a5a8fee5d4ac522c5c0ec2b7c4b5252cff54e260f32d9b323  zebra.confd"
+2ccbf5419d5ead2b240073f003a2c9809ad94caf4c26ca6bea53af140d0a3185  quagga.confd
+96ce2c6c573c61fd67c793913f40ea2f774acffddb061ea6c547d56e4cb72e9e  bgpd.initd
+5d010fc6330f9a49dc3a9eeaad85ea267bff26c6b95b33f17c01267eb1e16799  zebra.initd"
 sha512sums="ad633d189017a2cef68cf1653b85e082a0dc4fe146720a985da8cdf2aa4c61f2df8a8339419c986e9d74aa88f7f7109bc6d0c13d9ff4904a23852cee3e112edc  quagga-1.0.20160315.tar.xz
 5ef5c5e6d70d991b33b13a062e25b6fbde395dceee36aea29384b0640a48d2957ed5f50d416a1f2f770bf69bae2340133e35b1114be7e1fa722eb6d3d021f37a  dont-hook-core-signals.patch
-13b5b57e10df013bd2d931abc49bf76b8c4dee59dbceab22c9f151ccb988b2c5f7167f2909027d5e0f990b59da8de115667b02484aee9a67d347625700f6cacd  bgpd.initd
-1638a4a64ffd066b1884f7e5a4243edab68739aabd83bd35ea8c9608af7b8623eece1d59fb08feead84e4386b6d1da4220764ccf5fd7f2a9959a8470d5cce86a  zebra.initd
-900972c6f98e561dfacf384111251db262326e8764b8c763a5ef639fa11c7949c03eef5e3bce324a4b1964fe45416d2db74ae1b6bc967f7d4ba48c2eeda017c4  zebra.confd"
+d86d70555227f2b3eb5befd274a7fb9d5ae3fdfeab25ec407eb4b93dc5c09058763ff58d0faf8fdce8601ebf21a5a8bb05446a2b5ca69e4065e28c1f3e6cedad  quagga.confd
+49ef9087b9b1f88ddc6b70a0968de15765faca8a0371fa7bb9b076d7b79834de99f369fee378d31cc35ceb990a70e981409f94f365c00072dfb5549524365cd8  bgpd.initd
+f995f48d1769641229be31a9be677b83a48a9fcda09ad55d4ce4e06fcb3bb9b1c1f61cd07f93980fb7efcfc543edb6f2d20dd4c628f3af853cca8ffa32e2829f  zebra.initd"
diff --git a/main/quagga/bgpd.initd b/main/quagga/bgpd.initd
index bd1e4c6..0b3ddd9 100644
--- a/main/quagga/bgpd.initd
+++ b/main/quagga/bgpd.initd
_at_@ -1,9 +1,8 @@
 #!/sbin/openrc-run
 
-piddir=/var/run/quagga
-pidfile=$piddir/$SVCNAME.pid
+pidfile=/var/run/quagga/$SVCNAME.pid
 command=/usr/sbin/$SVCNAME
-command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile"
+command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile $command_args"
 
 depend() {
 	need net zebra
_at_@ -16,7 +15,7 @@ start_pre() {
 		eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample"
 		eerror "from quagga-doc package"
 		return 1
+	else
+		checkpath --owner quagga:quagga --directory ${pidfile%/*}
 	fi
-	checkpath --owner quagga:quagga --directory $piddir
 }
-
diff --git a/main/quagga/quagga.confd b/main/quagga/quagga.confd
new file mode 100644
index 0000000..14172c1
--- /dev/null
+++ b/main/quagga/quagga.confd
_at_@ -0,0 +1,5 @@
+# Additional command-line parameters to run:
+#	-A, --vty_addr addr   Set vty's bind address
+#	-P, --vty_port port   Set vty's port number
+#	-r, --retain          When program terminates, retain added route by zebra/bgpd.
+command_args=""
diff --git a/main/quagga/zebra.confd b/main/quagga/zebra.confd
deleted file mode 100644
index d2deb11..0000000
--- a/main/quagga/zebra.confd
+++ /dev/null
_at_@ -1,7 +0,0 @@
-# Additional command-line parameters to run zebra with:
-#	-k, --keep_kernel     Don't delete old routes which installed by zebra.
-#	-A, --vty_addr addr   Set vty's bind address
-#	-P, --vty_port port   Set vty's port number
-#	-r, --retain          When program terminates, retain added route by zebra.
-#       -s, --nl-bufsize      Set netlink receive buffer size
-ZEBRA_OPTS=""
diff --git a/main/quagga/zebra.initd b/main/quagga/zebra.initd
index 6ab297e..c5a7d27 100644
--- a/main/quagga/zebra.initd
+++ b/main/quagga/zebra.initd
_at_@ -1,34 +1,24 @@
 #!/sbin/openrc-run
 
-piddir=/var/run/quagga
-pidfile=$piddir/$SVCNAME.pid
+pidfile=/var/run/quagga/$SVCNAME.pid
 command=/usr/sbin/$SVCNAME
-command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile"
+command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile $command_args"
 
 depend() {
 	need net
 	after firewall opennhrp
 }
 
-cleanup() {
-	ebegin "Cleaning up stale zebra routes..."
-	ip route flush proto zebra
-	eend $?
-}
-
-checkconfig() {
+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
+	else 
+		checkpath --owner quagga:quagga --directory ${pidfile%/*}
+		ebegin "Cleaning up stale zebra routes..."
+		ip route flush proto zebra
+		eend $?
 	fi
-	return 0
 }
-
-start_pre() {
-	checkconfig || return 1
-	checkpath --owner quagga:quagga --directory $piddir
-	cleanup
-}
-
-- 
2.8.3
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Jun 10 2016 - 13:19:29 GMT