X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=opensshd.upstart;h=7836e17c9db46f7e7ca3535f64bf5080f6dd4046;hb=141a04d1fdecda5efd3d0588eff5dd8b65ba3856;hp=79c0bdb77533fd0d91c145deca5c824fd3137ada;hpb=b980459d177ac7a5957e0104355a1d2c7bc7cbd7;p=packages%2Fopenssh.git diff --git a/opensshd.upstart b/opensshd.upstart index 79c0bdb..7836e17 100644 --- a/opensshd.upstart +++ b/opensshd.upstart @@ -1,19 +1,30 @@ -start on pld.network-started and started SERVICE=syslog +start on pld.network-started and started SERVICE_syslog=y and started random stop on pld.shutdown-started respawn - +respawn limit 10 5 console output +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 @@ -21,8 +32,5 @@ script OPTIONS="$OPTIONS -6" fi - exec /usr/sbin/sshd $OPTIONS + exec /usr/sbin/sshd -D $OPTIONS end script -expect daemon - -# vi: ft=upstart