[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#778913: openssh-server: init (at least systemd) doesn't notice when sshd fails to start and reports success



On Sat, Feb 21, 2015 at 07:08:56PM +0100, Christoph Anton Mitterer wrote:
> I've just tried that with systemd now,... starting the ssh service
> there always yields in a success (status 0, green "OK"), even when
> it actually failed to start.
> 
> Simply add some invalid config option to sshd_config, restart and
> you'll se.
> Only when you go in "deeper" like systemctl status ssh.service, you'll
> see the actual error messages.

Thanks.  Do you think this would be suitable?  It seems to have the
right effect here.

diff --git a/debian/systemd/ssh.service b/debian/systemd/ssh.service
index ff28d39..cccafde 100644
--- a/debian/systemd/ssh.service
+++ b/debian/systemd/ssh.service
@@ -5,6 +5,7 @@ ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
 
 [Service]
 EnvironmentFile=-/etc/default/ssh
+ExecStartPre=/usr/sbin/sshd -t
 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
 ExecReload=/bin/kill -HUP $MAINPID
 KillMode=process

-- 
Colin Watson                                       [cjwatson@debian.org]


Reply to: