Commit Graph

76795 Commits

Author SHA1 Message Date
Lennart Poettering
625f109604 sd-json: drop sd_json_dispatch_pid() again, as we prefer json_dispatch_pidref() now
The calls are now unused, and we generally prefer if people send a PID
triplet rather than a single PID, hence stop supporting a high-level
dispacher for pid_t.
2024-10-14 12:47:17 +02:00
Lennart Poettering
6bca1a7c6c machined: port all varlink APIs over to new PidRef serialization 2024-10-14 12:47:17 +02:00
Lennart Poettering
de34ec188c pidref: hookup PID_AUTOMATIC special pid_t value with PidRef
The PID_AUTOMATIC value is now properly recognized by the PidRef logic
too. This needed some massaging of header includes, to ensure pidref.h
can access process-util.h's definitions and vice versa.
2024-10-14 12:44:36 +02:00
Lennart Poettering
8d24b2f017 Merge pull request #34716 from dvdhrm/pr/derand
Clarify nameing-scheme in DESKTOP_ENVIRONMENT documentation
2024-10-14 11:51:43 +02:00
Yu Watanabe
f80d6b9304 bash-completion/busctl: support wait command
Follow-up for 30465af656.
2024-10-14 09:39:38 +01:00
Lennart Poettering
ab826c4647 Merge pull request #34730 from yuwata/boot-efi-follow-ups
boot/efi: several follow-ups for recent change
2024-10-14 09:56:47 +02:00
Yu Watanabe
4a7fd9d1d5 Merge pull request #34555 from rpigott/busctl-wait
busctl: add wait verb to wait for signals
2024-10-13 18:50:48 +09:00
Ronan Pigott
20c0711d8e busctl: add a test for busctl wait 2024-10-12 23:21:37 -07:00
Yu Watanabe
709fdcc75a Merge pull request #34520 from vcaputo/mmap-cache-unused-min
mmap-cache: enforce an unused windows minimum
2024-10-13 14:48:35 +09:00
Ronan Pigott
30465af656 busctl: add wait verb to wait for signals
It's like busctl call, but it waits for a signal rather than a reply to
a method call.
2024-10-12 19:30:56 -07:00
lumingzh
ee105218ad po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (253 of 253 strings)

Co-authored-by: lumingzh <lumingzh@qq.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main
2024-10-13 10:20:05 +09:00
Yu Watanabe
4169cad876 sha256: use memory-util-fundamental.h
Prompted by https://github.com/systemd/systemd/pull/34722#discussion_r1797352922.
2024-10-13 05:57:29 +09:00
Yu Watanabe
c16d297e79 boot/efi/log: always include filename, line, and function in log message
Then, drop unused log_trace().
2024-10-13 05:51:23 +09:00
Yu Watanabe
5254c687d0 boot/efi/smbios: initialize output parameters if entries not found 2024-10-13 05:51:23 +09:00
Yu Watanabe
f87e02ba3f boot/efi: trivial coding style cleanups
Follow-ups for #34717 and #34718.
2024-10-13 05:51:23 +09:00
Ryan Wilson
1863eecff2 Add integration test for ExtraFileDescriptors after daemon-reexec
This commit adds a corresponding integration test for ExtraFileDescriptors
after systemctl daemon-reexec. This ensures systemd keeps the file
descriptors while the service manager is restarting and we don't lose
ability to restart the service correctly.
2024-10-12 20:17:45 +02:00
Yu Watanabe
39b2ee5369 Merge pull request #34591 from teknoraver/timer
timer: introduce DeferReactivation setting
2024-10-12 08:12:38 +09:00
Yu Watanabe
d106887bb5 Merge pull request #34698 from yuwata/udev-node-lock-file
udev-node: remove stack directories and their lock files by workers, rather than manager
2024-10-12 08:12:10 +09:00
Yu Watanabe
8ffc83d3d4 Merge pull request #34722 from anonymix007/fundamental-sha1
fundamental: Add SHA1
2024-10-12 08:11:35 +09:00
Matteo Croce
9784ed760e timer: add unit tests for DeferReactivation
Create a unit test for systemd timer DeferReactivation config option.
The test works by creating a timer which fires every 5 seconds and
starts an unit which runs for 5 seconds.
With DeferReactivation=true, the timer must fire every 5+5 seconds,
instead of the 5 it fires normally.

