[systemd-devel] Unexpected behaviour not noticed by systemctl command

Andy Pieters systemd at andypieters.me.uk
Mon Oct 7 11:03:44 UTC 2019


On Mon, 7 Oct 2019 at 11:48, Reindl Harald <h.reindl at thelounge.net> wrote:
>
>
>
> Am 07.10.19 um 12:43 schrieb Andy Pieters:
> > Just lately ran into a fumble. I was trying to stop and disable a
> > service and I typed in:
> >
> > systemctl stop --now example.service
>
> but nowehere "disable" is statet with that command
I know, I mistyped (fumbled)
> > The service duly stopped but wasn't disabled because the --now switch
> > is only applicable on the disable/enable/mask commands

> yes, it "executes the state" instead just disable it for the next boot
> but "stop now" don't imply a different behavior as "stop" unless there
> would be some timing to exectue "stop" by default which isn't

> > However, shouldn't it be good practice to produce a warning or an
> > error when a switch is used that has no effect?
>
> it is used, it is stopped *now*

my point was that the manual says that the --now flag is only meaningful on the
enable/disable/mask commands. And even though in plain english it is correct to
say `stop this now`, logically speaking it is a syntax error

The same when you do systemctl status example.service or systemctl
status --now example.service
In English this is correct, but syntactically it isn't because the
documentation says it is only used
in enable/disable/mask.

I hope this doesn't start a flame war or anything, nor do I want to be
labelled a nit-picker or overly anal
but I consider this behaviour unexpected and thus incorrect.

Thank you

Andy


More information about the systemd-devel mailing list