]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agohwdb: Add accelerometer orientation quirk for the Acer One 10 aka S1003
Hans de Goede [Fri, 12 Oct 2018 08:38:00 +0000 (10:38 +0200)] 
hwdb: Add accelerometer orientation quirk for the Acer One 10 aka S1003

Add accelerometer orientation quirk for the Acer One 10 2-in-1 also known
as the Acer S1003.

5 years agoSet theme jekyll-theme-minimal
Lennart Poettering [Fri, 12 Oct 2018 12:10:25 +0000 (14:10 +0200)] 
Set theme jekyll-theme-minimal

5 years agoSet theme jekyll-theme-dinky
Lennart Poettering [Fri, 12 Oct 2018 11:49:09 +0000 (13:49 +0200)] 
Set theme jekyll-theme-dinky

5 years agoCreate CNAME
Lennart Poettering [Fri, 12 Oct 2018 11:48:34 +0000 (13:48 +0200)] 
Create CNAME

5 years agoman: fix <manvolnum> of epoll_ctl(2)
Lucas Werkmeister [Fri, 12 Oct 2018 11:24:07 +0000 (13:24 +0200)] 
man: fix <manvolnum> of epoll_ctl(2)

5 years agoMerge pull request #10176 from yuwata/udev-cleanup-7
Lennart Poettering [Fri, 12 Oct 2018 10:26:33 +0000 (12:26 +0200)] 
Merge pull request #10176 from yuwata/udev-cleanup-7

udev: replace udev_device by sd_device

5 years agoMerge pull request #10369 from yuwata/test-mempool
Lennart Poettering [Fri, 12 Oct 2018 10:21:44 +0000 (12:21 +0200)] 
Merge pull request #10369 from yuwata/test-mempool

meson,test: mempool related fixes and add tests for 'thread safety'

5 years agoMerge pull request #10201 from yuwata/fix-10196
Lennart Poettering [Fri, 12 Oct 2018 09:36:08 +0000 (11:36 +0200)] 
Merge pull request #10201 from yuwata/fix-10196

sd-netlink: add destroy_callback to sd_netlink_call_async() and fix memleaks in networkd

5 years agotest: sort included headers 10369/head
Yu Watanabe [Fri, 12 Oct 2018 08:29:52 +0000 (17:29 +0900)] 
test: sort included headers

5 years agomeson: fix '-Dstatic-libsystemd=true' or '-Dstatic-libudev=true'
Yu Watanabe [Fri, 12 Oct 2018 02:59:55 +0000 (11:59 +0900)] 
meson: fix '-Dstatic-libsystemd=true' or '-Dstatic-libudev=true'

Follow-up for a5d8835c78112206bbf0812dd4cb471f803bfe88.

5 years agotest: add test for 'thread safety' of libudev
Yu Watanabe [Fri, 12 Oct 2018 02:56:45 +0000 (11:56 +0900)] 
test: add test for 'thread safety' of libudev

This adds a test for 715a970548d03fed18dc66c411c8b42ff21029cf.

5 years agomeson: do not use mempool from libudev.so
Yu Watanabe [Fri, 12 Oct 2018 02:55:03 +0000 (11:55 +0900)] 
meson: do not use mempool from libudev.so

Follow-up for a5d8835c78112206bbf0812dd4cb471f803bfe88.

5 years agotest: add test for 'thread safety' of sd-device
Yu Watanabe [Fri, 12 Oct 2018 02:45:20 +0000 (11:45 +0900)] 
test: add test for 'thread safety' of sd-device

This adds a test for a5d8835c78112206bbf0812dd4cb471f803bfe88.

5 years agosd-device: drop unnecessary header
Yu Watanabe [Fri, 12 Oct 2018 02:43:49 +0000 (11:43 +0900)] 
sd-device: drop unnecessary header

5 years agotest: add tests for $SYSTEMD_MEMPOOL=
Yu Watanabe [Fri, 12 Oct 2018 02:12:07 +0000 (11:12 +0900)] 
test: add tests for $SYSTEMD_MEMPOOL=

