summaryrefslogtreecommitdiffstats
path: root/recipes-core/numad/numad-0.6/numad.init.patch
blob: c95f8d6018d6d4f0fc97262c3c2b78acf49b8673 (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
79
80
81
82
83
84
85
Fix source functions path.
Use start-stop-daemon.

Signed-off-by: Radu Patriu <radu.patriu@enea.com>
Upstream-Status: Pending

Index: numad/numad.init
===================================================================
--- numad.orig/numad.init	2014-03-13 15:27:26.000000000 +0200
+++ numad/numad.init	2014-03-13 16:39:13.089952014 +0200
@@ -6,13 +6,13 @@
 ### BEGIN INIT INFO
 # Provides: numad
 # Required-Start: cgconfig
-# Required-Stop: 
-# Should-Start: 
-# Should-Stop: 
-# Default-Start: 
-# Default-Stop: 
+# Required-Stop:
+# Should-Start:
+# Should-Stop:
+# Default-Start:
+# Default-Stop:
 # Short-Description: numad control
-# Description:      
+# Description:
 ### END INIT INFO
 
 if [ $(id -u) -ne 0 ]; then
@@ -21,7 +21,7 @@
 fi
 
 # Source function library.
-. /etc/rc.d/init.d/functions
+. /etc/init.d/functions
 
 exec="/usr/bin/numad"
 prog="numad"
@@ -29,32 +29,36 @@
 
 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
 
-lockfile=/var/lock/subsys/$prog
-base=${0##*/}
-
 start() {
     [ -x $exec ] || exit 5
     [ -f $config ] || exit 6
     echo -n $"Starting $prog: "
     . $config
-    daemon "$exec -i $INTERVAL"
+    start-stop-daemon --start --quiet --exec $exec -- -i $INTERVAL -D $DIRECTORY_MOUNT_POINT
     retval=$?
-    echo
-    [ $retval -eq 0 ] && touch $lockfile
+    if [ $retval -eq 0 ] ; then
+        echo "OK"
+    else
+        echo "FAIL"
+    fi
     return $retval
 }
 
 stop() {
     echo -n $"Stopping $prog: "
-    killproc $prog
+    start-stop-daemon --stop --quiet --exec $exec
     retval=$?
-    echo
-    [ $retval -eq 0 ] && rm -f $lockfile
+    if [ $retval -eq 0 ] ; then
+        echo "OK"
+    else
+        echo "FAIL"
+    fi
     return $retval
 }
 
 restart() {
     stop
+    sleep 1
     start
 }