1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-07 17:17:44 +03:00
Commit Graph

61787 Commits

Author SHA1 Message Date
Alvin Šipraga
986b2514cc network: wifi: check SSID when AP interfaces go up
When an AP goes up, the kernel may emit a netlink event indicating that
the interface has gained carrier. In that event, we should check if the
SSID has changed before attempting to reconfigure. Not doing so means
that the link->ssid member is not updated, leading to a potential
mismatch if some of the .network configurations match on SSID=.

There are however scenarios where the above heuristic is not enough.
Specifically, if the interface carrier state flip-flops within a short
enough interval, the internal throttling of netlink events inside the
kernel may suppress intermediate linkdown+linkup events (cf. Linux
net/core/link_watch.c). So there is no linkup event to react on.

To improve on the latter scenario, it is proposed to make newer kernels
emit an NL80211_CMD_START_AP multicast event when an AP goes up. This
event will not be dropped by link_watch. systemd-networkd can then react
to such events as well, and optionally reconfigure the link if the SSID
has changed. This will only work with newer kernels though.
2022-12-16 03:38:10 +09:00
Yu Watanabe
ed9911630e core/unit: fix log message
As you can see in the below, the dropped dependency Before=issue-24990.service
is not logged, but the dependency Before=test1.service which is not owned by
the units generated by the TEST-26 is logged.

Before:
systemd[1]: issue-24990.service: Dependency After=test1.service dropped, merged into issue-24990.service
systemd[1]: issue-24990.service: Dependency Before=test1.service dropped, merged into issue-24990.service

After:
systemd[1]: issue-24990.service: Dependency After=test1.service is dropped, as test1.service is merged into issue-24990.service.
systemd[1]: issue-24990.service: Dependency Before=issue-24990.service in test1.service is dropped, as test1.service is merged into issue-24990.service.
2022-12-16 03:15:51 +09:00
Lennart Poettering
7eb51b8e3e man: add two signature key example to systemd-measure
@keszybz asked for an example with --append= used in the systemd-measure
man page. Here it is.

As requested: https://github.com/systemd/systemd/pull/25224#pullrequestreview-1190709772
2022-12-15 18:39:00 +01:00
Lennart Poettering
557bde331b systemctl: don't unlink non-existing temporary files 2022-12-15 17:54:27 +01:00
Lennart Poettering
1ae886fe28 systemctl: if we edit a single file only, jump to the right line 2022-12-15 17:53:49 +01:00
Lennart Poettering
d88e1e484a systemctl: stop using basename() at one more place 2022-12-15 17:53:07 +01:00
Lennart Poettering
0ce6f0a35a systemctl: line break string where the newlines are 2022-12-15 17:52:26 +01:00
Lennart Poettering
2865507008 systemctl: minor modernizations/simplifications 2022-12-15 17:51:45 +01:00
Lennart Poettering
8eda5560b0 systemctl: simplify trim_edit_markers()
This is not performance sensitive, don#t try to be smart with realloc()

Follow-up for: #25305
Fixes: #25303
2022-12-15 17:51:11 +01:00
Yu Watanabe
0b92fbbaee test: fix typo 2022-12-16 01:38:08 +09:00
Yu Watanabe
9b8eb412ca
Merge pull request #25756 from yuwata/test-resolve-1
test: several cleanups for TEST-75-RESOLVE
2022-12-16 00:53:52 +09:00
Yu Watanabe
6f3473ca03
Merge pull request #25718 from yuwata/locale-cleanups
locale: avoid TOCTOU in reading config files
2022-12-16 00:51:13 +09:00
Nick Rosbrook
f68f644a16 test-network: add a test for renaming device to current altname 2022-12-15 10:36:14 -05:00
Frantisek Sumsal
a32831ae1d mkosi: work around a file conflict between systemd and systemd-boot 2022-12-15 16:04:28 +01:00
Daan De Meyer
84a4d23f52 repart: Use "defer" in docs instead of "skip" 2022-12-15 15:45:00 +01:00
Nick Rosbrook
b338a8bb40 sd-netlink: add a test for rtnl_set_link_name()
Add a test that verifies a deleted alternative name is restored on error
in rtnl_set_link_name().
2022-12-15 09:39:05 -05:00
Nick Rosbrook
53584e7b61 udev: attempt device rename even if interface is up
Currently rename_netif() will not attempt to rename a device if it is
already up, because the kernel will return -EBUSY unless live renaming
is allowed on the device. This restriction will be removed in a future
kernel version [1].

