]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoman: correctly document default for DNSSEC= and DNSoverTLS= 21831/head
Zbigniew Jędrzejewski-Szmek [Sat, 18 Dec 2021 16:03:43 +0000 (17:03 +0100)] 
man: correctly document default for DNSSEC= and DNSoverTLS=

https://bugzilla.redhat.com/show_bug.cgi?id=1926323

3 years agoman: describe flags for record resolving
Zbigniew Jędrzejewski-Szmek [Tue, 14 Dec 2021 18:39:36 +0000 (19:39 +0100)] 
man: describe flags for record resolving

3 years agoman: describe $SYSTEMD_NSS_RESOLVE_VALIDATE
Zbigniew Jędrzejewski-Szmek [Tue, 14 Dec 2021 17:48:25 +0000 (18:48 +0100)] 
man: describe $SYSTEMD_NSS_RESOLVE_VALIDATE

This variable has a pretty important effect, but we didn't mention it
anywhere in the docs. It was added in aee9d18c8d909eb7aca2838e4bce5da018b6a112.

3 years agoMerge pull request #21807 from keszybz/bootcls-no-autodetect
Daan De Meyer [Mon, 20 Dec 2021 09:43:18 +0000 (10:43 +0100)] 
Merge pull request #21807 from keszybz/bootcls-no-autodetect

Use KERNEL_INSTALL_MACHINE_ID and KERNEL_INSTALL_LAYOUT with bootctl install

3 years agobasic: add a size check to format timex members properly
Mike Gilbert [Mon, 20 Dec 2021 00:39:37 +0000 (19:39 -0500)] 
basic: add a size check to format timex members properly

As of glibc-2.34, the size of members in struct timex varies depending on
the _TIME_BITS macro.

Fixes: https://github.com/systemd/systemd/issues/21826
3 years agosd-radv: do not use goto for non-error-handling cases
Yu Watanabe [Sun, 19 Dec 2021 00:03:16 +0000 (09:03 +0900)] 
sd-radv: do not use goto for non-error-handling cases

Follow-up for 059d7b6eae827e73c73633bcc40fe74f3696f3f6.

The comment https://github.com/systemd/systemd/pull/21814#discussion_r771842132
suggests to introduce new helper, but it is used only one place.
Let's not add such, but simply replace the goto with a flag.

3 years agoMerge pull request #21818 from bluca/path_trigger_limit
Daan De Meyer [Sun, 19 Dec 2021 11:42:11 +0000 (12:42 +0100)] 
Merge pull request #21818 from bluca/path_trigger_limit

path unit: add TriggerLimitBurst= and TriggerLimitIntervalSec=

3 years agologind: Use new macros
Nishal Kulkarni [Fri, 17 Dec 2021 16:36:31 +0000 (22:06 +0530)] 
logind: Use new macros

Migrate logind to use the new macros to declare a D-Bus method or signal.
Replaced SD_BUS_METHOD_WITH_NAMES with SD_BUS_METHOD_WITH_ARGS.
Replaced SD_BUS_SIGNAL_WITH_NAMES with SD_BUS_SIGNAL_WITH_ARGS.

3 years agoMerge pull request #21814 from yuwata/network-dhcp-pd-fixes
Yu Watanabe [Sat, 18 Dec 2021 23:52:08 +0000 (08:52 +0900)] 
Merge pull request #21814 from yuwata/network-dhcp-pd-fixes

network: several fixes for DHCP prefix delegation

3 years agopath unit: add TriggerLimitBurst= and TriggerLimitIntervalSec= 21818/head
Luca Boccassi [Sat, 18 Dec 2021 17:52:52 +0000 (17:52 +0000)] 
path unit: add TriggerLimitBurst= and TriggerLimitIntervalSec=

Given there's now a default for these settings, also allow users to configure
them, matching socket units

3 years agoman: fix typo in systemd.socket.5
Luca Boccassi [Sat, 18 Dec 2021 17:23:53 +0000 (17:23 +0000)] 
man: fix typo in systemd.socket.5

3 years agoMerge pull request #21808 from DaanDeMeyer/path-trigger-limit
Luca Boccassi [Sat, 18 Dec 2021 16:56:05 +0000 (16:56 +0000)] 
Merge pull request #21808 from DaanDeMeyer/path-trigger-limit

core: Add trigger limit for path units

3 years agocore: Add trigger limit for path units 21808/head
Daan De Meyer [Fri, 17 Dec 2021 19:01:31 +0000 (20:01 +0100)] 
core: Add trigger limit for path units

When conditions fail on a service unit, a path unit can cause
PID 1 to busy loop as it keeps trying to activate the service unit.
To avoid this from happening, add a trigger limit to the path unit,
identical to the trigger limit we have for socket units.

Initially, let's start with a high limit and not make it configurable.
If needed, we can add properties to configure the rate limit similar
to the ones we have for socket units.

3 years agohomed: Use new SD_BUS_METHOD_WITH_ARGS macro
Nishal Kulkarni [Fri, 17 Dec 2021 13:01:55 +0000 (18:31 +0530)] 
homed: Use new SD_BUS_METHOD_WITH_ARGS macro