This adds tests for b4f607433cac749b617e15b3d5d122322ed2bc71 and
205c085bc36c2c61a09dc40621d8561b135d9b57 (#9792).

5 years agoAdd LOGO to os-release
hellcp [Thu, 11 Oct 2018 20:36:40 +0000 (22:36 +0200)] 
Add LOGO to os-release

5 years agotests: fix fallthrough condition for supplementary groups
Davide Cavalca [Thu, 11 Oct 2018 17:45:43 +0000 (10:45 -0700)] 
tests: fix fallthrough condition for supplementary groups

5 years agocore: fix member access within null pointer
Yu Watanabe [Thu, 11 Oct 2018 19:24:27 +0000 (04:24 +0900)] 
core: fix member access within null pointer

config_parse_tasks_max() is also used for parsing system.conf or
user.conf. In that case, userdata is NULL.

Fixes #10362.

5 years agojournalctl: port JSON output mode to new JSON API
Lennart Poettering [Mon, 23 Jul 2018 18:22:30 +0000 (20:22 +0200)] 
journalctl: port JSON output mode to new JSON API

Also, while we are at it, beef it up, by adding json-seq support (i.e.
https://tools.ietf.org/html/rfc7464). This is particularly useful in
conjunction with jq's --seq switch.

5 years agoMerge pull request #10353 from keszybz/more-manager-reloading
Lennart Poettering [Thu, 11 Oct 2018 15:25:03 +0000 (17:25 +0200)] 
Merge pull request #10353 from keszybz/more-manager-reloading

More manager reloading cleanups

5 years agoRevert "meson: use c_args in generator scripts (#10289)"
Zbigniew Jędrzejewski-Szmek [Thu, 11 Oct 2018 13:12:41 +0000 (15:12 +0200)] 
Revert "meson: use c_args in generator scripts (#10289)"

This reverts commit 56f56d5ad856d9bd1070693490b210e0a0ccde92.

This broke the compilation for coverity under travis. Our build script does
something like this:

$ CFLAGS='-D_Float128=long\ double -D_Float64=double -D_Float64x=long\ double -D_Float32=float -D_Float32x=double' meson cov-build -Dman=false
$ ninja -C build
...
[pid 27096] execve("/usr/bin/cc", ["/usr/bin/cc", "-D_Float128=long", "double", "-D_Float64=double", "-D_Float64x=long", "double", "-D_Float32=float", "-D_Float32x=double", "-E", "-dM", "-include", "linux/capability.h", "-include", "config.h", "-include", "../src/basic/missing.h", "-"], 0x55ab75ea4e80 /* 91 vars */) = 0
cc: error: double: No such file or directory
cc: error: double: No such file or directory
[pid 27096] +++ exited with 1 +++

I'm sure this could be fixed somehow, but since the original motivation for
56f56d5ad856d9bd1070693490b210e0a0ccde92 wasn't very strong, let's just revert
it as this seems to be the simplest solution.

5 years agomanager: simplify error handling in manager_deserialize() 10353/head
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:54:13 +0000 (13:54 +0200)] 
manager: simplify error handling in manager_deserialize()

If a memory error occurred, we would still go through the path which sets the
error on ferror(). It is unlikely that ferror() returns true, but it's seems
cleaner to just propagate the error we already have.

The handling of fgets() returning NULL is also simplified: according to the man
page, it returns NULL only on EOF or error. So if feof() returns true, I don't
think we should call ferror() again.

While at it, let's set errno to 0 and check that it is set before returning it
as an error. The man pages for fgets() and feof() do not say anything about
setting errno.

5 years agomanager: also use the reloading "cleanup" function in manager_startup
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:41:44 +0000 (13:41 +0200)] 
manager: also use the reloading "cleanup" function in manager_startup

