diff options
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/busybox/files/syslog | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog index 89c4d12e9c..49033c1755 100644 --- a/meta/recipes-core/busybox/files/syslog +++ b/meta/recipes-core/busybox/files/syslog | |||
@@ -51,6 +51,22 @@ else | |||
51 | SYSLOG_ARGS="-C" | 51 | SYSLOG_ARGS="-C" |
52 | fi | 52 | fi |
53 | 53 | ||
54 | waitpid () | ||
55 | { | ||
56 | pid=$1 | ||
57 | # Give pid a chance to exit before we restart with a 5s timeout in 1s intervals | ||
58 | if [ -z "$pid" ]; then | ||
59 | return | ||
60 | fi | ||
61 | timeout=5; | ||
62 | while [ $timeout -gt 0 ] | ||
63 | do | ||
64 | timeout=$(( $timeout-1 )) | ||
65 | kill -0 $pid 2> /dev/null || break | ||
66 | sleep 1 | ||
67 | done | ||
68 | } | ||
69 | |||
54 | case "$1" in | 70 | case "$1" in |
55 | start) | 71 | start) |
56 | echo -n "Starting syslogd/klogd: " | 72 | echo -n "Starting syslogd/klogd: " |
@@ -65,7 +81,11 @@ case "$1" in | |||
65 | echo "done" | 81 | echo "done" |
66 | ;; | 82 | ;; |
67 | restart) | 83 | restart) |
68 | $0 stop | 84 | pid1=`pidof syslogd` |
85 | pid2=`pidof syslogd` | ||
86 | $0 stop | ||
87 | waitpid $pid1 | ||
88 | waitpid $pid2 | ||
69 | $0 start | 89 | $0 start |
70 | ;; | 90 | ;; |
71 | *) | 91 | *) |