1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00
Commit Graph

52262 Commits

Author SHA1 Message Date
Jayanth Ananthapadmanaban
279082ed49 Add a network timeout option to journal-upload 2021-06-14 11:16:38 +02:00
Daniel Schaefer
5a750c49a9 doc: Add RISC-V to FAQ
Was added to the spec in 499f0f8209.
2021-06-13 18:20:09 +09:00
Zbigniew Jędrzejewski-Szmek
dce95d0b15 test/TEST-17-UDEV: use default image
No need to build a separate 700MB image to save 3080 bytes in the default image.
2021-06-12 11:19:04 +02:00
Yu Watanabe
4bcb862548 network: always check dynamic address assignments before entering configured state
Previously (v248 or earlier), even if no static address is configured,
the link did not enter configured state, as e.g. Link::static_addresses_configured
is false until the link gained its carrier.
But, after the commit 1187fc3375, the
situation was changed. Static addresses, routes, and etc are requested even
if the link does not have its carrier, and thus the link enters configured
state when no static address and etc are specified.

This makes the link does not enter configured state before it gains its
carrier when at least one of dynamic address assignment protocols (e.g.
DHCP) except for NDISC is enabled.

Note that, unfortunately, netplan always enables ConfigureWithoutCarrier=
for all virtual devices, e.g. bridge. See,
978e20f902
So, we need to support e.g. the following strange config:
```
[Netowkr]
ConfigureWithoutCarrier=yes
DHCP=yes
```

Fixes #19855.
2021-06-12 08:51:16 +09:00
Yu Watanabe
740b638267 test-network: disable dynamic addressing protocols when ConfigureWithoutCarrier= is enabled 2021-06-12 08:51:16 +09:00
Yu Watanabe
705c7b1860 test-network: refuse routable state when no-carrier is expected
If we do not set the maximum operstate in wait-online, then routable
state is allowed when no-carrier state is expected.
2021-06-12 08:51:16 +09:00
Yu Watanabe
7a0fef8688 test-network: add a testcase for MultiPathRoute= without interface name 2021-06-12 05:37:57 +09:00
Yu Watanabe
08c2fcdc0d network: route: set link ifindex when multi-path routes specified without interface name
And do not set RTA_OIF attribute when multi-path routes are specified.
See kernel's fib_get_nhs() in net/ipv4/fib_semantics.c.

Fixes #19890.
2021-06-12 05:34:52 +09:00
Yu Watanabe
af7b405dff sd-dhcp: refuse to set iaid if we cannot find the interface 2021-06-12 03:19:08 +09:00
Yu Watanabe
8d71f2b3a6 dhcp: do not use ifindex when generating iaid in tests 2021-06-12 03:19:08 +09:00
Yu Watanabe
0299deab53 sd-dhcp: do not use detect_container() to guess udev is running or not 2021-06-12 03:19:08 +09:00
Yu Watanabe
27fce94ae6 nspawn: path_is_read_only_fs() may return negative errno
And we usually assume /sys is not read only on error.
2021-06-12 03:19:08 +09:00
Yu Watanabe
0ac655a63b tree-wide: use sd_device_new_from_ifindex/ifname() 2021-06-12 03:19:08 +09:00
Yu Watanabe
bd44a727f7 sd-device: introduce sd_device_new_from_ifname/ifindex() 2021-06-12 03:19:08 +09:00
Yu Watanabe
afdf6c3b60 netlink: make rtnl_resolve_link_alternative_name() optionally return the main interface name 2021-06-12 03:19:08 +09:00
Yu Watanabe
57bd6aa701 netlink: check input name is valid before calling netlink method 2021-06-12 03:19:08 +09:00
Yu Watanabe
f6e491547d netlink: move resolve_ifname() or friends to netlink-util.[ch] 2021-06-12 03:19:08 +09:00
Yu Watanabe
f0ad7aedd9 network: use link_get_by_name() 2021-06-12 03:19:08 +09:00
Zbigniew Jędrzejewski-Szmek
756755d0fc docs: update coding style a bit
Say that r should be declared at the top of the function.

Don't say that fixed buffers result in truncation, right after saying that they
must only be used if size is known.