Here the behaviour is nominally changed, because we will decrease the
counter on error. But the only caller quits the program if error occurs,
so this makes no practical difference.

5 years agomanager: use the _cleanup_ mechanism to do n_reloading counter handling
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:33:49 +0000 (13:33 +0200)] 
manager: use the _cleanup_ mechanism to do n_reloading counter handling

No functional change.

5 years agomanager: replace fake block with a strjoina
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:27:28 +0000 (13:27 +0200)] 
manager: replace fake block with a strjoina

The block was created to avoid declaring variables in the middle of the block.
We could now do that, but it's easier to just use strjoina here.

5 years agobusctl: add a --json= output mode
Lennart Poettering [Wed, 4 Jul 2018 13:28:09 +0000 (15:28 +0200)] 
busctl: add a --json= output mode

A new switch "-j" or "--json=" is added which transforms dbus
marshalling into json. This is extremely useful in combination with
tools such as "jq" to process bus calls further.

5 years agoMerge pull request #10334 from keszybz/nomempool
Lennart Poettering [Thu, 11 Oct 2018 11:44:34 +0000 (13:44 +0200)] 
Merge pull request #10334 from keszybz/nomempool

Use mempool only in progs linked to libsystemd-shared.so

5 years agoMerge pull request #10358 from yuwata/fix-10333
Lennart Poettering [Thu, 11 Oct 2018 11:32:15 +0000 (13:32 +0200)] 
Merge pull request #10358 from yuwata/fix-10333

resolve: fix member access within null pointer

5 years agoresolve: fix member access within null pointer 10358/head
Yu Watanabe [Thu, 11 Oct 2018 09:36:18 +0000 (18:36 +0900)] 
resolve: fix member access within null pointer

Fixes #10333.

5 years agoresolve: use structured initializers
Yu Watanabe [Thu, 11 Oct 2018 09:35:04 +0000 (18:35 +0900)] 
resolve: use structured initializers

5 years agomeson: use vars we already have defined in status 10334/head
Zbigniew Jędrzejewski-Szmek [Thu, 11 Oct 2018 09:10:53 +0000 (11:10 +0200)] 
meson: use vars we already have defined in status

5 years agomempool: only enable mempool use when linked to libsystemd-shared.so
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 14:02:55 +0000 (16:02 +0200)] 
mempool: only enable mempool use when linked to libsystemd-shared.so

Mempool use is enabled or disabled based on the mempool_use_allowed symbol that
is linked in.

Should fix assert crashes in external programs caused by #9792.
Replaces #10286.

v2:
- use two different source files instead of a gcc constructor

5 years agoMove use_pool() to mempool.c and rename to mempool_enabled()
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 13:53:35 +0000 (15:53 +0200)] 
Move use_pool() to mempool.c and rename to mempool_enabled()

The only user is in hashmap.c, but it's a mempool thing.

5 years agomeson: update bug reference
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jul 2018 13:04:28 +0000 (15:04 +0200)] 
meson: update bug reference

https://github.com/mesonbuild/meson/issues/1644 was resolved in 0.42:
https://github.com/mesonbuild/meson/pull/2191/commits/be4428005dff8b17af5696c8f05567de9af1a8c5,
but still no-go.

5 years agomeson: remove old comment
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jul 2018 12:49:22 +0000 (14:49 +0200)] 
meson: remove old comment

The linked page is gone, and I can't quite remember what the
warning was about. Something about recursive copying... Everything
seems to work.

5 years agomeson: drop workaround
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jul 2018 12:39:14 +0000 (14:39 +0200)] 
meson: drop workaround

It was added way back, and seems to work fine now without it.

5 years agotests: pass halt_on_error=1 to UBSan
Evgeny Vereshchagin [Wed, 10 Oct 2018 02:36:36 +0000 (02:36 +0000)] 
tests: pass halt_on_error=1 to UBSan

