dropbear: fix missing directory with systemd
authorMaxime Hadjinlian <maxime.hadjinlian@gmail.com>
Wed, 28 May 2014 07:46:20 +0000 (09:46 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Wed, 28 May 2014 08:01:44 +0000 (10:01 +0200)
The current SysV startup script create a directory which is necessary
for dropbear to correctly work.
This creation is not done with systemd.

Instead of both init creating the directory, we add the creation of this
directory to the INSTALL_TARGET_CMDS to make sure it's present.

[Peter: use make syntax for TARGET_DIR as pointed out by Thomas]
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/dropbear/S50dropbear
package/dropbear/dropbear.mk

index a343b9e1c061b2798d3868f537ae2b4cc1ba54ef..f36165ae487e1186b1f1347d89c8e987f36ed673 100644 (file)
@@ -10,10 +10,6 @@ start() {
        DROPBEAR_ARGS="$DROPBEAR_ARGS -R"
 
        echo -n "Starting dropbear sshd: "
-       # Make sure dropbear directory exists
-       if [ ! -d /etc/dropbear ] ; then
-               mkdir -p /etc/dropbear
-       fi
        umask 077
        start-stop-daemon -S -q -p /var/run/dropbear.pid \
                --exec /usr/sbin/dropbear -- $DROPBEAR_ARGS
index 2ac6211988dca72b7a3d917d52df36d8de77ac84..3a391694e60d396ae7550ba96df479491a21c5cf 100644 (file)
@@ -85,6 +85,7 @@ define DROPBEAR_INSTALL_TARGET_CMDS
        for f in $(DROPBEAR_TARGET_BINS); do \
                ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
        done
+       mkdir -p $(TARGET_DIR)/etc/dropbear
 endef
 
 $(eval $(autotools-package))