]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/socket.c
core: properly reset all ExecStatus structures when entering a new unit cycle
authorLennart Poettering <lennart@poettering.net>
Tue, 17 Jul 2018 17:36:46 +0000 (19:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 23 Jul 2018 11:36:47 +0000 (13:36 +0200)
commit6a1d4d9fa6b9df1069b15f00447b3a8f9b9a3266
treef461821c13bd79c9095a166f15def8ca47702446
parent42cb05d5ff71e2126a35bfbc55376bda231cfc38
core: properly reset all ExecStatus structures when entering a new unit cycle

Whenever a unit is started fresh we should flush out any runtime data
from the previous cycle. We are pretty good at that already, but what so
far we missed was the ExecStart=/ExecStop=/… command exit status data.
Let's fix that, and properly flush out that stuff too.

Consider this service:

    [Service]
    ExecStart=/bin/sleep infinity
    ExecStop=/bin/false

When this service is started, then stopped and then started again
"systemctl status" would show the ExecStop= results of the previous run
along with the ExecStart= results of the current one, which is very
confusing. With this patch this is corrected: the data is kept right
until the moment the new service cycle starts, and then flushed out.
Hence "systemctl status" in that case will only show the ExecStart=
data, but no ExecStop= data, like it should be.

This should fix part of the confusion of #9588
src/core/execute.c
src/core/execute.h
src/core/mount.c
src/core/service.c
src/core/socket.c
src/core/swap.c