By default, UBSan neither crashes nor exits with a non-zero exit code
when undefined behavior has been detected. This is problematic because
it makes it much harder to catch issues like https://github.com/systemd/systemd/issues/10346,
 https://github.com/systemd/systemd/issues/10347, and https://github.com/systemd/systemd/issues/10333.
In fact, those issue were found just because I decided to grep
the test log, which isn't something that I normally do :-)

As it turns out, the only way to make UBSan signal that something is wrong that works more or less
reliably everywhere is to pass halt_on_error=1 (though, it's probably worth noting that it's currently
not set for PID1 in order not to trigger kernel panics).

See https://reviews.llvm.org/D35085#804183 and https://chromium.googlesource.com/chromium/src/testing/libfuzzer/+/HEAD/reference.md

5 years agoudev-builtin: move definitions related to builtin commands to udev-builtin.h 10176/head
Yu Watanabe [Wed, 29 Aug 2018 07:12:22 +0000 (16:12 +0900)] 
udev-builtin: move definitions related to builtin commands to udev-builtin.h

5 years agoudev-ctrl: move prototypes of udev_ctrl_*() to udev-ctrl.h
Yu Watanabe [Wed, 29 Aug 2018 07:03:45 +0000 (16:03 +0900)] 
udev-ctrl: move prototypes of udev_ctrl_*() to udev-ctrl.h

5 years agoudev-node: replace udev_device by sd_device and modernize code a bit
Yu Watanabe [Wed, 29 Aug 2018 06:54:56 +0000 (15:54 +0900)] 
udev-node: replace udev_device by sd_device and modernize code a bit

5 years agoudev-watch: replace udev_device by sd_device and modernize code a bit
Yu Watanabe [Fri, 14 Sep 2018 19:13:29 +0000 (04:13 +0900)] 
udev-watch: replace udev_device by sd_device and modernize code a bit

5 years agoudev: drop unused function udev_build_argv()
Yu Watanabe [Wed, 26 Sep 2018 15:28:50 +0000 (00:28 +0900)] 
udev: drop unused function udev_build_argv()

5 years agoman: clarify behaviour of RandomizedDelaySec=
dana [Tue, 9 Oct 2018 19:25:12 +0000 (14:25 -0500)] 
man: clarify behaviour of RandomizedDelaySec=

5 years agoMerge pull request #10316 from poettering/json-api
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 12:21:18 +0000 (14:21 +0200)] 
Merge pull request #10316 from poettering/json-api

just the json stuff from #9762

5 years agoMerge pull request #10351 from keszybz/meson-cpp-fixups
Yu Watanabe [Wed, 10 Oct 2018 10:50:35 +0000 (19:50 +0900)] 
Merge pull request #10351 from keszybz/meson-cpp-fixups

Meson c++-related fixups

5 years agoMerge pull request #10343 from poettering/manager-state-fix
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 10:36:16 +0000 (12:36 +0200)] 
Merge pull request #10343 from poettering/manager-state-fix

various fixes for PID1's Manager object

5 years agoMerge pull request #10349 from poettering/bus-creds-shift-overflow
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 10:04:33 +0000 (12:04 +0200)] 
Merge pull request #10349 from poettering/bus-creds-shift-overflow

sd-bus creds bitshift overflow fix

5 years agotree-wide: various ubsan zero size memory fixes
Lennart Poettering [Wed, 10 Oct 2018 09:34:30 +0000 (11:34 +0200)] 
tree-wide: various ubsan zero size memory fixes

Fixes: #10346
5 years agomeson: c++ is required for the fuzzer builds 10351/head
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 09:56:45 +0000 (11:56 +0200)] 
meson: c++ is required for the fuzzer builds

The configuration would fail with an error about cpp being an unknown language
anyway, but it's nicer to fail early and explicitly.

https://github.com/systemd/systemd/pull/10339#issuecomment-428279175

5 years agomeson: rename cpp_cmd to cxx_cmd
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 09:50:57 +0000 (11:50 +0200)] 
meson: rename cpp_cmd to cxx_cmd

