]> git.pld-linux.org Git - packages/openssh.git/commitdiff
- init keys in pre-start
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 8 Oct 2011 14:34:38 +0000 (14:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    opensshd.upstart -> 1.8

opensshd.upstart

index ea93559b656cea8f7317c73a0021f708d680a611..7836e17c9db46f7e7ca3535f64bf5080f6dd4046 100644 (file)
@@ -10,16 +10,21 @@ oom never
 pre-start script
        test -x /usr/sbin/sshd || { stop; exit 0; }
        test -c /dev/null || { stop; exit 0; }
+
+       if [ ! -s /etc/ssh/ssh_host_key \
+               -o ! -s /etc/ssh/ssh_host_rsa_key \
+               -o ! -s /etc/ssh/ssh_host_dsa_key \
+               -o ! -s /etc/ssh/ssh_host_ecdsa_key \
+       ]; then
+               # call gen keys if any of the files above is missing or empty
+               /etc/rc.d/init.d/sshd ssh_gen_keys
+       fi
 end script
 
 script
        . /etc/rc.d/init.d/functions
        . /etc/sysconfig/network
 
-       if [ ! -s /etc/ssh/ssh_host_key ] ; then
-               /etc/rc.d/init.d/sshd init
-       fi
-
        if is_yes "$IPV4_NETWORKING" && is_no "$IPV6_NETWORKING"; then
                OPTIONS="$OPTIONS -4"
        fi
This page took 0.039677 seconds and 4 git commands to generate.