As we need at least two timer runs to check if the delta is correct,
the test duration on success will be at least 20 seconds.
To be safe, the test script waits 35 seconds: this is enough to get
at least three runs but low enough to avoid clogging the CI.
2024-10-11 22:54:16 +02:00
Arthur Shau
cc0ab8c810 timer: introduce DeferReactivation setting
By default, in instances where timers are running on a realtime schedule,
if a service takes longer to run than the interval of a timer, the
service will immediately start again when the previous invocation finishes.
This is caused by the fact that the next elapse is calculated based on
the last trigger time, which, combined with the fact that the interval
is shorter than the runtime of the service, causes that elapse to be in
the past, which in turn means the timer will trigger as soon as the
service finishes running.

This behavior can be changed by enabling the new DeferReactivation setting,
which will cause the next calendar elapse to be calculated based on when
the trigger unit enters inactivity, rather than the last trigger time.

Thus, if a timer is on an realtime interval, the trigger will always
adhere to that specified interval.
E.g. if you have a timer that runs on a minutely interval, the setting
guarantees that triggers will happen at *:*:00 times, whereas by default
this may skew depending on how long the service runs.

Co-authored-by: Matteo Croce <teknoraver@meta.com>
2024-10-11 22:54:16 +02:00
Yu Watanabe
5a22b27b5c TEST-17-UDEV: also check if /run/udev/links.lock/ is empty on settle 2024-10-12 05:34:29 +09:00
Yu Watanabe
ea4af553d8 udev-node: drop unnecessary manager side cleaning up logic for stack directory
Unnecessary stack directories and their lock files are removed by
workers. Hence, the logic is not necessary anymore.
2024-10-12 05:34:07 +09:00
Yu Watanabe
b364af59f0 udev-node: drop workaround for by-diskseq symlinks
This effectively reverts 09373c1a50,
as stack directories and lock files are removed by udev workers on
unlocking.
2024-10-12 05:34:07 +09:00
Yu Watanabe
7727b694db udev-node: remove lockfile and stack directory when not necessary if possible
Replaces 09373c1a50.

Let's remove stack directories and their lock files by workers if
possible.

Now, lock files must be created before creating stack directories, hence
lock files are moved to /run/udev/links.lock/ , e.g.,
Before:
  /run/udev/links/disk\x2fby-diskseq\x2f1/.lock
After:
  /run/udev/links.lock/disk\x2fby-diskseq\x2f1

Fixes ##34637.
2024-10-12 05:34:02 +09:00
Yu Watanabe
632407c3e4 Merge pull request #34700 from yuwata/network-conf-parser
network: several cleanups for conf parsers
2024-10-12 05:22:11 +09:00
anonymix007
5be6e9e0cf test: Add tests for SHA1 2024-10-11 23:10:23 +03:00
anonymix007
18c19a029c fundamental: Import SHA1 implementation from libxcrypt 2024-10-11 23:10:21 +03:00
anonymix007
cefa196723 macro: Add DISABLE_WARNING_STRINGOP_OVERREAD
While at it, also add -Wunknown-warning-option to basic_disabled_warnings to fix compilation with clang
2024-10-11 23:07:44 +03:00
Matteo Croce
75355f22db report bpf_current_task_under_cgroup() errors to userspace
bpf_current_task_under_cgroup() returns 1 if the task is under the
specified cgroup, 0 if not, negative if an error happens.

Differentiate the 1 and -1 cases, and report to userspace when we got
and error.
An error like this is mostly unlikely, the only common one is that the
userspace doesn't populate the map, and the call returns -EAGAIN.

Tested by mocking the return value of bpf_current_task_under_cgroup():
    Enumeration completed
    enp1s0f0np0: Configuring with /etc/systemd/network/20-test.network.
    Sysctl monitor BPF returned error: Link number out of range
    Sysctl monitor BPF returned error: No CSI structure available
    Sysctl monitor BPF returned error: Invalid exchange
    Sysctl monitor BPF returned error: Exchange full
    Sysctl monitor BPF returned error: Invalid request code
    Sysctl monitor BPF returned error: Unknown error 58
    Sysctl monitor BPF returned error: Device not a stream
    Sysctl monitor BPF returned error: Timer expired
    Sysctl monitor BPF returned error: Machine is not on the network
    Sysctl monitor BPF returned error: Object is remote
    Sysctl monitor BPF returned error: Advertise error
