openssh: Move key generation to the start function of init script.
authorIgnacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Fri, 24 Feb 2017 14:26:24 +0000 (15:26 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 26 Feb 2017 13:37:54 +0000 (14:37 +0100)
Since there's not much point in generating missing host keys when the
init script is called with "stop", the call to ssh-keygen should not
be done inconditionally, but in the start function instead.

Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/openssh/S50sshd

index c15114257f875c5162acf5eb62497fed4f4c255a..22da41d1ca5a732b51bde026b5cae41355f66689 100644 (file)
@@ -6,12 +6,12 @@
 # Make sure the ssh-keygen progam exists
 [ -f /usr/bin/ssh-keygen ] || exit 0
 
-# Create any missing keys
-/usr/bin/ssh-keygen -A
-
 umask 077
 
 start() {
+       # Create any missing keys
+       /usr/bin/ssh-keygen -A
+
        printf "Starting sshd: "
        /usr/sbin/sshd
        touch /var/lock/sshd