#!/bin/sh exec 2>&1 sv start syslog >/dev/null || exit 1 [ -r /etc/default/ssh ] && . /etc/default/ssh [ ! -e /etc/ssh/sshd_not_to_be_run ] || { sv down .; exit 0; } # The image ships the one host key, so nothing makes keys here, on a read-only # root or a writable one. Without it sshd would exit and respawn every second; # runsvdir's output is the console, so say it once in syslog and stay down. if [ ! -s /etc/ssh/ssh_host_ed25519_key ]; then echo "no host key /etc/ssh/ssh_host_ed25519_key, not starting" | logger -t sshd -p auth.err sv down . exit 0 fi mkdir -p /var/run/sshd && chmod 0755 /var/run/sshd exec /usr/sbin/sshd -D $SSHD_OPTS