Commit graph

37102 commits

Author SHA1 Message Date
Lennart Poettering 26a17ca280 cgroup: add explanatory comment 2018-11-23 12:24:37 +01:00
Lennart Poettering 442ce7759c cgroup: units that aren't loaded properly should not result in cgroup controllers being pulled in
This shouldn't make much difference in real life, but is a bit cleaner.
2018-11-23 12:24:37 +01:00
Lennart Poettering 0adf88b68c cgroup: dump delegation mask too 2018-11-23 12:24:37 +01:00
Lennart Poettering 1649244588 cgroup: make unit_get_needs_bpf_firewall() static too 2018-11-23 12:24:37 +01:00
Lennart Poettering 53aea74a60 cgroup: make some functions static 2018-11-23 12:24:37 +01:00
Lennart Poettering 52fecf20b9 cgroup: fine tune when to apply cgroup attributes to the root cgroup
Let's tweak when precisely to apply cgroup attributes on the root
cgroup.

With this we now follow the following rules:

1. On cgroupsv2 we never apply any regular cgroups to the host root,
   since the attributes generally do not exist there.

2. On cgroupsv1 we do not apply any "weight" or "shares" style
   attributes to the host root cgroup, since they don't make much sense
   on the top level where there's only one group, hence no need to
   compare weights against each other. The other attributes are applied
   to the host root cgroup however.

3. In any case we don't apply attributes to the root of container
   environments (and --user roots), under the assumption that this is
   managed by the manager further up. (Note that on cgroupsv2 this is
   even enforced by the kernel)

4. BPF pseudo-attributes are applied in all cases (since we can have as
   many of them as we want)
