diff options
author | Roman I Khimov <khimov@altell.ru> | 2010-07-19 13:08:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-15 13:05:27 +0000 |
commit | 5da2485717b1a32c7a880e500a4251c67ef713ea (patch) | |
tree | afbe1a27502f43636b8894ea6820e958636abb15 /meta | |
parent | c677b7c5c3b5801f387eb098531d35498a631889 (diff) | |
download | poky-5da2485717b1a32c7a880e500a4251c67ef713ea.tar.gz |
dropbear: use pidfile for daemon start/stop/restart
Old init script killed all dropbear processes when doing stop/restart
including open SSH sessions which is very annoying.
(From OE-Core rev: 97aa5ac2df7593e343d82f5e64a422bb951eacf9)
Signed-off-by: Roman I Khimov <khimov@altell.ru>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rwxr-xr-x | meta/recipes-core/dropbear/dropbear/init | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init index 5cc2d656e8..e8fed3f94d 100755 --- a/meta/recipes-core/dropbear/dropbear/init +++ b/meta/recipes-core/dropbear/dropbear/init | |||
@@ -15,6 +15,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |||
15 | DAEMON=/usr/sbin/dropbear | 15 | DAEMON=/usr/sbin/dropbear |
16 | NAME=dropbear | 16 | NAME=dropbear |
17 | DESC="Dropbear SSH server" | 17 | DESC="Dropbear SSH server" |
18 | PIDFILE=/var/run/dropbear.pid | ||
18 | 19 | ||
19 | DROPBEAR_PORT=22 | 20 | DROPBEAR_PORT=22 |
20 | DROPBEAR_EXTRA_ARGS= | 21 | DROPBEAR_EXTRA_ARGS= |
@@ -80,24 +81,24 @@ case "$1" in | |||
80 | KEY_ARGS="" | 81 | KEY_ARGS="" |
81 | test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY" | 82 | test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY" |
82 | test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY" | 83 | test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY" |
83 | start-stop-daemon -S \ | 84 | start-stop-daemon -S -p $PIDFILE \ |
84 | -x "$DAEMON" -- $KEY_ARGS \ | 85 | -x "$DAEMON" -- $KEY_ARGS \ |
85 | -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS | 86 | -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS |
86 | echo "$NAME." | 87 | echo "$NAME." |
87 | ;; | 88 | ;; |
88 | stop) | 89 | stop) |
89 | echo -n "Stopping $DESC: " | 90 | echo -n "Stopping $DESC: " |
90 | start-stop-daemon -K -x "$DAEMON" | 91 | start-stop-daemon -K -x "$DAEMON" -p $PIDFILE |
91 | echo "$NAME." | 92 | echo "$NAME." |
92 | ;; | 93 | ;; |
93 | restart|force-reload) | 94 | restart|force-reload) |
94 | echo -n "Restarting $DESC: " | 95 | echo -n "Restarting $DESC: " |
95 | start-stop-daemon -K -x "$DAEMON" | 96 | start-stop-daemon -K -x "$DAEMON" -p $PIDFILE |
96 | sleep 1 | 97 | sleep 1 |
97 | KEY_ARGS="" | 98 | KEY_ARGS="" |
98 | test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY" | 99 | test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY" |
99 | test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY" | 100 | test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY" |
100 | start-stop-daemon -S \ | 101 | start-stop-daemon -S -p $PIDFILE \ |
101 | -x "$DAEMON" -- $KEY_ARGS \ | 102 | -x "$DAEMON" -- $KEY_ARGS \ |
102 | -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS | 103 | -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS |
103 | echo "$NAME." | 104 | echo "$NAME." |