1 |
commit: b4926dc5f401a6ff15fc6e4facfffd90bdc25cc9 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 24 15:59:18 2016 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 24 15:59:30 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4926dc5 |
7 |
|
8 |
net-dns/nsd: Added partially rewritten init scrip with "reload" target. |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
12 |
|
13 |
net-dns/nsd/files/nsd.initd-r1 | 58 ++++++++++++++++++++++++++++++++++++++++++ |
14 |
net-dns/nsd/nsd-4.1.11.ebuild | 2 +- |
15 |
2 files changed, 59 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/net-dns/nsd/files/nsd.initd-r1 b/net-dns/nsd/files/nsd.initd-r1 |
18 |
new file mode 100755 |
19 |
index 00000000..3f71e76 |
20 |
--- /dev/null |
21 |
+++ b/net-dns/nsd/files/nsd.initd-r1 |
22 |
@@ -0,0 +1,58 @@ |
23 |
+#!/sbin/openrc-run |
24 |
+# Copyright 1999-2016 Gentoo Foundation |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+# $Id$ |
27 |
+ |
28 |
+description="NSD is an authoritative-only, high performance, open source name server" |
29 |
+extra_commands="configtest" |
30 |
+extra_started_commands="reload" |
31 |
+ |
32 |
+# these can be overridden in /etc/conf.d/nsd if necessary |
33 |
+NSD_CONFIG="${NSD_CONFIG:-/etc/nsd/nsd.conf}" |
34 |
+NSD_CHECKCONF="${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}" |
35 |
+command="${NSD_BINARY:-/usr/sbin/nsd}" |
36 |
+command_args="-c ${NSD_CONFIG}" |
37 |
+ |
38 |
+depend() { |
39 |
+ need net |
40 |
+ use logger |
41 |
+} |
42 |
+ |
43 |
+get_pidfile() { |
44 |
+ printf '%s' "$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")" |
45 |
+} |
46 |
+ |
47 |
+checkconfig() { |
48 |
+ if ! test -e "${NSD_CONFIG}"; then |
49 |
+ eerror "You need to create an appropriate config file." |
50 |
+ eerror "An example can be found in /etc/nsd/nsd.conf.sample" |
51 |
+ return 1 |
52 |
+ elif ! "${NSD_CHECKCONF}" "${NSD_CONFIG}"; then |
53 |
+ eerror "You have errors in your configfile (${NSD_CONFIG})" |
54 |
+ return $? |
55 |
+ fi |
56 |
+ return 0 |
57 |
+} |
58 |
+ |
59 |
+configtest() { |
60 |
+ ebegin "Checking ${SVCNAME} configuration" |
61 |
+ checkconfig |
62 |
+ eend $? |
63 |
+} |
64 |
+ |
65 |
+start_pre() { |
66 |
+ checkconfig || return $? |
67 |
+ checkpath --directory --owner nsd:nsd $(dirname "${pidfile}") |
68 |
+ pidfile="$(get_pidfile)" |
69 |
+} |
70 |
+ |
71 |
+stop_pre() { |
72 |
+ checkconfig || return $? |
73 |
+ pidfile="$(get_pidfile)" |
74 |
+} |
75 |
+ |
76 |
+reload() { |
77 |
+ ebegin "Reloading config and zone files" |
78 |
+ kill -s HUP $(cat ${pidfile}) |
79 |
+ eend $? |
80 |
+} |
81 |
|
82 |
diff --git a/net-dns/nsd/nsd-4.1.11.ebuild b/net-dns/nsd/nsd-4.1.11.ebuild |
83 |
index 59948d2..3719d0f 100644 |
84 |
--- a/net-dns/nsd/nsd-4.1.11.ebuild |
85 |
+++ b/net-dns/nsd/nsd-4.1.11.ebuild |
86 |
@@ -67,7 +67,7 @@ src_install() { |
87 |
|
88 |
dodoc doc/{ChangeLog,CREDITS,NSD-4-features,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS} |
89 |
|
90 |
- newinitd "${FILESDIR}"/nsd.initd nsd |
91 |
+ newinitd "${FILESDIR}"/nsd.initd-r1 nsd |
92 |
|
93 |
# install munin plugin and config |
94 |
if use munin ; then |