2024-10-12 04:47:18 +09:00
Yu Watanabe
b950a8acd8 Merge pull request #34720 from YHNdnzj/extra-fds-followup
core: several follow-ups for ExtraFileDescriptors
2024-10-12 04:46:51 +09:00
Daan De Meyer
8b8668b9e7 systemd-update-helper: Show executed commands if debug logging is enabled 2024-10-11 19:30:04 +01:00
Yu Watanabe
19931a6d8d network/route: use log_section_warning() more 2024-10-12 03:26:07 +09:00
Yu Watanabe
a768478738 network/route: use generic [Route] section parser more 2024-10-12 03:26:07 +09:00
Yu Watanabe
571bb24123 network/route: use log_syntax_parse_error() more 2024-10-12 03:26:07 +09:00
Yu Watanabe
4daf605d87 network/route-nexthop: use generic [Route] section parser more 2024-10-12 03:26:07 +09:00
Yu Watanabe
70465e5b61 network/route-nexthop: use log_syntax_parse_error() 2024-10-12 03:26:06 +09:00
Yu Watanabe
cf305c8458 network/route-metric: merge conf parsers for route metric
This introduces a generic [Route] section parser, then embed conf
parsers for route metric into it.
2024-10-12 03:26:06 +09:00
Yu Watanabe
ff1f480c3b network/route-metric: use log_syntax_parse_error() 2024-10-12 03:26:06 +09:00
Yu Watanabe
1cbc8d9168 network/address: several cleanups for config_parse_address()
- make it accept an empty string,
- use config_parse_in_addr_prefix(),
- move null address checker to address_section_verify().

No functional change, just refactoring.
2024-10-12 03:26:06 +09:00
Yu Watanabe
5d15c7b19c network/address: warn but ignore Broadcast= setting for an IPv6 address
Previously, the below was refused and the IPv6 address would not assigned.
===
[Address]
Address=2001:db8:0:f101::15/64
Broadcast=192.168.0.255
===
However, in the following case, networkd warned about the broadcast
address would be ignored, and the IPv6 address would be configured.
===
[Address]
Broadcast=192.168.0.255
Address=2001:db8:0:f101::15/64
===
2024-10-12 03:26:06 +09:00
Yu Watanabe
e58ec0dc90 network/address: use log_section_warning() more 2024-10-12 03:26:06 +09:00
Yu Watanabe
f8a31c90cc network/routing-policy-rule: use in_addr_prefix for From= and To=
Also, this makes the settings parsed independently, and the
inconsistency will be checked in the section verifier.

No functional change, just refactoring.
2024-10-12 03:26:06 +09:00
Yu Watanabe
8cde9f6c5a conf-parser: introduce config_parse_in_addr_prefix()
It is not used currently, but will be used later.
2024-10-12 03:26:04 +09:00
Yu Watanabe
c1316cd00d in-addr-util: rename in_addr_prefix_from_string_auto_internal() -> _full()
The function is also used in other source files. Hence, not internal.
No functional change, just refactoring.
2024-10-12 03:23:23 +09:00
Lucas Adriano Salles
c2f3cb2676 hwdb: fix key toggle touchpad and programmable buttom for Positivo V142N (#34725) 2024-10-12 01:58:14 +09:00
Mike Yuan
8e66f42b06 core/service: add missing serialization for extra fds 2024-10-11 18:22:24 +02:00
Mike Yuan
32af4dd80f core/service: use array rather than list for extra fds, limit max number
Follow-up for 3543456f84

I don't think list is particularly useful here. The passed fds are
constant for the lifetime of service, and with this commit we track
the number of extra fds in a dedicated var anyway.
2024-10-11 18:22:19 +02:00
Mike Yuan
6286f213f5 core/service: use LIST_HEAD where appropriate 2024-10-11 18:21:09 +02:00
Mike Yuan
407bfa0db6 time-util: use saturate_add for usec_add() 2024-10-11 18:21:09 +02:00