Commit Graph

45783 Commits

Author SHA1 Message Date
Lennart Poettering 42165319b1 update TODO 2020-07-15 17:45:22 +02:00
Zbigniew Jędrzejewski-Szmek 95b29f3267
Merge pull request #16396 from yuwata/network-configured-flag
network: about xxx_configured flags
2020-07-15 15:45:38 +02:00
Zbigniew Jędrzejewski-Szmek b8ff0663e8
Merge pull request #16468 from keszybz/two-unrelated-patches
Two unrelated patches
2020-07-15 13:40:22 +02:00
Yu Watanabe 43bf28741f network: drop doubled white space 2020-07-15 17:15:25 +09:00
Yu Watanabe 93b0b88c3a network: free address when it is removed 2020-07-15 17:15:25 +09:00
Yu Watanabe 6906794dd1 network: dhcp4: do not assign new address before old one is not removed
If DHCP4 client lost a lease, and then soon acquire new lease, then
the removal of the old address may not be completed. If that happens,
and the new and old addresses are the same, then the new address will be
considered as a foreign address. Such a situation can occur when the
DHCP4 server is restarted.

This makes networkd wait for the removal of the old address when a new
lease is acquired.

This also makes the link in configuring state when renewing address.
2020-07-15 17:15:25 +09:00
Yu Watanabe 5d976f5f64 network: do not call link_check_ready() in link_request_set_routing_policy_rule()
It will be called in link_request_set_nexthop() or serveral handlers().
2020-07-15 17:15:25 +09:00
Yu Watanabe 0c816fcc7b network: make link_request_set_nexthop() called from link_request_set_routes() or route_handler()
Then we can drop static_routes_ready() flag.
2020-07-15 17:15:25 +09:00
Yu Watanabe 659ad3a0af network: do not make link in configured state when no address is assigned
When DHCP6 and RA are enabled, and RA does not provide any addresses,
then link may become configured state even if no address is assigned,
due to the time-lag between RA completion and DHCP reply.
This makes if DHCP is explicitly enabled, then link must have at least
one valid address to be in the configured state.
2020-07-15 17:15:25 +09:00
Yu Watanabe d98c546dac network: ndisc: split ndisc_configured flag into for addresses and routes 2020-07-15 17:15:25 +09:00
Yu Watanabe 01c344bdd4 network: ndisc: do not ignore remaining addresses
Follow-up for c24c83dc67.
2020-07-15 17:15:25 +09:00
Yu Watanabe 571f953934 test-network: wait for addresses are not in tentative state 2020-07-15 17:15:25 +09:00
Yu Watanabe 39373cb984 network: add debugging log why link is not in configured state yet 2020-07-15 17:15:16 +09:00
Yu Watanabe c5fcd8a70a test-network: check assigned address is not tentative state 2020-07-15 17:14:30 +09:00
Yu Watanabe 491b79aeac test-network: set IPv6AcceptRA=no if no dynamic addresses are not required 2020-07-15 17:14:30 +09:00
Yu Watanabe eb01a2dfb1 network: make link_request_set_nexthop() static 2020-07-15 17:14:30 +09:00
Yu Watanabe a4623f84ed network: add a debugging log 2020-07-15 17:14:30 +09:00
Yu Watanabe feb596b5c3 network: include error code in the log message 2020-07-15 17:14:30 +09:00
Yu Watanabe 2a877f4560 network: set dhcp6_xxx_configured flag after routes/addresses are assigned 2020-07-15 17:14:30 +09:00
Lennart Poettering ee5c1311ee logs: when embedding catalog info in log output use a dash of color and unicode
let's separate things out a bit, to make it easier to discern log output
and catalog data.

catalog data is now colored green (which is a color we don't use for log
data currently), and prefixed with a block shade.
2020-07-15 09:32:03 +02:00
Zbigniew Jędrzejewski-Szmek a996ead6a2
Merge pull request #16398 from poettering/machined-varlink
machined: move UID/GID resolution logic to userdb, i.e. from nss-mymachines to nss-systemd
2020-07-15 09:24:49 +02:00
Filipe Brandenburger 26698337f3 timer: Adjust calendar timers based on monotonic timer instead of realtime
When the RTC time at boot is off in the future by a few days, OnCalendar=
timers will be scheduled based on the time at boot. But if the time has been
adjusted since boot, the timers will end up scheduled way in the future, which
may cause them not to fire as shortly or often as expected.