Adjust order of examples to be consistent.
2021-06-11 18:45:31 +01:00
Zbigniew Jędrzejewski-Szmek
e77365b479
Merge pull request #19882 from keszybz/test-stat-util-more
Add a test for path_is_read_only_fs()
2021-06-11 18:44:58 +02:00
Lennart Poettering
8f56d1a859 update TODO 2021-06-11 16:13:49 +02:00
Michal Koutný
cc815b7fea core: Avoid spurious realization of unit cgroups
Cgroups may be unnecessarily realized when they are not needed. This
happens, e.g. for mount units parsed from /proc/$PID/mountinfo, check

        touch /run/ns_mount
        unshare -n sh -c "mount --bind /proc/self/ns/net /run/ns_mount"
        # no cgroup exists
        file /sys/fs/cgroup/system.slice/run-ns_mount.mount
        systemctl daemon-reload
        # the vain cgroup exists
        file /sys/fs/cgroup/system.slice/run-ns_mount.mount

. (Such cgroups can account to a large number with many similar mounts.)

The code already accounts for "lazy" realization (see various checks for
Unit.cgroup_realized) but the unit_deserialize() in the reload/reexec
path performs unconditional realization.

Invalidate (and queue) the units for realization only if we know that
they were already realized in the past. This is a safe thing to do even
in the case the reload brings some new cgroup setting (controllers, BPF)
because units that aren't realized will use the updated setting when the
time for their realization comes. (It's not even needed to add a code
comment because the current formulation suggests the changed behavior.)
2021-06-11 10:34:22 +01:00
Zbigniew Jędrzejewski-Szmek
dbb3b26f1b man: clarify that global search domains apply to global servers, not all interfaces
Fixes #19257.
2021-06-11 10:32:42 +01:00
Zbigniew Jędrzejewski-Szmek
51db8fdb92 test-stat-util: don't fail under chroot
I wanted to see what is_path_read_only_fs() and is_path_temporary_fs() return
in a chroot, and various tests would fail. For most of our codebase, we can
assume that /proc and such are mounted, and it doesn't make sense to make the
tests work in a chroot. But let's do it here. (In general, it would be useful
for most stuff in src/basic/, since it's linked into libraries which might be
invoked in incorrectly set up environments and should not fail too badly.)
2021-06-11 07:40:53 +02:00
Luca Boccassi
7ad9bad71b
Merge pull request #19811 from anitazha/revert_mount_rl
sd-event: fix failure to exit rate limiting state
2021-06-10 23:41:55 +01:00
Luca Boccassi
390a22f4b1
Merge pull request #19864 from keszybz/serialization-cleanup
Serialization cleanup
2021-06-10 23:40:23 +01:00
nl6720
9dfb429a44 kbd-model-map: add Latvian keyboard layout mapping 2021-06-10 23:29:32 +01:00
Zbigniew Jędrzejewski-Szmek
6080987130
Merge pull request #18851 from yuwata/dissect-try-to-find-partition-on-timeout
dissect: try to find partition more frequently
2021-06-10 19:09:18 +02:00
Zbigniew Jędrzejewski-Szmek
c3988f36d3
Merge pull request #19870 from keszybz/install-foo-again
Tweak the install logic again
2021-06-10 18:56:03 +02:00
Lennart Poettering
31251469c0
Merge pull request #19878 from poettering/large-key-file-cryptsetup
add back support for large key files to systemd-cryptsetup
2021-06-10 17:10:32 +02:00
Štěpán Němec
6ae11e1220 docs/CODING_STYLE: fix some typos 2021-06-10 15:29:28 +01:00
Zbigniew Jędrzejewski-Szmek
ab18976b35 core/serialize: drop bogus deserialization of ipcns sockets
a70581ffb5 added ExecRuntime.ipcns_storage_socket[], and
serialization in exec_runtime_serialize(), and deserialization in exec_runtime_deserialize_one(),
but also deserialization in exec_runtime_deserialize_compat(). exec_runtime_deserialize_compat()
is for deserializating ExecRuntime when it was serialized as part of the unit before
e8a565cb66. There was never any code which would serialize
ExecRuntime.ipcns_storage_socket[] this way, so the deserialization attempts are pointless.
2021-06-10 14:17:58 +02:00
Zbigniew Jędrzejewski-Szmek
cbc165d17e core/serialization: shorten code, treat all oom error the same 2021-06-10 14:17:58 +02:00
Zbigniew Jędrzejewski-Szmek
1085c0eb69 core/serialization: drop misleadingly-named unit_can_serialize()
All unit types can be serialized. This function was really checking whether the
unit type has custom serialization/deserialization code. But we don't need a
function for this.

