[Pkg-systemd-maintainers] systemd support in openssh-server

Uoti Urpala uoti.urpala at pp1.inet.fi
Wed Feb 12 00:48:59 GMT 2014


On Wed, 2014-02-12 at 00:12 +0000, Colin Watson wrote:
> On Wed, Feb 12, 2014 at 01:15:39AM +0200, Uoti Urpala wrote:
> > At least a script from another package could trigger a daemon-reload
> > call between unpacking openssh-server and configuring it. So the system
> > could at least be in a somewhat inconsistent state between that and the
> > start-stop-daemon call. However, when writing the above I was somehow
> > confused between start-stop-daemon and invoke-rc.d - raw
> > start-stop-daemon should work regardless of the confused state. The
> > problem preventing it from being stopped is likely a simple incorrect
> > negation in the postinst: the stop call is under "! systemctl --quiet
> > is-active ssh" - only stopping it if it's already NOT active.
> 
> That was intentional; if the sysvinit-started sshd is still running,
> then it will surely not be active as far as systemd is concerned.  I
> didn't want to mess about with start-stop-daemon if systemd had already
> taken control of it.

I think you've misunderstood something about how systemd sysvinit
compatibility works. SSH started through the compatibility layer DOES
count as active, and is "under systemd control" - which is why for
example dependencies between init scripts and native units work fine,
unlike under upstart, as mentioned in the CTTE discussion. That's what I
meant by the "inconsistent state" above. Here's the example output for
mdadm which does not have a native service file (mdadm arbitrarily
picked because I didn't want to downgrade ssh for this):

$ systemctl status mdadm
mdadm.service - LSB: MD monitoring daemon
   Loaded: loaded (/etc/init.d/mdadm)
   Active: active (running) since Sun 2014-02-09 21:16:08 EET; 2 days ago
   CGroup: name=systemd:/system/mdadm.service
           └─812 /sbin/mdadm --monitor --pid-file /run/mdadm/monitor.pid --da...
$ systemctl is-active mdadm
active






More information about the Pkg-systemd-maintainers mailing list