Migrate homed to use the new macros to declare a D-Bus method.
Replaced `SD_BUS_METHOD_WITH_NAMES` with `SD_BUS_METHOD_WITH_ARGS`

3 years agotest-network: add tests for renewing/rebinding lease 21814/head
Yu Watanabe [Sat, 18 Dec 2021 00:52:04 +0000 (09:52 +0900)] 
test-network: add tests for renewing/rebinding lease

3 years agotest-network: introduce dump_dnsmasq_log_file()
Yu Watanabe [Sat, 18 Dec 2021 00:55:54 +0000 (09:55 +0900)] 
test-network: introduce dump_dnsmasq_log_file()

3 years agotest-network: use dnsmasq for testing DHCP4-6RD
Yu Watanabe [Fri, 17 Dec 2021 22:56:42 +0000 (07:56 +0900)] 
test-network: use dnsmasq for testing DHCP4-6RD

3 years agotest-network: use --bind-interfaces option for dnsmasq
Yu Watanabe [Fri, 17 Dec 2021 22:55:07 +0000 (07:55 +0900)] 
test-network: use --bind-interfaces option for dnsmasq

Also make the interface name and router address configurable.

3 years agosd-dhcp-client: add log message when a message is received
Yu Watanabe [Sat, 18 Dec 2021 00:53:27 +0000 (09:53 +0900)] 
sd-dhcp-client: add log message when a message is received

3 years agonetwork: dhcp-pd: do not stack 6rd sit tunnel
Yu Watanabe [Sat, 18 Dec 2021 01:06:59 +0000 (10:06 +0900)] 
network: dhcp-pd: do not stack 6rd sit tunnel

3 years agonetwork: route: update expiration timer in link_request_route()
Yu Watanabe [Sat, 18 Dec 2021 00:50:08 +0000 (09:50 +0900)] 
network: route: update expiration timer in link_request_route()

3 years agonetwork: route: do not drop unreachable route on reconfiguring downstream interface
Yu Watanabe [Sat, 18 Dec 2021 00:46:55 +0000 (09:46 +0900)] 
network: route: do not drop unreachable route on reconfiguring downstream interface

Previously, when a downstream is reconfigured, the unreachable route
was removed as there is no corresponding static config in .network
files.

3 years agonetwork: dhcp-pd: fix condition in dhcp_pd_prefix_lost()
Yu Watanabe [Sat, 18 Dec 2021 00:46:23 +0000 (09:46 +0900)] 
network: dhcp-pd: fix condition in dhcp_pd_prefix_lost()

3 years agosd-radv: send RA when prefix is updated
Yu Watanabe [Fri, 17 Dec 2021 22:52:30 +0000 (07:52 +0900)] 
sd-radv: send RA when prefix is updated

3 years agonetwork: a couple of tweaks suggested by Coccinelle
Frantisek Sumsal [Fri, 17 Dec 2021 19:16:18 +0000 (20:16 +0100)] 
network: a couple of tweaks suggested by Coccinelle

3 years agonetwork: dhcp4: pass IPServiceType=none to dhcp client
Yu Watanabe [Fri, 17 Dec 2021 20:15:44 +0000 (05:15 +0900)] 
network: dhcp4: pass IPServiceType=none to dhcp client

Follow-up for b55093ce8884ee4fc72f28c6fd5e39897e921e21.

3 years agoman: fix machine-id(5) man page reference
Frantisek Sumsal [Fri, 17 Dec 2021 19:59:10 +0000 (20:59 +0100)] 
man: fix machine-id(5) man page reference

Spotted whilst debugging:
```
[763/2094] Generating man/machine-info.html with a custom command
Element cite in namespace '' encountered in para, but no template matches.
[765/2094] Generating man/machine-info.5 with a custom command
Element cite in namespace '' encountered in para, but no template matches.
```

Follow-up to 357376d0bb5.

3 years agoMerge pull request #21800 from keszybz/net-id-debugging
Yu Watanabe [Fri, 17 Dec 2021 23:35:08 +0000 (08:35 +0900)] 
Merge pull request #21800 from keszybz/net-id-debugging

Add more debugging info to udev builtin net_id

3 years agoRevert "core: Propagate condition failed state to triggering units."
Daan De Meyer [Fri, 17 Dec 2021 18:39:29 +0000 (19:39 +0100)] 
Revert "core: Propagate condition failed state to triggering units."

This reverts commit 12ab94a1e4961a39c32efb60b71866ab588d3ea2.

3 years agoudev/net_id: add debug logging for construction of device names 21800/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Dec 2021 10:43:26 +0000 (11:43 +0100)] 
udev/net_id: add debug logging for construction of device names

I think this makes it much easier to figure out what information sources
were used to generate the names, and why certain names were not generated.