Update the logic so that the time will be adjusted based on monotonic time.
We do that by calculating the adjusted manager startup realtime from the
monotonic time stored at that time, by comparing that time with the realtime
and monotonic time of the current time.

Added a test case to validate this works as expected. The test case creates a
QEMU virtual machine with the clock 3 days in the future. Then we adjust the
clock back 3 days, and test creating a timer with an OnCalendar= for every 15
minutes. We also check the manager startup timestamp from both `systemd-analyze
dump` and from D-Bus.

Test output without the corresponding code changes that fix the issue:

  Timer elapse outside of the expected 20 minute window.
    next_elapsed=1594686119
    now=1594426921
    time_delta=259198

With the code changes in, the test passes as expected.
2020-07-15 09:23:09 +02:00
Evgeny Vereshchagin d3e0662c7d Revert "ci: turn off the "upstream-systemd-ci" ppa"
This reverts commit d4ff79bbe1.
2020-07-15 08:59:25 +02:00
Filipe Brandenburger 06bb441102 test: Add "finish" rule to .PHONY 2020-07-15 08:58:46 +02:00
Zbigniew Jędrzejewski-Szmek 76830e2500
Merge pull request #16462 from keszybz/rpm-macro-warnings
Emit better errors for rpm macro misuse
2020-07-15 08:56:28 +02:00
Zbigniew Jędrzejewski-Szmek b56a877ef8 test-fs-util: use log_info instead of printf
The test is failing in koji, and the line from printf() does not end up
in the logs for some reason. log_info() works fine, so let's just use
that here too.
2020-07-14 22:18:38 +02:00
Evgeny Vereshchagin d4ff79bbe1 ci: turn off the "upstream-systemd-ci" ppa
Judging by https://launchpad.net/~upstream-systemd-ci/+archive/ubuntu/systemd-ci/+packages,
it got updated about 15 hours ago and the "build check" action has been
failing with
```
The following packages have unmet dependencies:
 kbd : Depends: console-setup but it is not going to be installed or
E: Unable to correct problems, you have held broken packages.
                console-setup-mini but it is not going to be installed
```
since then
2020-07-14 21:35:33 +03:00
Zbigniew Jędrzejewski-Szmek 6cdc429454
Merge pull request #16340 from keszybz/var-tmp-readonly
Create ro private /var/tmp dir when /var/tmp is read-only
2020-07-14 19:59:48 +02:00
Zbigniew Jędrzejewski-Szmek 56a13a495c pid1: create ro private tmp dirs when /tmp or /var/tmp is read-only
Read-only /var/tmp is more likely, because it's backed by a real device. /tmp
is (by default) backed by tmpfs, but it doesn't have to be. In both cases the
same consideration applies.

If we boot with read-only /var/tmp, any unit with PrivateTmp=yes would fail
because we cannot create the subdir under /var/tmp to mount the private directory.
But many services actually don't require /var/tmp (either because they only use
it occasionally, or because they only use /tmp, or even because they don't use the
temporary directories at all, and PrivateTmp=yes is used to isolate them from
the rest of the system).

To handle both cases let's create a read-only directory under /run/systemd and
mount it as the private /tmp or /var/tmp. (Read-only to not fool the service into
dumping too much data in /run.)

$ sudo systemd-run -t -p PrivateTmp=yes bash
Running as unit: run-u14.service
Press ^] three times within 1s to disconnect TTY.
[root@workstation /]# ls -l /tmp/
total 0
[root@workstation /]# ls -l /var/tmp/
total 0
[root@workstation /]# touch /tmp/f
[root@workstation /]# touch /var/tmp/f
touch: cannot touch '/var/tmp/f': Read-only file system

