diff options
author | Roman I Khimov <khimov@altell.ru> | 2010-07-19 17:08:08 +0400 |
---|---|---|
committer | Roman I Khimov <khimov@altell.ru> | 2010-07-29 11:06:38 +0400 |
commit | 6adaccf00601e1bc3ce1ede5417eabcdf1671768 (patch) | |
tree | 9f9366773402459527a43de6a40ab3be259dd170 /recipes | |
parent | a8f765e41ead360ab65db617afce18d169e43c30 (diff) |
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.
Signed-off-by: Roman I Khimov <khimov@altell.ru>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/dropbear/dropbear.inc | 2 | ||||
-rwxr-xr-x | recipes/dropbear/dropbear/init | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/recipes/dropbear/dropbear.inc b/recipes/dropbear/dropbear.inc index af00129632..1569ea33ea 100644 --- a/recipes/dropbear/dropbear.inc +++ b/recipes/dropbear/dropbear.inc @@ -6,7 +6,7 @@ DEPENDS = "zlib" PROVIDES = "ssh sshd" RPROVIDES_${PN} = "ssh sshd" -INC_PR = "r4" +INC_PR = "r5" SRC_URI = "\ http://matt.ucc.asn.au/dropbear/dropbear-${PV}.tar.bz2 \ diff --git a/recipes/dropbear/dropbear/init b/recipes/dropbear/dropbear/init index 275aa328df..9bf7fbb73f 100755 --- a/recipes/dropbear/dropbear/init +++ b/recipes/dropbear/dropbear/init @@ -7,6 +7,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/dropbear NAME=dropbear DESC="Dropbear SSH server" +PIDFILE=/var/run/dropbear.pid DROPBEAR_PORT=22 DROPBEAR_EXTRA_ARGS= @@ -75,24 +76,24 @@ case "$1" in KEY_ARGS="" test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY" test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY" - start-stop-daemon -S \ + start-stop-daemon -S -p $PIDFILE \ -x "$DAEMON" -- $KEY_ARGS \ -p $DROPBEAR_PORT $DROPBEAR_EXTRA_ARGS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " - start-stop-daemon -K -x "$DAEMON" + start-stop-daemon -K -x "$DAEMON" -p $PIDFILE echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " - start-stop-daemon -K -x "$DAEMON" + start-stop-daemon -K -x "$DAEMON" -p $PIDFILE sleep 1 KEY_ARGS="" test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY" test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY" - start-stop-daemon -S \ + start-stop-daemon -S -p $PIDFILE \ -x "$DAEMON" -- $KEY_ARGS \ -p $DROPBEAR_PORT $DROPBEAR_EXTRA_ARGS echo "$NAME." |