On my laptop:

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
wwp0s20f0u2i12: addr_assign_type=3, MAC address is not permanent.
wwp0s20f0u2i12: Parsing slot information from sysname "0000:00:14.0": success
wwp0s20f0u2i12: dev_port=0
wwp0s20f0u2i12: PCI path identifier: domain=0 bus=0 slot=20 func=0 phys_port= dev_port=0 → p0s20f0
wwp0s20f0u2i12: USB name identifier: ports=2 config=1 interface=12 → u2i12
ID_NET_NAME_PATH=wwp0s20f0u2i12

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
ID_NET_NAME_MAC=en54ee75cb1dc0
enp0s31f6: MAC address identifier: hw_addr=54:ee:75:cb:1d:c0 → 54ee75cb1dc0
ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co.,Ltd.
enp0s31f6: Parsing slot information from sysname "0000:00:1f.6": success
enp0s31f6: dev_port=0
enp0s31f6: PCI path identifier: domain=0 bus=0 slot=31 func=6 phys_port= dev_port=0 → p0s31f6
ID_NET_NAME_PATH=enp0s31f6

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
ID_NET_NAME_MAC=en0050b6856d36
hub0: MAC address identifier: hw_addr=00:50:b6:85:6d:36 → 0050b6856d36
ID_OUI_FROM_DATABASE=GOOD WAY IND. CO., LTD.
hub0: Parsing slot information from sysname "0000:00:14.0": success
hub0: dev_port=0
hub0: PCI path identifier: domain=0 bus=0 slot=20 func=0 phys_port= dev_port=0 → p0s20f0
hub0: USB name identifier: ports=4.1.3 config=2 interface=0 → u4u1u3c2
ID_NET_NAME_PATH=enp0s20f0u4u1u3c2

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
wlp4s0: addr_assign_type=3, MAC address is not permanent.
wlp4s0: Parsing slot information from sysname "0000:04:00.0": success
wlp4s0: dev_port=0
wlp4s0: PCI path identifier: domain=0 bus=4 slot=0 func=0 phys_port= dev_port=0 → p4s0
ID_NET_NAME_PATH=wlp4s0

3 years agobootctl: deprecate --make-machine-id-directory=auto 21807/head
Zbigniew Jędrzejewski-Szmek [Fri, 17 Dec 2021 17:37:08 +0000 (18:37 +0100)] 
bootctl: deprecate --make-machine-id-directory=auto

Now that kernel-install creates the machine-id directory, we don't need to do
this is 'bootctl install', and in fact it's better not to do this since it
might never be necessary. So let's change the default behaviour to 'no'.

I kept support for 'auto' to maintain backwards compatibility, even though the
default was changed. Previous behaviour can be requested by specifying
--make-machine-id-directory=auto.

3 years agobootctl: write KERNEL_INSTALL_LAYOUT=bls and KERNEL_INSTALL_MACHINE_ID=…
Zbigniew Jędrzejewski-Szmek [Fri, 17 Dec 2021 15:06:51 +0000 (16:06 +0100)] 
bootctl: write KERNEL_INSTALL_LAYOUT=bls and KERNEL_INSTALL_MACHINE_ID=…

This is a natural extension of d6bce6e224: if we are installing sd-boot, we
want to use the sd-boot layout, so let's write the appropriate
KERNEL_INSTALL_LAYOUT setting. Effectively, if we do 'booctl install',
kernel-install will not autodetect the layout anymore.

And 357376d0bb added support for KERNEL_INSTALL_MACHINE_ID. We need to support
it here too. We both read it, so that we create the right directories, and also
write it if it wasn't written yet and we created some directories using it, so
that kernel-install that is executed later knows the machine-id that matches
the directories we crated.

The code is changed in some places to fail if we can't figure out the current
status. When installing the boot loader it's probably better not to guess.

3 years agotest: adjust MemoryHigh= on oomd extended test units
Anita Zhang [Fri, 17 Dec 2021 12:19:53 +0000 (04:19 -0800)] 
test: adjust MemoryHigh= on oomd extended test units

On some runs `sleep infinity` run by the user manager uses over 3M of
memory, which is higher than the MemoryHigh= set on testbloat and
testmunch. If no pgscan is generated, then systemd-oomd sorts by memory
usage which leads to a situation where testchill (using 3M) could be
targeted over testbloat (1M-2M).

Fix this by setting reasonable MemoryHigh= values for all of these test
units. Even if somehow testchill throttles a bit at 3M, testbloat and
testmunch should still be trying to use over 100M at memory and will
throttle down to 5M and 6M with the new values. This should reflect
the desired state in pgscan and memory usage during the test run.

Fixes #21684

3 years agokernel-install: replace 00-entry-directory with K_I_LAYOUT in k-i
наб [Tue, 16 Mar 2021 15:47:34 +0000 (16:47 +0100)] 
kernel-install: replace 00-entry-directory with K_I_LAYOUT in k-i

341890de866f2ee34919a47ce3fc6c8cd3c1924c made "bootctl install" create
ESP\MID, in preparation of cf73f650890b56a59bfb713c4c82b4e29daa7316 that
followed it and created 00-entry-directory.install to make ESP\MID\KVER
if ESP\MID existed ‒ this meant that "bootctl install" followed by
"kernel-install $(uname -r) /boot/vml*$(uname -r) /boot/ini*$(uname -r)"
actually installed the kernel correctly.

Later, 31e57550b552e113bd3d44355b237c41e42beb58 reverted the first
commit, meaning, that now running those two commands first installs
sd-boot, but then does nothing. Everything appears to work right,
nothing errors out, but no changes are actually done. To the untrained
eye (all of them), even running with -v appears to work:
all the hooks are run, as is depmod, but, again, nothing happens.

