From e9379558e337ce5bcc3af617aa8da07346e4e3d5 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 15 Feb 2013 19:23:36 +0100 Subject: [PATCH] dropbear: Do not kill client connections when restarting the daemon The upgrade of the unit broke due killing all client connections. opkg got a SIGHUP and didn't write out the state files. Do not kill the client connections on upgrade. --- recipes-fixes/dropbear/dropbear_sysmocom.inc | 2 +- recipes-fixes/dropbear/files/init | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes-fixes/dropbear/dropbear_sysmocom.inc b/recipes-fixes/dropbear/dropbear_sysmocom.inc index 0dea48b..a23e499 100644 --- a/recipes-fixes/dropbear/dropbear_sysmocom.inc +++ b/recipes-fixes/dropbear/dropbear_sysmocom.inc @@ -1,4 +1,4 @@ THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" FILESPATH =. "${@base_set_filespath(["${THISDIR}/files"], d)}:" -PRINC="3" +PRINC="4" diff --git a/recipes-fixes/dropbear/files/init b/recipes-fixes/dropbear/files/init index c1747e7..6ba665d 100644 --- a/recipes-fixes/dropbear/files/init +++ b/recipes-fixes/dropbear/files/init @@ -15,6 +15,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= @@ -80,24 +81,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."