cpp is a really bad alias for c++ because it's also the name of the
preprocessor. Let's rename the variable.

5 years agosd-bus: call cap_last_cap() only once in has_cap() 10349/head
Lennart Poettering [Wed, 10 Oct 2018 09:12:54 +0000 (11:12 +0200)] 
sd-bus: call cap_last_cap() only once in has_cap()

Also, use the same type everywhere for dealing with it.

5 years agosd-bus: use size_t when dealing with memory offsets
Lennart Poettering [Wed, 10 Oct 2018 09:12:22 +0000 (11:12 +0200)] 
sd-bus: use size_t when dealing with memory offsets

5 years agocapability: introduce CAP_TO_MASK_CORRECTED() macro replacing CAP_TO_MASK()
Lennart Poettering [Wed, 10 Oct 2018 09:07:54 +0000 (11:07 +0200)] 
capability: introduce CAP_TO_MASK_CORRECTED() macro replacing CAP_TO_MASK()

linux/capability.h's CAP_TO_MASK potentially shifts a signed int "1"
(i.e. 32bit wide) left by 31 which means it becomes negative. That's
just weird, and ubsan complains about it. Let's introduce our own macro
CAP_TO_MASK_CORRECTED which doesn't fall into this trap, and make use of
it.

Fixes: #10347
5 years agotests: add a fuzzer for the json parser and dumper 10316/head
Evgeny Vereshchagin [Wed, 1 Aug 2018 10:25:26 +0000 (10:25 +0000)] 
tests: add a fuzzer for the json parser and dumper

5 years agojson: add test
Lennart Poettering [Wed, 4 Jul 2018 13:42:04 +0000 (15:42 +0200)] 
json: add test

5 years agojson: add a nice JSON parser
Lennart Poettering [Wed, 25 Apr 2018 09:21:59 +0000 (11:21 +0200)] 
json: add a nice JSON parser

As preparation for OCI support in nspawn, let's add a JSON parser.

The json.h file contains an explanation why this is new code instead of
just us linking against an existing JSON library.

5 years agoman: fix typo
Asbjørn Apeland [Wed, 10 Oct 2018 07:13:39 +0000 (09:13 +0200)] 
man: fix typo

5 years agonetwork: make netlink callbacks return 1 10201/head
Yu Watanabe [Wed, 10 Oct 2018 05:39:35 +0000 (14:39 +0900)] 
network: make netlink callbacks return 1

This is not necessary. But most of netlink callbacks in networkd
return 1.

5 years agonetwork: use '_handler' suffix for netlink callbacks
Yu Watanabe [Wed, 10 Oct 2018 05:38:57 +0000 (14:38 +0900)] 
network: use '_handler' suffix for netlink callbacks

5 years agonetwork: rename ndisc_netlink_handler() to ndisc_route_handler()
Yu Watanabe [Wed, 10 Oct 2018 05:37:20 +0000 (14:37 +0900)] 
network: rename ndisc_netlink_handler() to ndisc_route_handler()

5 years agonetwork: drop break line in comment
Yu Watanabe [Wed, 10 Oct 2018 05:36:32 +0000 (14:36 +0900)] 
network: drop break line in comment

5 years agonetwork: make netlink callback not return negative value
Yu Watanabe [Wed, 10 Oct 2018 05:34:00 +0000 (14:34 +0900)] 
network: make netlink callback not return negative value

Fixes #10320.

5 years agonetwork: drop route_expire_callback() as it is duplicate of link_route_remove_handler()
Yu Watanabe [Wed, 10 Oct 2018 05:32:52 +0000 (14:32 +0900)] 
network: drop route_expire_callback() as it is duplicate of link_route_remove_handler()

5 years agonetwork: make manager_dhcp6_prefix_remove() static
Yu Watanabe [Wed, 10 Oct 2018 05:31:32 +0000 (14:31 +0900)] 
network: make manager_dhcp6_prefix_remove() static