This is horrible. Nothing in either manpage suggests what to do
(nor should it, really), but the user is left with a bootloader that
appears fully funxional, since nothing suggests a failure in the output,
but with an unbootable machine, /no way to boot it/, even if they drop
to an EFI shell, since the boot bundle isn't present on the ESP,
and no real recourse even if they boot into a recovery system,
apart from installing like GRUB or whatever.

00- is purely instrumentation for 90-,
and separating one from the other has led to downstream dissatisfaxion
(indeed, the last mentioned commit cited cited exactly that as the
 reversion reason), while creating $ENTRY_DIR_ABS is only required
for bootloaders using the BLS, and shouldn't itself toggle anything.

To that end, introduce an /{e,l}/k/install.conf file that allows
overriding the detected layout, and detect it as "bls" if
$BOOT_ROOT/$MACHINE_ID ($ENTRY_DIR_ABS/..) exists, otherwise "other" ‒
if a user wishes to select a different bootloader,
like GRUB, they (or, indeed, the postinst script) can specify
layout=grub. This disables 90- and $ENTRY_DIR_ABS manipulation.

3 years agologind: add a comment with a reminder why we don't use ProtrectProc=
Luca Boccassi [Fri, 17 Dec 2021 12:19:25 +0000 (12:19 +0000)] 
logind: add a comment with a reminder why we don't use ProtrectProc=

Follow-up for https://github.com/systemd/systemd/pull/21785

3 years agologind: allow to read /proc
Ludwig Nussel [Tue, 14 Dec 2021 13:59:19 +0000 (14:59 +0100)] 
logind: allow to read /proc

User name and tty are used for wall messages. For that to work logind
must be able to poke around in proc entries of other processes.

3 years agoudev/net_id: use STRLEN() to make code clearer
Zbigniew Jędrzejewski-Szmek [Fri, 17 Dec 2021 10:35:50 +0000 (11:35 +0100)] 
udev/net_id: use STRLEN() to make code clearer

The code was correct, but looked suspicious: we were comparing
strlen(x) with sizeof(y), with looks like an off-by-one. But we actually
want x to be one longer than y, so that's fine. Let's use STRLEN() to
make this more obvious.

While at it, drop unnecessary "_" prefix.

3 years agoudev/net_id: fix signedness in format string
Zbigniew Jędrzejewski-Szmek [Fri, 17 Dec 2021 10:29:57 +0000 (11:29 +0100)] 
udev/net_id: fix signedness in format string

Both variables are unsigned. In practice those numbers cannot be large
enough to become negative, but let's use the correct type anyway.

3 years agoman: use unicode superscripts to indicate the exponent
Zbigniew Jędrzejewski-Szmek [Fri, 17 Dec 2021 10:23:28 +0000 (11:23 +0100)] 
man: use unicode superscripts to indicate the exponent

3 years agoman: fix two typos
Zbigniew Jędrzejewski-Szmek [Fri, 17 Dec 2021 10:22:07 +0000 (11:22 +0100)] 
man: fix two typos

3 years agonetwork: dhcp: logs received 6rd option
Yu Watanabe [Thu, 16 Dec 2021 20:10:35 +0000 (05:10 +0900)] 
network: dhcp: logs received 6rd option

Addresses https://github.com/systemd/systemd/pull/21625#issuecomment-996109051.

3 years agotest: mark TEST-46-HOMED as skipped if feature is disabled
Michael Biebl [Thu, 16 Dec 2021 18:32:01 +0000 (19:32 +0100)] 
test: mark TEST-46-HOMED as skipped if feature is disabled

See https://github.com/systemd/systemd/pull/21253#issuecomment-995721856

3 years agotest: record missing openssl as a failure
Michael Biebl [Thu, 16 Dec 2021 18:18:28 +0000 (19:18 +0100)] 
test: record missing openssl as a failure

The openssl binary is an optional dependency.
If systemd has been built with OpenSSL support, we want to test its
OpenSSL functionality.
So record a failure message in /failed if the binary is missing.

See https://github.com/systemd/systemd/pull/21724#issuecomment-992707614

3 years agoNEWS: fix typo
Yu Watanabe [Thu, 16 Dec 2021 19:12:14 +0000 (04:12 +0900)] 
NEWS: fix typo

3 years agoboot: fix typo
Yu Watanabe [Thu, 16 Dec 2021 19:11:41 +0000 (04:11 +0900)] 
boot: fix typo

3 years agoMerge pull request #21786 from keszybz/dirent-work
Yu Watanabe [Thu, 16 Dec 2021 19:07:35 +0000 (04:07 +0900)] 
Merge pull request #21786 from keszybz/dirent-work

Make FOREACH_DIRENT and FOREACH_DIRENT_ALL declare the iterator variables

3 years agoMerge pull request #21736 from yuwata/network-cleanups-for-drop-foreign-configs
Yu Watanabe [Thu, 16 Dec 2021 19:07:00 +0000 (04:07 +0900)] 
Merge pull request #21736 from yuwata/network-cleanups-for-drop-foreign-configs

network: cleanups for dropping foreign configs

