Subject: [PATCH] openrc service script added for rdnssd

From: [email-masked]
Date: Sat, 24 Aug 2019 22:53:36 +0500

From: Ahmed Bilal Khalid <[email-masked]>

---
 testing/ndisc6/APKBUILD  |  9 ++++++++-
 testing/ndisc6/rdnssd.rc | 24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 testing/ndisc6/rdnssd.rc

diff --git a/testing/ndisc6/APKBUILD b/testing/ndisc6/APKBUILD
index 39015e02e7..25e59ab96a 100644
--- a/testing/ndisc6/APKBUILD
+++ b/testing/ndisc6/APKBUILD
@@ -12,6 +12,8 @@ makedepends="linux-headers"
 subpackages="$pkgname-doc"
 source="https://www.remlab.net/files/ndisc6/ndisc6-$pkgver.tar.bz2
 	remove-undef-gnu-source.patch
+	
+	rdnssd.rc
 	"
 options="suid"
 
@@ -30,8 +32,13 @@ check() {
 }
 
 package() {
+	echo $srcdir
 	make DESTDIR="$pkgdir" install
+	install -D -m755 "$srcdir"/rdnssd.rc \
+		"$pkgdir"/etc/init.d/rdnssd
 }
 
 sha512sums="6f6cd939fb7079518db5c1bcd11353c722237d7735d229f9fd20d03e9f16b1ddf07c7c78c91364886148f2a82d6805eafe7e27da6b4e7c99b111603ec5fab842  ndisc6-1.0.4.tar.bz2
-d70c74f965308afbfc266071ec0d073d59cfd42f250e27c8f4f3e1c7b849a6bb9226407e74af30366d348e4213c7497791e8f2edc7b903703e611c036c250644  remove-undef-gnu-source.patch"
+d70c74f965308afbfc266071ec0d073d59cfd42f250e27c8f4f3e1c7b849a6bb9226407e74af30366d348e4213c7497791e8f2edc7b903703e611c036c250644  remove-undef-gnu-source.patch
+a864ddd01a8fb15eecf66fdef856a83e1eaf46fdcabdb1bf6302dd86ea797eb54d4c29d34cfafac21c0c160c31974aaac1c1135ad833776cf7842b30119541d1  rdnssd.rc
+"
diff --git a/testing/ndisc6/rdnssd.rc b/testing/ndisc6/rdnssd.rc
new file mode 100644
index 0000000000..cb253ffe4e
--- /dev/null
+++ b/testing/ndisc6/rdnssd.rc
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+	need localmount
+	before net
+	use logger
+}
+
+start() {
+	ebegin "Starting rdnssd"
+	start-stop-daemon --start --quiet --exec /usr/sbin/rdnssd -- -u root -r /etc/resolv.conf
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping rdnssd"
+	start-stop-daemon --stop --quiet --pidfile /var/run/rdnssd.pid
+	if [ -x /sbin/resolvconf ]; then 
+ 		/sbin/resolvconf -f -d rdnssd || true
+ 	fi
+	eend $?
+} 
-- 
2.22.0