To cover both cases, always attempt to rename the interface and return 0
if we get -EBUSY.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=bd039b5ea2a9
2022-12-15 09:35:26 -05:00
Nick Rosbrook
4d600667f8 sd-netlink: restore altname on error in rtnl_set_link_name
If a current alternative name is to be used to rename a network
interface, the alternative name must be removed first. If interface
renaming fails, restore the alternative name that was deleted if
necessary.
2022-12-15 09:35:26 -05:00
Luca Boccassi
4895bacccb Manager: also log caller of daemon-reexec 2022-12-15 23:27:06 +09:00
Nick Rosbrook
080afbb57c sd-netlink: do not swap old name and alternative name
Commit 434a348380 ("netlink: do not fail when new interface name is
already used as an alternative name") added logic to set the old
interface name as an alternative name, but only when the new name is
currently an alternative name. This is not the desired outcome in most
cases, and the important part of this commit was to delete the new name
from the list of alternative names if necessary.
2022-12-15 09:21:53 -05:00
Nick Rosbrook
d0b31efc1a udev/net: allow new link name as an altname before renaming happens
When configuring a link's alternative names, the link's new name to-be
is not allowed to be included because interface renaming will fail if
the new name is already present as an alternative name. However,
rtnl_set_link_name will delete the conflicting alternative name before
renaming the device, if necessary.

Allow the new link name to be set as an alternative name before the
device is renamed. This means that if the rename is later skipped (i.e.
because the link is already up), then the name can at least still be
present as an alternative name.
2022-12-15 09:21:53 -05:00
Yu Watanabe
b3f1afc089
Merge pull request #24058 from qdeslandes/journald_regex_filtering
Allow for journald logs filtering on a per-unit basis
2022-12-15 22:03:33 +09:00
Yu Watanabe
133708b879 Revert "test: wait for the monitoring service to become active"
This reverts commit 5dd34c2604.

`resolvectl monitor` sends notify event, and systemd-run wait for the
service being in active state. Hence, the loop is not necessary.
2022-12-15 21:50:13 +09:00
Yu Watanabe
ef09861a0b test: suppress echo in monitor_check_rr() 2022-12-15 21:50:13 +09:00
Frantisek Sumsal
0969bb4246 packit: drop/replace deprecated directives 2022-12-15 21:48:49 +09:00
Daan De Meyer
640c02d529 repart: Fix integration test 2022-12-15 21:48:30 +09:00
Yu Watanabe
cd07f6e8e9
Merge pull request #25224 from poettering/measure-append
add --append= switch to systemd-measure
2022-12-15 21:47:29 +09:00
Yu Watanabe
f4128c8d51
Merge pull request #25735 from yuwata/switch-root-follow-ups
mount-util: several follow-ups for recent mount_switch_root() changes
2022-12-15 21:39:40 +09:00
mvzlb
109197df7a
hwdb: Fix mount matrix for CSL Panther Tab HD (#25752)
Commit a76d7aca sets ACCEL_MOUNT_MATRIX to match the device's casing
(landscape) instead of the LCD panel (portrait).
2022-12-15 19:59:14 +09:00
Lennart Poettering
c0e42509da update TODO 2022-12-15 11:40:21 +01:00
Lennart Poettering
6b41e0250f test: add integration test for systemd-measure --append= 2022-12-15 11:40:21 +01:00
Lennart Poettering
a5c690a8b5 measure: add --append= switch for merging signatures
Often it's useful to add multiple signatures in the signature JSON file
to embedd in a single .pcrsig. (For example, a signature by key X for
boot phase "enter-initrd" and one by key Y for
"enter-initrd:leave-initrd" or so). Make this easy, by adding the
ability to append signatures to a previously generated JSON file.
2022-12-15 11:40:21 +01:00
Lennart Poettering
3bb326c558 json: add helper for adding variant to array suppressing duplicates 2022-12-15 11:39:57 +01:00
Quentin Deslandes
1c9c6fc7df journal: add integration tests for log filtering
Add integration tests for journald's log filtering feature.
2022-12-15 09:57:39 +00:00
Quentin Deslandes
87a13dabbd journal: filter log based on LogFilterPatterns
Use LogFilterPatterns from the unit's cgroup xattr in order to keep or
discard log messages before writing them to the journal.
When a log message is discarded, it won't be written to syslog, console...
either.

When a native, syslog, or standard output log message is received,
systemd-journald will process it if it matches against at least one
allowed pattern (if any) and none of the denied patterns (if any).
2022-12-15 09:57:39 +00:00
Quentin Deslandes
b8c0565ec4 Create hash_ops structure to free keys of type pcre2_code 2022-12-15 09:57:39 +00:00
Quentin Deslandes
c00b95d5e9 systemctl: add support for LogFilterPatterns for show command
Parse DBus structure send by LogFilterPatterns to print it in systemctl
show.
2022-12-15 09:57:39 +00:00
Quentin Deslandes
523ea1237a journal: log filtering options support in PID1
Define new unit parameter (LogFilterPatterns) to filter logs processed by
journald.

This option is used to store a regular expression which is carried from
PID1 to systemd-journald through a cgroup xattrs:
`user.journald_log_filter_patterns`.
2022-12-15 09:57:39 +00:00
Quentin Deslandes
96c648fecd set: add set_make_nulstr
Add function set_make_nulstr() to create a nulstr out of a set. Behave
the same way as strv_make_nulstr().
2022-12-15 09:57:39 +00:00
Lennart Poettering
c68523e00d
Merge pull request #25350 from poettering/efi-guid-equal
efi: add efi_guid_equal() helper
2022-12-15 10:24:58 +01:00
Yu Watanabe
62650f4258
Merge pull request #25602 from fbuihuu/fix-TEST-73-LOCALE
localed: reload PID1 configuration after modifying /etc/locale.conf
2022-12-15 17:47:05 +09:00
Daan De Meyer
5c33b68652 repart: Rework Minimize= option settings
Instead of having Minimize= take a boolean let's allow for two
different ways to enable it. "best" means we want the most minimal
image possible, which currently is only possible for read-only
filesystems but can be extended in the future with bisection
to find the most minimal possible size.

We also add "guess", which is the current behavior, where we
populate once and use the sparse size to make a reasonable guess
on a size that fits all the sources without needing to O(log(n))
tries to find the most minimal size.
2022-12-15 15:09:09 +09:00
Yu Watanabe
9d50f8508b mount-util: make mount_switch_root() take a mount propagation flag 2022-12-15 14:17:22 +09:00
Yu Watanabe
edac5c4636 mountpoint-util: introduce mount_propagation_flag_is_valid() 2022-12-15 14:15:59 +09:00
Yu Watanabe
b205e59ad4 mountpoint-util: rename mount_propagation_flags_to_string() and friends as singular 2022-12-15 14:15:55 +09:00
Yu Watanabe
6c6eb219d5 mount-util: mount flag is unsigned long 2022-12-15 14:15:09 +09:00
Yu Watanabe
b8b4f80a8a mount-util: drop unnecessary inline attributes 2022-12-15 14:15:09 +09:00
Yu Watanabe
993681def8
Merge pull request #25743 from yuwata/timesync-ipv6
timesync: ignore IPv6 addresses when the kernel does not support it
2022-12-15 12:57:54 +09:00
Zbigniew Jędrzejewski-Szmek
7a14db9cfd basic: do not output emojis if not on a proper terminal
$TERM would generally be set if we're connected to a proper graphical terminal
emulator. In all other cases, in particular if $TERM is not set, we almost
certainly are not connected to something that can output emojis. In particular
the text console is unlikely to ever do it correctly.

So let's invert the check, and only write emojis if $TERM is set.

Fixes #25521.
2022-12-15 12:56:03 +09:00
Yu Watanabe
60e84f0205
Merge pull request #25732 from enr0n/unit-test-machine-id-initialized
unit tests: do not fail when `/etc/machine-id` is empty
2022-12-15 12:55:04 +09:00