2018-11-23 12:24:37 +01:00
Lennart Poettering 589a5f7a38 cgroup: append \n to static strings we write to cgroup attributes
This is a bit cleaner since we when we format numeric limits we append
it. And this way write_string_file() doesn't have to append it.
2018-11-23 12:24:37 +01:00
Lennart Poettering 28cfdc5aeb cgroup: tighten manager_owns_host_root_cgroup() a bit
This tightening is not strictly necessary (as the m->cgroup_root check
further down does the same), but let's make this explicit.
2018-11-23 12:24:37 +01:00
Lennart Poettering 611c4f8afb cgroup: rename {manager_owns|unit_has}_root_cgroup() → .._host_root_cgroup()
Let's emphasize that this function checks for the host root cgroup, i.e.
returns false for the root cgroup when we run in a container where
CLONE_NEWCGROUP is used. There has been some confusion around this
already, for example cgroup_context_apply() uses the function
incorrectly (which we'll fix in a later commit).

Just some refactoring, not change in behaviour.
2018-11-23 12:24:37 +01:00
Lennart Poettering 293d32df39 cgroup: add a common routine for writing to attributes, and logging about it
We can use this at quite a few places, and this allows us to shorten our
code quite a bit.
2018-11-23 12:24:37 +01:00
Lennart Poettering 39b9fefb2e cgroup: add a new macro for determining log level for cgroup attr write failures
For now, let's use it only at one place, but a follow-up commit will
make more use of it.
2018-11-23 12:24:37 +01:00
Lennart Poettering 2c74e12bb3 cgroup: ignore EPERM for a couple of more attribute writes 2018-11-23 12:24:37 +01:00
Lennart Poettering 8c83840772 cgroup: add comment explaining why we ignore EINVAL at two places
These are just copies from further down.
2018-11-23 12:24:37 +01:00
Lennart Poettering 73fe5314bf cgroup: suffix settings with "=" in log messages where appropriate 2018-11-23 12:24:37 +01:00
Lennart Poettering a0c339ed4b cgroup: only install cgroup release agent when we own the root cgroup
If we run in a container we shouldn't patch around this, and most likely
we can't anyway, and there's not much point in complaining about this.
Hence let's strictly say: the agent is private property of the host's
system instance, nothing else.
2018-11-23 12:24:37 +01:00
Lennart Poettering de8a711a58 cgroup: use structured initialization 2018-11-23 12:24:37 +01:00
Zbigniew Jędrzejewski-Szmek 527ead383d libudev: drop unnecessary check
sd_device_get_subsystem returns -ENOENT if subsystem is not set.
2018-11-23 09:16:11 +01:00
Zbigniew Jędrzejewski-Szmek 91540eaa5c
Merge pull request #10861 from yuwata/udev-list-cleanups
libudev: several cleanups for udev-list
2018-11-23 09:12:56 +01:00
Zbigniew Jędrzejewski-Szmek 7f22ad1083
Merge pull request #10886 from yuwata/sd-device-monitor-fix-filter
sd-device: fix subsystem filter
2018-11-23 08:53:33 +01:00
Lennart Poettering 00e7b3c8e5 unit: minor optimization, use stack over heap, when we can 2018-11-23 00:46:56 +01:00
Daniel van Vugt 26d7cf3daf 70-mouse.hwdb: Set DPI for MS Classic IntelliMouse
It defaults to 3200 DPI and 1000 Hz. Note the ?? is required to
match the multibyte UTF-8 character '®'.
2018-11-23 00:46:35 +01:00
Lennart Poettering 50111496dd
Merge pull request #10891 from yuwata/use-main-macro-2
tree-wide: use recently introduced macros
2018-11-23 00:46:02 +01:00
Lennart Poettering 27da878e7e unit: drop an unused fields from Unit struct 2018-11-23 00:37:00 +01:00
Yu Watanabe a5a59a2447 test: add more tests for subsystem filter 2018-11-23 06:46:29 +09:00
Lennart Poettering 66fa4bdd70 core: add two minor comments (#10890) 2018-11-23 06:25:27 +09:00
Yu Watanabe c6f09e6a2d locale: define main through macro 2018-11-23 06:22:30 +09:00
Yu Watanabe af7865c1b7 locale: store polkit_registry in Context 2018-11-23 06:22:30 +09:00
Yu Watanabe 6804d7a849 locale: rename context_free() to context_clear() 2018-11-23 06:22:30 +09:00
Yu Watanabe f6aa61909e resolvectl: use static destructor and define main through macro 2018-11-23 06:22:30 +09:00
Yu Watanabe 7a83c3aee0 rfkill: define main through macro 2018-11-23 06:22:30 +09:00
Yu Watanabe 5f5f0afc8b rfkill: store write queue and rfkill fd in struct Context 2018-11-23 06:22:30 +09:00
Yu Watanabe a160567e20 socket-proxy: define main through macro 2018-11-23 06:22:30 +09:00
Yu Watanabe dd2fd972b7 sysusers: use ordered_hashmap_steal_first_key_and_value() 2018-11-23 06:22:30 +09:00
Yu Watanabe 1d03c5c16f time-wait: define main through macro 2018-11-23 06:22:30 +09:00
Yu Watanabe 1f47bc3349 timedate: define main through macro 2018-11-23 06:22:30 +09:00
Yu Watanabe fd1bff7db5 update-done: quit earlier on failure 2018-11-23 06:22:30 +09:00
Yu Watanabe 3664cbabdd update-utmp: use _cleanup_ attribute to finalize process 2018-11-23 06:22:30 +09:00
Yu Watanabe d850ad9a30 veritysetup-generator: use static destructors and define main through macro 2018-11-23 06:22:30 +09:00
Yu Watanabe 2cb52121e5 veritysetup-generator: make arg_dest const 2018-11-23 06:22:30 +09:00
Yu Watanabe 6b9306b29c veritysetup: use static destructors and define main through macro
This also changes the return value when crypt_init_by_name() fails in 'detach'.
2018-11-23 06:22:30 +09:00
Evgeny Vereshchagin 4928e8adba tests: add a fuzzer for catalog_import_file 2018-11-22 21:02:34 +01:00
Zbigniew Jędrzejewski-Szmek c43acf69e4 man: update description of Description=
The way this is used drifted a bit from the original intent. Let's update
the description and add some examples to inspire people to texts that look
less bad during initial boot.
2018-11-22 20:58:43 +01:00
Zbigniew Jędrzejewski-Szmek 74a01105b7
Merge pull request #10884 from yuwata/udev-debug
meson: add more debug options
2018-11-22 20:47:33 +01:00
Yu Watanabe 65fe9c319f sd-device-monitor: fix subsystem filter
This fixes a bug introduced by 759d9f3f8d.

Fixes #10882.
2018-11-23 02:49:28 +09:00
Yu Watanabe 8c19dc54d3 udev-rules: update log messages 2018-11-23 01:15:42 +09:00
Yu Watanabe d6601495be meson: also add option for debugging siphash 2018-11-23 00:36:35 +09:00
Yu Watanabe 20e97dd3de meson: add option for debugging udev 2018-11-23 00:28:27 +09:00
Yu Watanabe 67e4b38563 udev-rules: trivial coding style cleanups 2018-11-23 00:22:09 +09:00
Yu Watanabe 981fae90df udev: rename udev_rules_unref() to udev_rules_free()
As udev_rules do not have a reference counter.
2018-11-23 00:07:40 +09:00
Yu Watanabe 3f14e7217a libudev: do not ignore error in udev_list_entry_add() 2018-11-22 23:50:02 +09:00