[systemd-devel] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way
Lennart Poettering
lennart at poettering.net
Mon Jul 3 08:34:59 UTC 2017
On Thu, 29.06.17 11:51, Oliver Neukum (oneukum at suse.com) wrote:
> Am Donnerstag, den 29.06.2017, 11:45 +0200 schrieb Reindl Harald:
> >
> > Am 29.06.2017 um 10:05 schrieb Oliver Neukum:
> > >
> > > Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:
> > > >
> > > > Well, it's a service manager. As such it keeps track of services,
> > > > knows when they are started and when they aren't. Why would it stop
> > > > services that aren't started?
> > >
> > > Because you command it to do so.
> > > The check systemd does adds no value. There is a reason to not start
> > > something that is running. The reverse does not apply
> >
> > this is nonsense - how in the world should systemmd know what to stop
> > when it has no clue about the involved processes because it did not
> > start the service and hence has no tracking at all
>
> So try and fail. That is still no excuse for ruling out that you can
> stop a service you have not started. That is pure politics.
Note that stopping services is more than just invoking an ExecStop=
script, as systemd will kill everything remaining after that, and
waits for all processes being gone before considering the service
properly down. All that falls apart if systemd never tracked the
service, as we neither know what to kill nor what to wait for.
In fact, a major chunk of services don't even have ExecStop= anymore,
as it is mostly redundant with this scheme, as just sending SIGTERM covers
80% of how common system services are shut down.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list