Commit Graph

35488 Commits

Author SHA1 Message Date
Yu Watanabe 26d6b2147e network: drop break line in comment 2018-10-10 14:43:05 +09:00
Yu Watanabe e6bf77744a network: make netlink callback not return negative value
Fixes #10320.
2018-10-10 14:43:05 +09:00
Yu Watanabe e8d1666687 network: drop route_expire_callback() as it is duplicate of link_route_remove_handler() 2018-10-10 14:43:05 +09:00
Yu Watanabe fdb20b7c59 network: make manager_dhcp6_prefix_remove() static 2018-10-10 14:43:05 +09:00
Yu Watanabe 09dd32eea7 network: make netdev_enslave() static 2018-10-10 14:43:05 +09:00
Yu Watanabe 17e57d3cae networkd: drop unused element from AddressLabel struct 2018-10-10 14:43:05 +09:00
Yu Watanabe 9bcb210ebc network: add missing set_free() for Manager.dirty_links 2018-10-10 14:43:05 +09:00
Yu Watanabe 1046bf9b1a network: add destroy callbacks for asynchronous netlink calls 2018-10-10 14:43:05 +09:00
Yu Watanabe 0d0f02cd15 test: add tests for destroy callback of asynchronous netlink call 2018-10-10 14:43:05 +09:00
Yu Watanabe 545bab1f0a sd-netlink: add destroy_callback argument to sd_netlink_call_async() 2018-10-10 14:43:05 +09:00
Yu Watanabe 2fea60901d sd-netlink: use structured initializers 2018-10-10 14:43:05 +09:00
Yu Watanabe f6bdbd9e00 sd-netlink: fix error handling in sd_netlink_call_async() 2018-10-10 14:43:05 +09:00
Lennart Poettering 3316429f19
Merge pull request #10062 from rgushchin/device
Support cgroup v2 bpf-based device controller
2018-10-09 23:29:27 +02:00
Zbigniew Jędrzejewski-Szmek 1b2acaa7a6 meson: we cannot call get_compiler('cpp') if we didn't "add" it
Follow-up for f6d783ac3d.
2018-10-09 21:12:00 +02:00
Lennart Poettering 13711093ef bpf-firewall: always use log_unit_xyz() insteadof log_xyz()
That way it's easier to figure out what the various messages belong to
2018-10-09 21:11:41 +02:00
Lennart Poettering 4cf997befa device: clean up DeviceFound flags set
No need to avoid bit 0. Also the U suffix has no effect, don't use it.
2018-10-09 21:11:22 +02:00
Lennart Poettering 5f616d5feb core: add missing 'continue' statement 2018-10-09 21:11:06 +02:00
Lennart Poettering eb523bfb51 core: include environment generator runtime in generator timestamps
Currently they aren't covered and it probably isn't worth adding another
kind of timestamp just for this, hence simply include it in the regular
generator timestamps.
2018-10-09 19:43:43 +02:00
Lennart Poettering 5ce5e1ad08 core: add a common helper call manager_ready() sharing some common code between manager_reload() and manager_startup()
Just sharing some common code. No functional changes
2018-10-09 19:43:43 +02:00
Lennart Poettering 5197be06e0 core: turn our four vacuum calls into a new helper function
Just share some code. No functional changes.
2018-10-09 19:43:43 +02:00
Lennart Poettering 1fb70e6648 core: rework how we set the objective to MANAGER_OK
Let's do so already when we are about to complete startup/reload, so
that manager_catchup() is run in a context where MANAGER_IS_RUNNING()
returns true, as the intention is.

Fixes: #9518
2018-10-09 19:43:43 +02:00
Lennart Poettering 3ca4d0b3eb core: make use of manager_loop()'s return value
The objective is returned in the return value, let's make use of that,
instead of reaching into the object.
2018-10-09 19:43:43 +02:00
Lennart Poettering 7a35fa24ff core: try to recover from failed reloads
Let's simply continue with everything we loaded, in the hope it's
somewhat useful.
2018-10-09 19:43:43 +02:00
Lennart Poettering 3ad2afb6a2 core: bring manager_startup() and manager_reload() more inline
Both functions do partly the same, let's make sure they do it in the
same order, and that we don't miss some calls.

This makes a number of changes:

1. Moves exec_runtime_vacuum() two calls down in manager_startup(). This
   should not have any effect but makes manager_startup() more like
   manager_reload().

2. Calls manager_recheck_journal(), manager_recheck_dbus(),
   manager_enqueue_sync_bus_names() in manager_startup() too. This is a
   good idea since during reeexec we pass through manager_startup() and
   hence can't assume dbus and journald weren't up yet, hence let's
   check if they are ready to be connected to.

3. Include manager_enumerate_perpetual() in manager_reload(), too. This
   is not strictly necessary, since these units are included in the
   serialization anyway, but it's still a nice thing, in particular as
   theoretically the deserialization could fail.
2018-10-09 19:43:43 +02:00
Lennart Poettering 6eb3af7a6e core: break lines in comments 2018-10-09 19:43:43 +02:00
Lennart Poettering 572986ca14 core: log in all cases in manager_startup()
We missed some cases where we'd fail without any logging at all. Let's
fix that.
2018-10-09 19:43:43 +02:00
Lennart Poettering 6a33af40da manager: rework error handling and logging in manager_reload()
let's clean up error handling and logging in manager_reload() a bit.
Specifically: make sure we log about every error we might encounter at
least and at most once.