3 years agoMerge pull request #21790 from keszybz/network-generator-always
Luca Boccassi [Thu, 16 Dec 2021 15:50:39 +0000 (15:50 +0000)] 
Merge pull request #21790 from keszybz/network-generator-always

Enable systemd-network-generator by default

3 years agotest-network: wait for veth99 being configured 21736/head
Yu Watanabe [Thu, 16 Dec 2021 14:54:17 +0000 (23:54 +0900)] 
test-network: wait for veth99 being configured

As the address, which should be kept, may not be just removed yet.
Let's check that the address is actually kept.

3 years agonetwork: route: link_drop_foreign_routes() must be called only for managed interfaces
Yu Watanabe [Sat, 11 Dec 2021 17:52:09 +0000 (02:52 +0900)] 
network: route: link_drop_foreign_routes() must be called only for managed interfaces

3 years agonetworkd: check the existence of the route
Yu Watanabe [Sat, 11 Dec 2021 17:48:03 +0000 (02:48 +0900)] 
networkd: check the existence of the route

3 years agoMerge pull request #21791 from mrc0mmand/TEST-64-tweaks
Frantisek Sumsal [Thu, 16 Dec 2021 14:22:35 +0000 (14:22 +0000)] 
Merge pull request #21791 from mrc0mmand/TEST-64-tweaks

A couple of TEST-64-UDEV-STORAGE tweaks

3 years agonetwork: address: minor optimization for link_drop_foreign_addresses()
Yu Watanabe [Sat, 11 Dec 2021 17:30:27 +0000 (02:30 +0900)] 
network: address: minor optimization for link_drop_foreign_addresses()

link_address_is_dynamic() is costful in general. Call it only when
KeepConfiguration= is set.

Note, it is not necessary to check link->network in the loop, as we have
the assertion for that in the beginning of the function.

3 years agonetwork: drop IPv6LL addresses manually configured in .network file
Yu Watanabe [Sat, 11 Dec 2021 17:26:22 +0000 (02:26 +0900)] 
network: drop IPv6LL addresses manually configured in .network file

3 years agoNEWS: update again
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 13:17:33 +0000 (14:17 +0100)] 
NEWS: update again

3 years agoMerge pull request #21757 from DaanDeMeyer/boot-id
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 12:47:17 +0000 (13:47 +0100)] 
Merge pull request #21757 from DaanDeMeyer/boot-id

kernel-install: Introduce KERNEL_INSTALL_MACHINE_ID in /etc/machine-info

3 years agokernel-install: Introduce KERNEL_INSTALL_MACHINE_ID in /etc/machine-info 21757/head
Daan De Meyer [Tue, 14 Dec 2021 16:09:08 +0000 (17:09 +0100)] 
kernel-install: Introduce KERNEL_INSTALL_MACHINE_ID in /etc/machine-info

If KERNEL_INSTALL_MACHINE_ID is defined in /etc/machine-info, prefer it
over the machine ID from /etc/machine-id. If a machine ID is defined in
neither /etc/machine-info nor in /etc/machine-id, generate a new UUID
and try to write it to /etc/machine-info as KERNEL_INSTALL_MACHINE_ID
and use it as the machine ID if writing it to /etc/machine-info succeeds.

In practice, this means we have a more robust fallback if there's no
machine ID in /etc/machine-id than just using "Default" and allows
image builders to force kernel-install to use KERNEL_INSTALL_MACHINE_ID
by simply writing it to /etc/machine-info themselves.

3 years agoMerge pull request #20559 from tomty89/stub_check_in_get
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 11:18:53 +0000 (12:18 +0100)] 
Merge pull request #20559 from tomty89/stub_check_in_get

resolved: filter stub listeners in manager_get_dns_server()

3 years agotest: bump the timeout when collecting test coverage 21791/head
Frantisek Sumsal [Thu, 16 Dec 2021 11:05:01 +0000 (12:05 +0100)] 
test: bump the timeout when collecting test coverage

3 years agotest: settle before checking logs
Frantisek Sumsal [Thu, 16 Dec 2021 10:59:09 +0000 (11:59 +0100)] 
test: settle before checking logs

Otherwise we might miss the "Device path too long" message:

```
[   21.083274] testsuite-64.sh[374]: swapoff /dev/vda1
[   21.089841] testsuite-64.sh[376]: ++ mktemp
[   21.095115] testsuite-64.sh[271]: + logfile=/tmp/tmp.a1MULA35wL
[   21.095115] testsuite-64.sh[271]: + journalctl -b -q --no-pager -o short-monotonic -p info --grep 'Device path.*vda.?'\'' too long to fit into unit name'
...
[   21.277360] systemd[1]: testsuite-64.service: Main process exited, code=exited, status=1/FAILURE
[   21.277508] systemd[1]: testsuite-64.service: Failed with result 'exit-code'.
...
[   21.323500] systemd[1]: Device path '/sys/devices/pci0000:00/0000:00:03.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/0000:07:00.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/0000:0e:00.0/0000:0f:00.0/0000:10:00.0/0000:11:00.0/0000:12:00.0/0000:13:00.0/0000:14:00.0/0000:15:00.0/0000:16:00.0/0000:17:00.0/0000:18:00.0/0000:19:00.0/0000:1a:00.0/virtio0/block/vda/vda1' too long to fit into unit name, ignoring device.

```