This commit has more changes than I like to put in one commit, but it's touching all
the same paths so it's hard to split.
exec_runtime_make() was using the wrong cleanup function, so the directory would be
left behind on error.
2020-07-14 19:47:15 +02:00
Zbigniew Jędrzejewski-Szmek a318a5659a man: document F1 in sd-boot too
As suggested in https://github.com/systemd/systemd/issues/15125#issuecomment-658114524.
2020-07-14 19:31:21 +02:00
Zbigniew Jędrzejewski-Szmek 1061fc1c17 rpm: include macro name in errors for two args macros too 2020-07-14 19:22:42 +02:00
Zbigniew Jędrzejewski-Szmek 281014b73e rpm: adjust various macros to print macro name in the error message
Based on initial patch by Jan Engelhardt <jengelh@inai.de>.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1856122.
2020-07-14 19:21:12 +02:00
Zbigniew Jędrzejewski-Szmek 8800df5f71
Merge pull request #16430 from mikhailnov/fix-rpm-create-package-macros
Fix RPM *_create_package macros
2020-07-14 19:02:09 +02:00
Lennart Poettering dad2062f40 update TODO 2020-07-14 17:08:12 +02:00
Lennart Poettering 38ccb55731 nss-mymachines: drop support for UID/GID resolving
Now that we make the user/group name resolving available via userdb and
thus nss-systemd, we do not need the UID/GID resolving support in
nss-mymachines anymore. Let's drop it hence.

We keep the module around, since besides UID/GID resolving it also does
hostname resolving, which we care about. (One of those days we should
replace that by some Varlink logic between
nss-resolve/systemd-resolved.service too)

The hooks are kept in the NSS module, but they do not resolve anything
anymore, in order to keep compat at a maximum.
2020-07-14 17:08:12 +02:00
Lennart Poettering 4c2cf15751 man: document new varlink service 2020-07-14 17:08:12 +02:00
Lennart Poettering 4751364e76 machined: implement user/group lookup varlink API in machined too
Let's natively support our own API in machined too.

This allows us to remove half of nss-mymachines in a later commit.
2020-07-14 17:06:23 +02:00
Lennart Poettering 74d1b7d2ad machined: refactor UID/GID machine translation
Let's move the heavy lifting out of the bus call implemntations, and
into generic code.

This allows us to expose them easily via Varlink too in a later commit.
2020-07-14 17:06:23 +02:00
Lennart Poettering a07f18cd30 process-util: make sure procfs_file_alloca() works for non-literal field names too 2020-07-14 17:06:23 +02:00
Lennart Poettering 56870d324b docs: permit user/group services that do not support enumeration
sssd people don't like enumeration and for some other cases it's not
nice to support either, in particular when synthesizing records for
container/userns UID/GID ranges.

Hence, let's make enumeration optional.
2020-07-14 16:44:52 +02:00
Lennart Poettering 16a4a2f8cc update TODO 2020-07-14 15:06:29 +02:00
Lennart Poettering 08ef688656 analyze: make testing ConditionPathExistsGlob= work
Fixes: #16439
Alternative-To: #16440
2020-07-14 14:59:18 +02:00
Lennart Poettering 4519c7c706 update TODO 2020-07-14 14:57:19 +02:00
Lennart Poettering 77ee1783eb udevadm: beef up deprecation log warning
Let's add a catalog entry explaining further details.

Most importantly though: talk to PID 1 directly, via the private D-Bus
socket, so that this actually works correctly during early boot, where
D-Bus is not around.
2020-07-14 14:57:19 +02:00
Zbigniew Jędrzejewski-Szmek a18c7865be meson: do not install testdata when -Dinstall-tests=false
Fixes #16447.
2020-07-14 14:57:04 +02:00
szb512 60b45a80c1 Update .clang-format 2020-07-13 18:08:09 +02:00
szb512 5b72b34708 Make the instructions slightly easier to read 2020-07-13 18:08:09 +02:00
Evgeny Vereshchagin 8ba6c15a82
Merge pull request #16437 from systemd/coverity-gcc-10
coverity: switch back to Fedora 31
2020-07-13 01:42:39 +03:00
Evgeny Vereshchagin b7067c4d87 coverity: install systemd
Apparently systemd is no longer installed in fedora containers
by default

```
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348:
starting container process caused "exec: \"/sbin/init\": stat /sbin/init: no such file or directory": unknown.
The command "$CI_MANAGERS/fedora.sh SETUP" failed and exited with 127 during .
```
2020-07-12 22:26:19 +00:00
Evgeny Vereshchagin 1374448add coverity: switch back to Fedora 31
Apparently 6 days ago fedora:latest started to point to fedora:32,
which comes with gcc-10. Coverity doesn't support it yet.
2020-07-12 22:00:16 +00:00