# ssh - OpenBSD Secure Shell server
#
# The OpenSSH server provides secure shell access to the system.
#
# patched by klabs
# ::do_not_edit::

description     "OpenSSH server"

start on filesystem or runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 10 5
umask 022

# 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
console none

pre-start script
    test -x /usr/sbin/sshd || { stop; exit 0; }
    test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
    test -c /dev/null || { stop; exit 0; }

    mkdir -p -m0755 /var/run/sshd
end script

# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
# 'exec' line here instead
#
# no, fucking idiots, you should *never* change system files, use config
# files as needed
#
script
  [ -f /etc/default/ssh ] && . /etc/default/ssh || :
  logger -t "UPSTART" "exec /usr/sbin/sshd -D $SSHD_OPTS"
  exec /usr/sbin/sshd -D $SSHD_OPTS
end script