3 years agomeson: drop three more single-use convenience libraries 21786/head
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 10:51:08 +0000 (11:51 +0100)] 
meson: drop three more single-use convenience libraries

The way that the cryptsetup plugins were built was unnecessarilly complicated.
We would build three static libraries that would then be linked into dynamic
libraries. No need to do this.

While at it, let's use a convenience library to avoid compiling the shared code
more than once.

We want the output .so files to be located in the main build directory,
like with all consumable build artifacts, so we need to maintain the split
between src/cryptsetup/cryptsetup-token/meson.build and the main meson.build
file.

AFAICT, the build artifacts are the same: exported and undefined symbols are
identical. There is a tiny difference in size, but I think it might be caused
by a different build directory name.

3 years agomeson: drop convenience library that was only used in one place
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 10:09:51 +0000 (11:09 +0100)] 
meson: drop convenience library that was only used in one place

It doesn't make much sense to do this, the result is very similar to including
to objects directly in the output binary without going through an intermediate
target.

The linkage of test-libudev was rather strange too: udev_link_with is used to
allow udev to be linked to a static version of libshared, so that udev is not
linked to libshared.so. But here we were using both, defeating the purpose of
udev_link_with. I don't think it matters what the test is linked to, so let's
use the non-static linkage to save space.

3 years agomeson: stop building out convenience libraries by default
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 09:58:44 +0000 (10:58 +0100)] 
meson: stop building out convenience libraries by default

The meson default for static_library() are:
build_by_default=true, install=false. We never interact with the
static libraries, and we only care about them as a stepping-stone towards
the installable executables or libraries. Thus let's only build them if
they are a dependency of something else we are building.

While at it, let's drop install:false, since this appears to be the default.

This change would have fixed the issue with lib_import_common failing
to build too: we wouldn't attempt to build it.

In practice this changes very little, because we generally only declare static
libraries where there's something in the default target that will make use of
them. But it seems to be a better pattern to set build_by_default to false.

3 years agomeson: don't compile import sources four times
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 14:39:43 +0000 (15:39 +0100)] 
meson: don't compile import sources four times

Use a 'convenience library' to do the compilation once and then link the
objects into all the files that need it. Those files are small, so this probably
doesn't matter too much for speed, but has the advantage that we don't get the
same error four times if something goes wrong.

The library is conditionalized in the same way importd itself, because we
cannot build it without the deps.

3 years agoman: split out a paragraph and shorten the text about sd-network-generator 21790/head
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 08:56:13 +0000 (09:56 +0100)] 
man: split out a paragraph and shorten the text about sd-network-generator

The ordering of the service wrt. to udevd is enforced by unit configuration,
so no need to tell the user about this. From users' POV, the only thing that
counts is that the unit is enabled and then the right thing happens.

3 years agounits: enable systemd-network-generator by default
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 08:46:26 +0000 (09:46 +0100)] 
units: enable systemd-network-generator by default

It is used by udevd and networkd. Since udevd is enabled statically, let's also
change the preset to "on". networkd is opt-in, so let's pull in the generator
when enabling networkd too.

3 years agoMerge pull request #21766 from yuwata/network-generator-name-policy
Zbigniew Jędrzejewski-Szmek [Thu, 16 Dec 2021 08:34:01 +0000 (09:34 +0100)] 
Merge pull request #21766 from yuwata/network-generator-name-policy

network-generator: support setting NamePolicy=

3 years agoMerge pull request #21784 from DaanDeMeyer/issue-21675
Luca Boccassi [Wed, 15 Dec 2021 22:38:00 +0000 (22:38 +0000)] 
Merge pull request #21784 from DaanDeMeyer/issue-21675

journal: Hole punching improvements

3 years agoDefine FOREACH_DIRENT through FOREACH_DIRENT_ALL
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 11:52:58 +0000 (12:52 +0100)] 
Define FOREACH_DIRENT through FOREACH_DIRENT_ALL

As in the previous commit, 'de' is used as the iterator variable name.

3 years agonetwork: route: update comment
Yu Watanabe [Wed, 15 Dec 2021 18:36:06 +0000 (03:36 +0900)] 
network: route: update comment

3 years agojournal: Stop reading in increments of block size during hole punching 21784/head
Daan De Meyer [Wed, 15 Dec 2021 17:23:15 +0000 (18:23 +0100)] 
journal: Stop reading in increments of block size during hole punching

Let's not try to be overly clever here. This code path is not overly
performance sensitive and we should avoid trying to outsmart the kernel
without proper benchmarking.

3 years agojournal: Use 16kb buffer during hole punching
Daan De Meyer [Wed, 15 Dec 2021 17:22:17 +0000 (18:22 +0100)] 
journal: Use 16kb buffer during hole punching

Let's use the same buffer size as used in as copy.h.

3 years agojournal: Correctly advance offset when iterating hash table entries
Daan De Meyer [Wed, 15 Dec 2021 17:18:25 +0000 (18:18 +0100)] 
journal: Correctly advance offset when iterating hash table entries