When we encounter an error before the "point of no return" then log at
LOG_ERR about it and propagate it. Otherwise, eat it up, but warn about
it and proceed, it's the best we can do.
2018-10-09 19:43:43 +02:00
Lennart Poettering eb10d0bf8a core: add comments about n_reloading to manager_deserialize() 2018-10-09 19:43:43 +02:00
Lennart Poettering 18869883f2 core: handle OOM during deserialization always the same way
OOM failures we consider fatal, while other failures we generally skip
over.
2018-10-09 19:43:43 +02:00
Lennart Poettering b2a8a3dd10 core: clean up deserialization log messages a bit
Always, say that we ignore these kind of issues. We already say that for
many fields, but for a few this was missing.
2018-10-09 19:43:43 +02:00
Lennart Poettering 7eb4f32612 core: make sure manager_run_generators() logs about all errors
Since it's mostly a wrapper around execute_directories() it already logs
in most cases, but a few were missing. Fix that.
2018-10-09 19:43:43 +02:00
Lennart Poettering 4daf832afa core: allow manager_serialize() to fail correctly
If manager_serialize() fails in the middle (which it hopefully doesn't)
make sure to fix up m->n_reloading correctly again so that we don't
leave it > 0 when it really shouldn't be.
2018-10-09 19:43:43 +02:00
Lennart Poettering fc37d875a1 path-lookup: downgrade logging in lookup_paths_init() a bit
So far lookup_paths_init() did not log on its own beyond LOG_DEBUG,
fix one exception, in order to avoid duplicate logging.
2018-10-09 19:43:43 +02:00
Lennart Poettering 638cece45d core: clean up test run flags
Let's make them typesafe, and let's add a nice macro helper for checking
if we are in a test run, which should make testing for this much easier
to read for most cases.
2018-10-09 19:43:43 +02:00
Lennart Poettering c52b19d65f manager: normalize /run disk space checks
Let's avoid using a variable needlessly. More importantly, special case
the error, not the regular case.
2018-10-09 19:43:43 +02:00
Lennart Poettering 86036b26a1 core: tiny tweak for cgroup trimming during manager_free()
Instead of blacklisting when not to trim the cgroup tree, let's instead
whitelist when to do it, as an excercise of being careful when being
destructive.

This should not change behaviour with exception that during switch roots
we now won't attempt to trim the cgroup tree anymore. Which is more
correct behaviour after all we serialize/deserialize during the
transition and should be needlessly destructive.
2018-10-09 19:43:43 +02:00
Lennart Poettering 3ad228ce75 core: use structure initialization for Manager
No changes in behaviour, just a nicer way to fill in the Manager
initially.
2018-10-09 19:43:43 +02:00
Lennart Poettering ed4ac965fa manager: rework test flags set
No reason to avoid bit 0.

Also, fix some tests that pass "true" as flags value, which is just
wrong.
2018-10-09 19:43:43 +02:00
Lennart Poettering af41e5086d core: rename ManagerExitCode → ManagerObjective
"ExitCode" is a bit of a misnomer in two ways: it suggests this was
about the "exit code" concept that exit()/waitid() deal with, but really
isn't. Moreover, it's not event just about exiting either, but more
often about reloading/reexecing or rebooting. Let's hence pick a new
name for this that is a bit more correct.

I initially thought about naming this the "state", but that'd be a
misnomer too, as the value really encodes a "goal" more than a current
state. Also we already have the externally visible ManagerState.

No actual changes in behaviour, just the rename.
2018-10-09 19:43:43 +02:00
Lennart Poettering 899987456c manager: add explanatory comment regarding ManagerState 2018-10-09 19:43:43 +02:00
Lennart Poettering 2cc856ac89 main: minor coding style update 2018-10-09 19:43:43 +02:00
Roman Gushchin 084c700780 core: support cgroup v2 device controller
Cgroup v2 provides the eBPF-based device controller, which isn't currently
supported by systemd. This commit aims to provide such support.

There are no user-visible changes, just the device policy and whitelist
start working if cgroup v2 is used.
2018-10-09 09:47:51 -07:00
Roman Gushchin 91cfdd8d29 core: bump mlock ulimit to 64Mb
Bpf programs are charged against memlock ulimit, and the default value
can be too tight on machines with many cgroups and attached bpf programs.

Let's bump it to 64Mb.
2018-10-09 09:46:36 -07:00
Roman Gushchin e867866623 libbpf.h: add BPF_JMP_A macro
Add unconditional jump macro to use in generated bpf programs.
2018-10-09 09:46:36 -07:00
Roman Gushchin 17f149556a core: refactor bpf firewall support into a pseudo-controller
The idea is to introduce a concept of bpf-based pseudo-controllers
to make adding new bpf-based features easier.
2018-10-09 09:46:08 -07:00
Lennart Poettering b03d6c5f48
Merge pull request #10331 from keszybz/tests-ip6-and-readme
Test suite fix and README update
2018-10-09 18:11:08 +02:00
Marko Myllynen a1c111c2d1 More polite passphrase prompt
Instead of

Please enter passphrase for disk <disk-name>!

use

Please enter passphrase for disk <disk-name>:

which is more polite and matches Plymouth convention.
2018-10-09 16:26:03 +02:00
Lennart Poettering 19d8c9c9b7 meson: include more build settings in status output 2018-10-09 15:42:40 +02:00
Zbigniew Jędrzejewski-Szmek 4c187c5258
Merge pull request #10136 from yuwata/run-unit-tests
test: run unit tests under containers
2018-10-09 15:33:49 +02:00
Zbigniew Jędrzejewski-Szmek 64d14b7e23 README.testsuite: update the documentation for meson 2018-10-09 15:31:00 +02:00