Bug#891836: systemd: systemctl start/stop/restart valid-template at invalid-instance doesn't cause errors

Christoph Berg myon at debian.org
Fri Mar 2 19:48:15 GMT 2018


Re: Michael Biebl 2018-03-02 <b78246dc-8d33-1811-31be-0d0404f8f5d9 at debian.org>
> >>> I agree that it is not helpful that it doesn't raise an error here,
> >>> but I think it is working as intended by systemd. Or should we rather
> >>> be using AssertFileExists here? But starting the non-existing "foo"
> >>> service doesn't put "foo" into a permanent error state either.
> >>
> >> Why not just drop the Condition altogether?
> >> This way you'd get a proper error message from posgresql, and it would
> >> be easier to diagnose what's going wrong?
> > 
> > For the same reason that "systemctl start nonexisting.service" doesn't
> > permanently leave nonexisting.service in a error state that is visible
> > e.g. via "systemctl". I'd think that would be worse.
> 
> Not sure what you mean by that. Can you elaborate?

"systemctl start foo.service" throws an error, but does not mark
foo.service as failed.

If "systemctl start postgresql at foo.service" would not have
ConditionFileExists, it would permanently be marked as failed (until
"systemctl reset-failed").

Both should behave the same in the sense that typoing the service name
on start shouldn't leave the system in a degraded state. (It would be
nice if "systemctl start postgresql at foo.service" would throw a
one-time error, but it doesn't look like that could be achieved.)

Christoph




More information about the Pkg-systemd-maintainers mailing list