5 years agonetwork: make netdev_enslave() static
Yu Watanabe [Wed, 10 Oct 2018 05:30:49 +0000 (14:30 +0900)] 
network: make netdev_enslave() static

5 years agonetworkd: drop unused element from AddressLabel struct
Yu Watanabe [Sat, 6 Oct 2018 04:20:07 +0000 (13:20 +0900)] 
networkd: drop unused element from AddressLabel struct

5 years agonetwork: add missing set_free() for Manager.dirty_links
Yu Watanabe [Wed, 3 Oct 2018 18:59:16 +0000 (03:59 +0900)] 
network: add missing set_free() for Manager.dirty_links

5 years agonetwork: add destroy callbacks for asynchronous netlink calls
Yu Watanabe [Sat, 6 Oct 2018 04:55:19 +0000 (13:55 +0900)] 
network: add destroy callbacks for asynchronous netlink calls

5 years agotest: add tests for destroy callback of asynchronous netlink call
Yu Watanabe [Wed, 3 Oct 2018 18:42:29 +0000 (03:42 +0900)] 
test: add tests for destroy callback of asynchronous netlink call

5 years agosd-netlink: add destroy_callback argument to sd_netlink_call_async()
Yu Watanabe [Sat, 6 Oct 2018 04:38:13 +0000 (13:38 +0900)] 
sd-netlink: add destroy_callback argument to sd_netlink_call_async()

5 years agosd-netlink: use structured initializers
Yu Watanabe [Wed, 3 Oct 2018 18:21:52 +0000 (03:21 +0900)] 
sd-netlink: use structured initializers

5 years agosd-netlink: fix error handling in sd_netlink_call_async()
Yu Watanabe [Wed, 3 Oct 2018 18:20:35 +0000 (03:20 +0900)] 
sd-netlink: fix error handling in sd_netlink_call_async()

5 years agoMerge pull request #10062 from rgushchin/device
Lennart Poettering [Tue, 9 Oct 2018 21:29:27 +0000 (23:29 +0200)] 
Merge pull request #10062 from rgushchin/device

Support cgroup v2 bpf-based device controller

5 years agomeson: we cannot call get_compiler('cpp') if we didn't "add" it
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 16:48:09 +0000 (18:48 +0200)] 
meson: we cannot call get_compiler('cpp') if we didn't "add" it

Follow-up for f6d783ac3d145f3f3ffc2023d4ad90f76cf7fe34.

5 years agobpf-firewall: always use log_unit_xyz() insteadof log_xyz()
Lennart Poettering [Tue, 9 Oct 2018 16:45:10 +0000 (18:45 +0200)] 
bpf-firewall: always use log_unit_xyz() insteadof log_xyz()

That way it's easier to figure out what the various messages belong to

5 years agodevice: clean up DeviceFound flags set
Lennart Poettering [Tue, 9 Oct 2018 11:14:04 +0000 (13:14 +0200)] 
device: clean up DeviceFound flags set

No need to avoid bit 0. Also the U suffix has no effect, don't use it.

5 years agocore: add missing 'continue' statement
Lennart Poettering [Tue, 9 Oct 2018 13:33:13 +0000 (15:33 +0200)] 
core: add missing 'continue' statement

5 years agocore: include environment generator runtime in generator timestamps 10343/head
Lennart Poettering [Tue, 9 Oct 2018 17:42:28 +0000 (19:42 +0200)] 
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.

5 years agocore: add a common helper call manager_ready() sharing some common code between manag...
Lennart Poettering [Tue, 9 Oct 2018 17:41:24 +0000 (19:41 +0200)] 
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

5 years agocore: turn our four vacuum calls into a new helper function
Lennart Poettering [Tue, 9 Oct 2018 17:34:23 +0000 (19:34 +0200)] 
core: turn our four vacuum calls into a new helper function

Just share some code. No functional changes.