pread() is not guaranteed to completely fill up the given buffer with
data which we assumed until now. Instead, only increment the offset by
the number of bytes that were actually read.

3 years agojournal: Add a minimum hole size for hole punching
Daan De Meyer [Wed, 15 Dec 2021 17:17:22 +0000 (18:17 +0100)] 
journal: Add a minimum hole size for hole punching

Let's not bother punching extremely small holes to avoid unnecessary
file fragmentation.

3 years agoNEWS: update networkd related entries
Yu Watanabe [Wed, 15 Dec 2021 17:12:03 +0000 (02:12 +0900)] 
NEWS: update networkd related entries

3 years agotest: add testcases for net.ifname-policy= kernel command line argument 21766/head
Yu Watanabe [Tue, 14 Dec 2021 04:11:17 +0000 (13:11 +0900)] 
test: add testcases for net.ifname-policy= kernel command line argument

3 years agonetwork-generator: support to set NamePolicy= through kernel command line argument
Yu Watanabe [Tue, 14 Dec 2021 02:29:08 +0000 (11:29 +0900)] 
network-generator: support to set NamePolicy= through kernel command line argument

Closes #16296.

3 years agoudev: move NamePolicy to netif-naming-scheme.[ch]
Yu Watanabe [Tue, 14 Dec 2021 02:26:44 +0000 (11:26 +0900)] 
udev: move NamePolicy to netif-naming-scheme.[ch]

3 years agonetwork-generator: support MAC address longer or shorter than ETH_ALEN
Yu Watanabe [Tue, 14 Dec 2021 01:38:02 +0000 (10:38 +0900)] 
network-generator: support MAC address longer or shorter than ETH_ALEN

3 years agomeson: build network-generator unconditionally
Yu Watanabe [Wed, 15 Dec 2021 16:51:22 +0000 (01:51 +0900)] 
meson: build network-generator unconditionally

The service also generates .link files for udevd.

3 years agounit: run network-generator before starting udevd
Yu Watanabe [Tue, 14 Dec 2021 04:12:41 +0000 (13:12 +0900)] 
unit: run network-generator before starting udevd

Otherwise, .link files generated by the service may not be loaded by
udevd.

3 years agotree-wide: make FOREACH_DIRENT_ALL define the iterator variable
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 14:02:55 +0000 (15:02 +0100)] 
tree-wide: make FOREACH_DIRENT_ALL define the iterator variable

The variable is not useful outside of the loop (it'll always be null
after the loop is finished), so we can declare it inline in the loop.
This saves one variable declaration and reduces the chances that somebody
tries to use the variable outside of the loop.

For consistency, 'de' is used everywhere for the var name.

3 years agokernel-install: Remove "Default" from list of suffixes checked
Daan De Meyer [Wed, 15 Dec 2021 12:58:24 +0000 (13:58 +0100)] 
kernel-install: Remove "Default" from list of suffixes checked

This was an undocumented change in behavior introduced by
9e82a74cb0f08a288f9db228a0b5bec8a7188cdb. Previously, we only
checked for "Default" if we didn't find a machine ID. Let's make
sure we keep the previous behavior intact.

3 years agoMerge pull request #21763 from yuwata/udevadm-write-only-attributes
Zbigniew Jędrzejewski-Szmek [Wed, 15 Dec 2021 12:22:45 +0000 (13:22 +0100)] 
Merge pull request #21763 from yuwata/udevadm-write-only-attributes

udevadm: also show write-only attributes

3 years agoresolved: filter out our own stub resolvers when parsing servers 20559/head
Zbigniew Jędrzejewski-Szmek [Wed, 15 Dec 2021 10:42:59 +0000 (11:42 +0100)] 
resolved: filter out our own stub resolvers when parsing servers

We get "upstream" dns server config from ~three places: /etc/resolv.conf,
config files, and runtime config via dbus. With this commit, we'll filter out
our own stub listeners if they are configured in either of the first two
sources. For /etc/resolv.conf this is done quitely, and for our own config
files, a LOG_INFO message is emitted, since this is a small inconsistency in
the config.

Setting loops like this over dbus is still allowed. The reason is that in the
past we didn't treat this as an error, and if we were to start responding with
an error, we could break a scenario that worked previously. E.g. NM sends us a
list of servers, and one happens to be the our own. We would just not use that
stub server before, but it'd still be shown in the dbus properties and such.
We would have to return error for the whole message, also rejecting the other
valid servers. I think it's easier to just keep that part unchanged.

Test case:
$ ls -l /etc/resolv.conf
-rw-r--r-- 1 root root 57 Dec 15 10:26 /etc/resolv.conf
$ cat /etc/resolv.conf
nameserver 192.168.150.1
options edns0 trust-ad
search .
$ cat /etc/systemd/resolved.conf.d/stub.conf
[Resolve]
DNSStubListenerExtra=192.168.150.1

$ resolvectl
...
Global
    resolv.conf mode: foreign
         DNS Servers: 192.168.150.1
Fallback DNS Servers: ...
(with the patch):
Global
    resolv.conf mode: foreign
Fallback DNS Servers: ...

