openssh 7.6 and 7.7 on Oracle Linux 7 (compiled from source) doesn't start correctly with systemd
Peter Stuge
peter at stuge.se
Fri Aug 24 03:49:54 AEST 2018
Damien Miller wrote:
> I agree: what is happening here seems to be mostly bad assumptions and
> inflexibility inside systemd.
I didn't say that, and I don't agree with that, to me it's welcome
ambition rather than bad assumptions.
Consider this:
How could systemd determine whether startup of a foreground daemon
completed successfully or failed?
Other than explicit notification (like a AF_UNIX message) systemd
could only use time; it could wait for the daemon to exit(EXIT_FAILURE)
after exec() - but how long is long enough? Every answer is incorrect.
Since systemd can't know when sshd has successfully started I find it
really reasonable to assume "immediately" in the Type=simple case.
> I'm surprised that systemd made these design decisions, because sshd is
> not doing anything historically unique with regards to startup or reload
> behaviour and "works with existing daemons" seems to be requirement #0
> if you're writing an init system.
That's not fair.
systemd works with sshd just as well as if I would add sshd to my inittab
on a SysV init system, but that's not so useful.
systemd works well with sshd using Type=forking, but if the config
file breaks and a reload is issued (and sshd exits, because bad config)
then systemd detects that sshd exited, but it can't know why, so it
can't output a status message.
systemd is indeed more ambitious than e.g. SysV init, and for service
management I consider that a leap in the right direction. (For many other
things which systemd wants to do not so much - I don't use those.)
> Maybe the other daemon vendors didn't push back against this, but I'm
> willing to.
Please don't push back just for the sake of it.
Did you look at the code I sent?
Would you take a patch with essentially that code, without any
libsystemd dependency, to make sshd work as a Type=notify service,
enabling maximum usability with systemd?
//Peter
More information about the openssh-unix-dev
mailing list