5 years agocore: rework how we set the objective to MANAGER_OK
Lennart Poettering [Tue, 9 Oct 2018 15:58:08 +0000 (17:58 +0200)] 
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
5 years agocore: make use of manager_loop()'s return value
Lennart Poettering [Tue, 9 Oct 2018 15:57:41 +0000 (17:57 +0200)] 
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.

5 years agocore: try to recover from failed reloads
Lennart Poettering [Tue, 9 Oct 2018 15:56:54 +0000 (17:56 +0200)] 
core: try to recover from failed reloads

Let's simply continue with everything we loaded, in the hope it's
somewhat useful.

5 years agocore: bring manager_startup() and manager_reload() more inline
Lennart Poettering [Tue, 9 Oct 2018 15:37:57 +0000 (17:37 +0200)] 
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.

5 years agocore: break lines in comments
Lennart Poettering [Tue, 9 Oct 2018 15:16:55 +0000 (17:16 +0200)] 
core: break lines in comments

5 years agocore: log in all cases in manager_startup()
Lennart Poettering [Tue, 9 Oct 2018 15:16:08 +0000 (17:16 +0200)] 
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.

5 years agomanager: rework error handling and logging in manager_reload()
Lennart Poettering [Tue, 9 Oct 2018 15:02:14 +0000 (17:02 +0200)] 
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.

5 years agocore: add comments about n_reloading to manager_deserialize()
Lennart Poettering [Tue, 9 Oct 2018 14:59:16 +0000 (16:59 +0200)] 
core: add comments about n_reloading to manager_deserialize()

5 years agocore: handle OOM during deserialization always the same way
Lennart Poettering [Tue, 9 Oct 2018 14:54:40 +0000 (16:54 +0200)] 
core: handle OOM during deserialization always the same way

OOM failures we consider fatal, while other failures we generally skip
over.

5 years agocore: clean up deserialization log messages a bit
Lennart Poettering [Tue, 9 Oct 2018 14:53:35 +0000 (16:53 +0200)] 
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.

5 years agocore: make sure manager_run_generators() logs about all errors
Lennart Poettering [Tue, 9 Oct 2018 14:47:30 +0000 (16:47 +0200)] 
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.

5 years agocore: allow manager_serialize() to fail correctly
Lennart Poettering [Tue, 9 Oct 2018 14:45:33 +0000 (16:45 +0200)] 
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.

5 years agopath-lookup: downgrade logging in lookup_paths_init() a bit
Lennart Poettering [Tue, 9 Oct 2018 14:44:04 +0000 (16:44 +0200)] 
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.

5 years agocore: clean up test run flags
Lennart Poettering [Tue, 9 Oct 2018 14:15:54 +0000 (16:15 +0200)] 
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.

5 years agomanager: normalize /run disk space checks
Lennart Poettering [Tue, 9 Oct 2018 14:02:31 +0000 (16:02 +0200)] 
manager: normalize /run disk space checks

Let's avoid using a variable needlessly. More importantly, special case
the error, not the regular case.

5 years agocore: tiny tweak for cgroup trimming during manager_free()
Lennart Poettering [Tue, 9 Oct 2018 13:56:27 +0000 (15:56 +0200)] 
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.

5 years agocore: use structure initialization for Manager
Lennart Poettering [Tue, 9 Oct 2018 13:54:10 +0000 (15:54 +0200)] 
core: use structure initialization for Manager

No changes in behaviour, just a nicer way to fill in the Manager
initially.

5 years agomanager: rework test flags set
Lennart Poettering [Tue, 9 Oct 2018 13:45:05 +0000 (15:45 +0200)] 
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.

5 years agocore: rename ManagerExitCode → ManagerObjective
Lennart Poettering [Tue, 9 Oct 2018 13:42:19 +0000 (15:42 +0200)] 
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.

5 years agomanager: add explanatory comment regarding ManagerState
Lennart Poettering [Tue, 9 Oct 2018 13:32:35 +0000 (15:32 +0200)] 
manager: add explanatory comment regarding ManagerState