3 years agoresolved: return immediately if we already know what to return
Zbigniew Jędrzejewski-Szmek [Wed, 15 Dec 2021 09:54:17 +0000 (10:54 +0100)] 
resolved: return immediately if we already know what to return

3 years agohwdb: Add accel orientation quirk for the Chuwi Hi10 Go tablet
Jayce Fayne [Tue, 14 Dec 2021 13:57:38 +0000 (14:57 +0100)] 
hwdb: Add accel orientation quirk for the Chuwi Hi10 Go tablet

3 years agofstab-generator: do not remount /sys when running in a container
Yu Watanabe [Sun, 12 Dec 2021 02:43:21 +0000 (11:43 +0900)] 
fstab-generator: do not remount /sys when running in a container

Closes #21744.

3 years agojournactl: show info about journal range only at debug level (#21775)
Zbigniew Jędrzejewski-Szmek [Tue, 14 Dec 2021 21:30:15 +0000 (22:30 +0100)] 
journactl: show info about journal range only at debug level (#21775)

The message that the "journal begins … ends …" has been always confusing to
users. (Before b91ae210e62 it was "logs begin … end …" which was arguably even
more confusing, but really the change in b91ae210e62 didn't substantially change
this.)

When the range shown is limited (by -e, -f, --since, or other options), it
doesn't really matter to the user what the oldest entries are, since they are
purposefully limiting the range. In fact, if we are showing the last few
entries with -e or -f, knowing that many months the oldest entries have is
completely useless.

And when such options are *not* used, the first entry generally corresponds to
the beginning of the range shown, and the last entry corresponds to the end of
that range. So again, it's not particularly useful, except when debugging
journalctl or such. Let's just treat it as a debug message.

Fixes #21491.

3 years agohostnamectl: add a chassis symbol in status output
Zbigniew Jędrzejewski-Szmek [Tue, 14 Dec 2021 11:25:10 +0000 (12:25 +0100)] 
hostnamectl: add a chassis symbol in status output

The idea is to be able to distinguish whether we're in a VM/container or something
more substantial at a glance.
         Chassis: laptop 💻
         Chassis: tablet 具
         Chassis: vm 🖴
         Chassis: server 🖳
         Chassis: handset 🕻
         Chassis: watch ⌚
         Chassis: desktop 🖥
         Chassis: container ☐

3 years agoMerge pull request #21769 from yuwata/home-fix-heap-use-after-free
Luca Boccassi [Tue, 14 Dec 2021 15:54:00 +0000 (15:54 +0000)] 
Merge pull request #21769 from yuwata/home-fix-heap-use-after-free

home: fix heap-use-after-free

3 years agoudevadm: also show write-only attributes 21763/head
Yu Watanabe [Mon, 13 Dec 2021 21:25:03 +0000 (06:25 +0900)] 
udevadm: also show write-only attributes

3 years agosd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes
Yu Watanabe [Mon, 13 Dec 2021 21:24:24 +0000 (06:24 +0900)] 
sd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes

Closes #10102.

3 years agohome: fix heap-use-after-free 21769/head
Yu Watanabe [Tue, 14 Dec 2021 06:38:12 +0000 (15:38 +0900)] 
home: fix heap-use-after-free

`bus_home_emit_remove()` may be called from manager_free() -> home_free().
In that case, manager->bus is already unref()ed.

Fixes #21767.

3 years agohome: clear Manager::bus, ::event, ::homes_by_xxx and so on
Yu Watanabe [Tue, 14 Dec 2021 10:37:27 +0000 (19:37 +0900)] 
home: clear Manager::bus, ::event, ::homes_by_xxx and so on

`home_free()` may try to call some dbus or event related functions.
To prevent that, set those variables NULL.

3 years agopolkit: make bus_verify_polkit_async_registry_free() return Hashmap* with NULL
Yu Watanabe [Tue, 14 Dec 2021 10:36:34 +0000 (19:36 +0900)] 
polkit: make bus_verify_polkit_async_registry_free() return Hashmap* with NULL

3 years agowait-online: also use address state even when operational state is below degraded
Yu Watanabe [Mon, 13 Dec 2021 11:14:06 +0000 (20:14 +0900)] 
wait-online: also use address state even when operational state is below degraded

Closes #21706.

3 years agoshell-completion: Add completion for systemd-analyze critical-chain
Nishal Kulkarni [Tue, 14 Dec 2021 08:43:13 +0000 (14:13 +0530)] 
shell-completion: Add completion for systemd-analyze critical-chain

systemd-analyze critical-chain accepts an optional unit argument,
however currently there's no shell-completion for it
This change provides unit name completion for both bash and zsh.

Closes: #20927
3 years agoFix loading of graphs
acsfer [Tue, 14 Dec 2021 06:25:00 +0000 (07:25 +0100)] 
Fix loading of graphs

3 years agoboot, meson: allow statically linked build
Robert Scheck [Sun, 12 Dec 2021 00:27:03 +0000 (01:27 +0100)] 
boot, meson: allow statically linked build

Build option "link-boot-shared" to build a statically linked bootctl and
systemd-bless-boot by using

  -Dlink-boot-shared=false

on systems with full systemd stack except bootctl and systemd-bless-boot,
such as CentOS/RHEL 9.