]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/service.c
core: only watch processes when it's really necessary
authorFranck Bui <fbui@suse.com>
Tue, 19 Mar 2019 09:59:26 +0000 (10:59 +0100)
committerFranck Bui <fbui@suse.com>
Wed, 20 Mar 2019 09:51:49 +0000 (10:51 +0100)
commit846a07b50594e763c2ed57855a6bf97d42cfa32a
tree78055d66abca33796fb8bfd443868ed3f18223b5
parentf75f613d259e9332be8e9657fa37e73f7aabcb8a
core: only watch processes when it's really necessary

If we know that main pid is our child then it's unnecessary to watch all
other processes of a unit since in this case we will get SIGCHLD when the main
process will exit and will act upon accordingly.

So let's watch all processes only if the main process is not our child since in
this case we need to detect when the cgroup will become empty in order to
figure out when the service becomes dead. This is only needed by cgroupv1.
src/core/service.c