Go to file
Lennart Poettering 50be4f4a46 core: rework how we track service and scope PIDs
This reworks how systemd tracks processes on cgroupv1 systems where
cgroup notification is not reliable. Previously, whenever we had reason
to believe that new processes showed up or got removed we'd scan the
cgroup of the scope or service unit for new processes, and would tidy up
the list of PIDs previously watched. This scanning is relatively slow,
and does not scale well. With this change behaviour is changed: instead
of scanning for new/removed processes right away we do this work in a
per-unit deferred event loop job. This event source is scheduled at a
very low priority, so that it is executed when we have time but does not
starve other event sources. This has two benefits: this expensive work is
coalesced, if events happen in quick succession, and we won't delay
SIGCHLD handling for too long.

This patch basically replaces all direct invocation of
unit_watch_all_pids() in scope.c and service.c with invocations of the
new unit_enqueue_rewatch_pids() call which just enqueues a request of
watching/tidying up the PID sets (with one exception: in
scope_enter_signal() and service_enter_signal() we'll still do
unit_watch_all_pids() synchronously first, since we really want to know
all processes we are about to kill so that we can track them properly.

Moreover, all direct invocations of unit_tidy_watch_pids() and
unit_synthesize_cgroup_empty_event() are removed too, when the
unit_enqueue_rewatch_pids() call is invoked, as the queued job will run
those operations too.

All of this is done on cgroupsv1 systems only, and is disabled on
cgroupsv2 systems as cgroup-empty notifications are reliable there, and
we do not need SIGCHLD events to track processes there.

Fixes: #9138
2018-06-05 22:06:48 +02:00
.github github: use multiple issue templates 2018-05-10 07:58:38 -07:00
.mkosi mkosi: ensure the 'hostname' tool is available in the build environment 2018-04-19 11:30:18 +02:00
catalog tree-wide: drop license boilerplate 2018-04-06 18:58:55 +02:00
coccinelle Add macro for checking if some flags are set 2018-06-04 11:50:44 +02:00
doc doc: fix quoting 2018-05-26 17:02:53 +02:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb Update 60-sensor.hwdb 2018-06-04 13:46:40 +02:00
man man: use entities for fedora number and update URL 2018-06-05 11:04:01 +02:00
modprobe.d Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
network tree-wide: drop license boilerplate 2018-04-06 18:58:55 +02:00
po po: update French translation 2018-05-30 08:21:40 +02:00
presets tree-wide: drop license boilerplate 2018-04-06 18:58:55 +02:00
rules udev: create /dev/disk/by-label symlink for LUKS2 (#8998) 2018-05-15 16:51:07 +02:00
shell-completion bash-completion: add completion for portablectl 2018-05-28 18:15:06 +09:00
src core: rework how we track service and scope PIDs 2018-06-05 22:06:48 +02:00
sysctl.d sysctl.d: request ECN on both in and outgoing connections (#9143) 2018-05-31 13:30:10 +02:00
sysusers.d network: set DynamicUser= to systemd-networkd.service 2018-05-22 22:37:34 +09:00
test Merge pull request #9167 from keszybz/ellipsization 2018-06-04 13:45:03 +02:00
tmpfiles.d add new portable service framework 2018-05-24 17:01:57 +02:00
tools find-double-newline: look in headers too 2018-05-22 16:13:45 +02:00
travis-ci travis: use Fedora 27 as a base image 2018-06-05 12:03:18 +03:00
units add new portable service framework 2018-05-24 17:01:57 +02:00
xorg login: avoid external process call 2018-01-12 18:02:57 +01:00
.dir-locals.el meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
.editorconfig editorconfig: add rule for meson.build files (#6671) 2017-08-28 16:37:23 +02:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore Add mkosi.output/ to .gitignore 2017-11-29 14:33:56 +01:00
.mailmap mailmap: one more person 2018-03-05 17:21:09 +01:00
.travis.yml travis: use Travis CI only for running scheduled Coverity scans 2018-06-04 20:14:37 +03:00
.vimrc vimrc: fix indentation logic for our docbook xml files 2016-04-29 12:23:34 +02:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
configure build-sys: add basic support for ./configure && make && make install 2017-07-18 10:05:06 -04:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile build-sys: Fix Makefile wrapper for install target (#6548) 2017-08-07 11:29:20 +02:00
meson_options.txt build-sys: Add option to link systemctl statically 2018-05-31 16:05:00 +02:00
meson.build build-sys: Add option to link systemctl statically 2018-05-31 16:05:00 +02:00
mkosi.build mkosi: drop dumping all test output to console again 2018-04-19 11:41:28 +02:00
mkosi.default mkosi: create .mkosi directory 2016-10-06 11:53:58 -04:00
NEWS update NEWS to explain new OnFailure= behaviour 2018-06-01 19:13:38 +02:00
README Turn VALGRIND variable into a meson configuration switch 2018-05-17 09:54:36 -07:00
README.md README: mention systemd-stable 2018-03-26 15:28:03 +02:00
TODO doc: update TODO 2018-05-31 17:39:13 +09:00
zanata.xml po: add basic fedora.zanata.org configuration 2018-02-19 13:56:57 +01:00

systemd - System and Service Manager

Count of open issues over time Count of open pull requests over time Build Status
Coverity Scan Status
CII Best Practices

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements are provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the HACKING file for information how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.

Stable branches with backported patches are available in the stable repo.