Also, the check that both .serialize() and .deserialize_item() are defined is
better written as an assert. Not we have a function which would skip
serialization/deserializaton for the unit if we forgot to set either of the
fields.
2021-06-10 14:17:58 +02:00
Zbigniew Jędrzejewski-Szmek
d8d0da1f19 test-stat-util: add a very basic test for test_path_is_read_only() 2021-06-10 13:45:55 +02:00
Zbigniew Jędrzejewski-Szmek
b845894c80 test-stat-util: add standard test logging 2021-06-10 13:45:55 +02:00
Lennart Poettering
871f35af85 cryptsetup: improve error message when key files to load are too large
Let's make this easier to grok for users.

Prompted-by: #19193
2021-06-10 10:55:02 +02:00
Lennart Poettering
f6dd48fae8 fileio: bump limit for read_full_file() and friends to 64M
Apparently people use such large key files. Specifically, people used 4M
key files, and we lowered the limit from 4M to 4M-1 back in 248.

This raises the limit to 64M for read_full_file() to avoid these
specific issues and give some non-trivial room beyond the 4M files seen
IRL.

Note that that a 64M allocation in glibc is always immediately done via
mmap(), and is thus a lot slower than shorter allocations. This means
read_virtual_file() becomes ridiculously slow if we'd use the large
limit, since we use it all the time for reading /proc and /sys metadata,
and read_virtual_file() typically allocates the full size with malloc()
in advance.  In fact it becomes so slow, that test-process-util kept
timing out on me all the time, once I blindly raised the limit.

This patch hence introduces two distinct limits for read_full_file() and
read_virtual_file(): the former is much larger than the latter and the
latter remains where it is. This is safe since the former uses an
exponentially growing realloc() loop while the latter uses the
aforementioend ahead-of-time full limit allocation.

Fixes: #19193
2021-06-10 10:51:00 +02:00
Zbigniew Jędrzejewski-Szmek
ad5fdd3912 shared/install: ignore enablement of template units w/o instance when presetting
When we have a unit which cannot be enabled:
 # foo@.service:
 ...
 [Install]
 WantedBy=foo.target  # there is no instance, so we don't know what to enable

we should throw an error when invoked directly with 'enable', but
not when doing 'preset' or 'preset-all'.

Fixes #19856.
2021-06-10 10:02:38 +02:00
Zbigniew Jędrzejewski-Szmek
9b69770a49 shared/install: pass UnitFileFlags down into the call chain
This just propagates the parameter down into leaf functions,
without any functional change.
2021-06-10 10:00:36 +02:00
Lennart Poettering
527653f827
Merge pull request #19857 from yuwata/tmpfile-fix
tmpfiles: fix an issue found by Coverity
2021-06-10 09:30:57 +02:00
Lennart Poettering
bb25f236d4
Merge pull request #19863 from keszybz/coverity-drop-unitialized-workarounds
Drop some -Wmaybe-unitialized workarounds to help coverity
2021-06-10 09:29:59 +02:00
Lennart Poettering
0629adf7c3
Merge pull request #19867 from yuwata/ether-addr-util
ether-addr-util: introduce hw_addr_equal() and friends
2021-06-10 09:29:36 +02:00
Zbigniew Jędrzejewski-Szmek
8331b221ba core/dbus: rename internal variable for clarity 2021-06-10 07:32:38 +02:00
Anita Zhang
c48bc311a5 man: add note about operation without swap in systemd-oomd 2021-06-10 07:24:18 +02:00
nerdopolis
3c3335c714 Clarify help information for --global 2021-06-10 07:23:05 +02:00
Lennart Poettering
81107b8419 sd-event: change ordering of pending/ratelimited events
Instead of ordering non-pending before pending we should order
"non-pending OR ratelimited" before "pending AND not-ratelimited".
This fixes a bug where ratelimited events were ordered at the end of the
priority queue and could be stuck there for an indeterminate amount of
time.
2021-06-09 21:02:22 -07:00
Yu Watanabe
c68cafbabe tmpfile: always get file descriptor of root or current directory
Fixes CID#1457467.
2021-06-10 05:42:03 +09:00
Zbigniew Jędrzejewski-Szmek
998571a7f4
Merge pull request #19871 from yuwata/man-network-missing-settings
man: add missing settings
2021-06-09 22:15:38 +02:00
Zbigniew Jędrzejewski-Szmek
67e9c83bad cryptsetup: remove unitialized workaround
Doesn't seem needed anymore.
2021-06-09 22:01:13 +02:00