From: Daniel Lezcano Date: Mon, 7 Jun 2010 09:33:55 +0000 (+0200) Subject: ubunutu - fix ssh runlevel stop condition X-Git-Tag: lxc-0.7.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bad66ba56376dcf9804e72b70bba16a2462c2fe;p=thirdparty%2Flxc.git ubunutu - fix ssh runlevel stop condition The default ssh upstart configuration makes the daemon to respawn either if we are shutdowning. Signed-off-by: Daniel Lezcano --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index 7af527493..b10575b7e 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -64,6 +64,37 @@ script /sbin/initctl emit stopped JOB=udevtrigger --no-wait /sbin/initctl emit started JOB=udev --no-wait end script +EOF + + # fix buggus runlevel with sshd + cat < $rootfs/etc/init/ssh.conf +# ssh - OpenBSD Secure Shell server +# +# The OpenSSH server provides secure shell access to the system. + +description "OpenSSH server" + +start on filesystem +stop on runlevel [!2345] + +expect fork +respawn +respawn limit 10 5 +umask 022 +# replaces SSHD_OOM_ADJUST in /etc/default/ssh +oom never + +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 +exec /usr/sbin/sshd EOF cat < $rootfs/etc/init/console.conf