aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-init-script.patch
blob: 7168a352f79f24ab701c86879500d292dc300c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 26614b6578056ec30b95013592e308bf24d924c2 Mon Sep 17 00:00:00 2001
From: Beniamin Sandu <beniaminsandu@gmail.com>
Date: Fri, 20 Nov 2020 23:00:20 +0200
Subject: [PATCH] contrib: add yocto compatible init script

Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
---
 contrib/unbound.init | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/contrib/unbound.init b/contrib/unbound.init
index c5bb52bb..4eba752b 100644
--- a/contrib/unbound.init
+++ b/contrib/unbound.init
@@ -19,11 +19,11 @@
 ### END INIT INFO
 
 # Source function library.
-. /etc/rc.d/init.d/functions
+. /etc/init.d/functions
 
 exec="/usr/sbin/unbound"
 prog="unbound"
-config="/var/unbound/unbound.conf"
+config="/etc/unbound/unbound.conf"
 pidfile="/var/unbound/unbound.pid"
 rootdir="/var/unbound"
 
@@ -54,14 +54,14 @@ start() {
 	[ -e ${rootdir}/dev/log ] || touch ${rootdir}/dev/log
 	mount --bind -n /dev/log ${rootdir}/dev/log >/dev/null 2>&1;
     fi;
-    if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/urandom' /proc/mounts; then
+    if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/random' /proc/mounts; then
 	[ -d ${rootdir}/dev ] || mkdir -p ${rootdir}/dev ;
-	[ -e ${rootdir}/dev/urandom ] || touch ${rootdir}/dev/urandom
-	mount --bind -n /dev/urandom ${rootdir}/dev/urandom >/dev/null 2>&1;
+	[ -e ${rootdir}/dev/random ] || touch ${rootdir}/dev/random
+	mount --bind -n /dev/random ${rootdir}/dev/random >/dev/null 2>&1;
     fi;
 
     # if not running, start it up here
-    daemon $exec
+    daemonize $exec
     retval=$?
     echo
     [ $retval -eq 0 ] && touch $lockfile
@@ -71,15 +71,15 @@ start() {
 stop() {
     echo -n $"Stopping $prog: "
     # stop it here, often "killproc $prog"
-    killproc -p $pidfile $prog
+    killproc $prog
     retval=$?
     echo
     [ $retval -eq 0 ] && rm -f $lockfile
     if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/log' /proc/mounts; then
 	umount ${rootdir}/dev/log >/dev/null 2>&1
     fi;
-    if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/urandom' /proc/mounts; then
-	umount ${rootdir}/dev/urandom >/dev/null 2>&1
+    if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/random' /proc/mounts; then
+	umount ${rootdir}/dev/random >/dev/null 2>&1
     fi;
     return $retval
 }
@@ -99,7 +99,7 @@ force_reload() {
 
 rh_status() {
     # run checks to determine if the service is running or use generic status
-    status -p $pidfile $prog
+    status $prog
 }
 
 rh_status_q() {
-- 
2.25.1