blob: 46f6a7b3fce67750277547640142b5a6ca7f802a [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From 186ac39de8eb9aedcf3d87cdbe389d10cde03d66 Mon Sep 17 00:00:00 2001
2From: Beniamin Sandu <beniaminsandu@gmail.com>
3Date: Tue, 16 Jul 2019 19:59:23 +0300
4Subject: [PATCH] contrib: add yocto compatible startup scripts
5
6Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
7---
8 contrib/unbound.init | 10 +++++-----
9 contrib/unbound.service.in | 4 ++--
10 2 files changed, 7 insertions(+), 7 deletions(-)
11 mode change 100644 => 100755 contrib/unbound.init
12
13diff --git a/contrib/unbound.init b/contrib/unbound.init
14old mode 100644
15new mode 100755
16index cccadecc..4eba752b
17--- a/contrib/unbound.init
18+++ b/contrib/unbound.init
19@@ -19,11 +19,11 @@
20 ### END INIT INFO
21
22 # Source function library.
23-. /etc/rc.d/init.d/functions
24+. /etc/init.d/functions
25
26 exec="/usr/sbin/unbound"
27 prog="unbound"
28-config="/var/unbound/unbound.conf"
29+config="/etc/unbound/unbound.conf"
30 pidfile="/var/unbound/unbound.pid"
31 rootdir="/var/unbound"
32
33@@ -61,7 +61,7 @@ start() {
34 fi;
35
36 # if not running, start it up here
37- daemon $exec
38+ daemonize $exec
39 retval=$?
40 echo
41 [ $retval -eq 0 ] && touch $lockfile
42@@ -71,7 +71,7 @@ start() {
43 stop() {
44 echo -n $"Stopping $prog: "
45 # stop it here, often "killproc $prog"
46- killproc -p $pidfile $prog
47+ killproc $prog
48 retval=$?
49 echo
50 [ $retval -eq 0 ] && rm -f $lockfile
51@@ -99,7 +99,7 @@ force_reload() {
52
53 rh_status() {
54 # run checks to determine if the service is running or use generic status
55- status -p $pidfile $prog
56+ status $prog
57 }
58
59 rh_status_q() {
60diff --git a/contrib/unbound.service.in b/contrib/unbound.service.in
61index 95976dd9..0e7f79a9 100644
62--- a/contrib/unbound.service.in
63+++ b/contrib/unbound.service.in
64@@ -10,9 +10,9 @@ WantedBy=multi-user.target
65
66 [Service]
67 ExecReload=/bin/kill -HUP $MAINPID
68-ExecStart=@UNBOUND_SBIN_DIR@/unbound
69+ExecStart=@UNBOUND_SBIN_DIR@/unbound -d
70 NotifyAccess=main
71-Type=notify
72+Type=simple
73 CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_SYS_RESOURCE
74 MemoryDenyWriteExecute=true
75 NoNewPrivileges=true
76--
772.17.1
78