aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/dropbear/dropbear
diff options
context:
space:
mode:
authorRoman I Khimov <khimov@altell.ru>2010-07-19 17:08:08 +0400
committerRoman I Khimov <khimov@altell.ru>2010-07-29 11:06:38 +0400
commit6adaccf00601e1bc3ce1ede5417eabcdf1671768 (patch)
tree9f9366773402459527a43de6a40ab3be259dd170 /recipes/dropbear/dropbear
parenta8f765e41ead360ab65db617afce18d169e43c30 (diff)
downloadopenembedded-6adaccf00601e1bc3ce1ede5417eabcdf1671768.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. Signed-off-by: Roman I Khimov <khimov@altell.ru>
Diffstat (limited to 'recipes/dropbear/dropbear')
-rwxr-xr-xrecipes/dropbear/dropbear/init9
1 files changed, 5 insertions, 4 deletions
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."