From 6adaccf00601e1bc3ce1ede5417eabcdf1671768 Mon Sep 17 00:00:00 2001 From: Roman I Khimov Date: Mon, 19 Jul 2010 17:08:08 +0400 Subject: 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 --- recipes/dropbear/dropbear.inc | 2 +- recipes/dropbear/dropbear/init | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'recipes') 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." -- cgit v1.2.3