diff options
author | Qiang Chen <qiang.chen@windriver.com> | 2013-10-30 17:12:29 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-01 11:09:03 +0000 |
commit | 9f7f7afaa47bc3a058234269bffa55e15558df16 (patch) | |
tree | c255d5c2f421c38b7ee00c35f63a5c27b3b895eb /meta/recipes-connectivity/irda-utils | |
parent | 312961918cbde55f826deca2378d870609678e7b (diff) | |
download | poky-9f7f7afaa47bc3a058234269bffa55e15558df16.tar.gz |
irda-utils: restart irda daemon correctly
irattach init script restart faulty logic prevents irda daemon
from restart correctly.
root@qemu0:~# /etc/init.d/irattach restart
Restarting IrDA: Terminated
root@qemu0:~# ps aux | grep irattach
root 541 0.0 0.2 2400 612 ttyS0 S+ 09:05 0:00 grep irattach
As above shows, irattach not started after executing restart command.
This commit changed the restart command logic: firstly stop, then
start.
Prompt telling user irattach start successfully or failure also
added.
(From OE-Core rev: 39f266138b972b550979909b235a5779828d7d89)
Signed-off-by: Qiang Chen <qiang.chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/irda-utils')
-rwxr-xr-x | meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init b/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init index b8038e08a3..6f29e9c6ed 100755 --- a/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init +++ b/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init | |||
@@ -8,6 +8,10 @@ | |||
8 | # Short-Description: Infrared port support | 8 | # Short-Description: Infrared port support |
9 | ### END INIT INFO | 9 | ### END INIT INFO |
10 | 10 | ||
11 | NAME="irattach" | ||
12 | test -x "$IRDA_DAEMON" || IRDA_DAEMON=/usr/sbin/irattach | ||
13 | test -z "$IRATTACH_PID" && IRATTACH_PID=/var/run/irattach.pid | ||
14 | |||
11 | # Source function library. | 15 | # Source function library. |
12 | . /etc/init.d/functions | 16 | . /etc/init.d/functions |
13 | 17 | ||
@@ -49,30 +53,26 @@ fi | |||
49 | 53 | ||
50 | case "$1" in | 54 | case "$1" in |
51 | start) | 55 | start) |
52 | echo -n "Starting IrDA: " | 56 | echo -n "Starting IrDA: $NAME" |
53 | irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 & | 57 | start-stop-daemon --start --quiet --exec "$IRDA_DAEMON" ${DEVICE} ${ARGS} --pidfile "$IRATTACH_PID" |
54 | echo "$NAME." | 58 | sleep 1 |
55 | ;; | 59 | [ -f /var/run/irattach.pid ] && echo " done" || echo " fail" |
60 | ;; | ||
56 | stop) | 61 | stop) |
57 | echo -n "Stopping IrDA: " | 62 | echo "Stopping IrDA: $NAME" |
58 | killall irattach > /dev/null 2>&1 | 63 | start-stop-daemon --stop --quiet --exec "$IRDA_DAEMON" --pidfile "$IRATTACH_PID" |
59 | echo "$NAME." | 64 | ;; |
60 | ;; | ||
61 | restart|force-reload) | 65 | restart|force-reload) |
62 | echo -n "Restarting IrDA: " | 66 | $0 stop |
63 | irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 & | 67 | $0 start |
64 | sleep 1 | 68 | ;; |
65 | killall irattach > /dev/null 2>&1 | ||
66 | echo "$NAME." | ||
67 | ;; | ||
68 | status) | 69 | status) |
69 | status irattach | 70 | status irattach |
70 | exit $? | 71 | exit $? |
71 | ;; | 72 | ;; |
72 | *) | 73 | *) |
73 | N=/etc/init.d/$NAME | 74 | N=/etc/init.d/$NAME |
74 | echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 | 75 | echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 |
75 | exit 1 | 76 | exit 1 |
76 | ;; | 77 | ;; |
77 | esac | 78 | esac |
78 | |||