Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe d56d07fc1e sysctl-util: introduce sysctl_read_ip_property_int() and _uint32()
Currently not used, but will be used later.
2024-10-15 06:42:12 +09: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
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
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
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
Yu Watanabe 727dc1f23a mkosi: fix sections for settings
Follow-up for 963157ca78.
2024-10-11 07:33:42 +09:00
Yu Watanabe b63ffff02b Merge pull request #34699 from yuwata/netlink-cleanups
sd-netlink: several cleanups
2024-10-11 04:30:16 +09:00
Yu Watanabe ba8d48be64 sd-netlink: introduce two more _get_family()
Then, use them in sd_rtnl_message_get_family().
2024-10-11 02:53:00 +09:00
Yu Watanabe 9b8cb789dd sd-netlink,network: rename functions and RoutingPolicyRule.type
To make them consistent to the netlink message header.
No functional change, just refactoring.
2024-10-11 02:52:58 +09:00
Yu Watanabe 2bc1d78345 sd-netlink: introduce macros to define sd_rtnl_message setters and getters 2024-10-11 02:52:26 +09:00
Yu Watanabe 2fcaeaaaf6 sd-netlink: make size verifier in sd_netlink_message_read_xyz() stricter
Also, fill remaining output buffer with zero, for safety.
2024-10-11 02:38:16 +09:00
Yu Watanabe 768237e73a sd-netlink: shorten sd_netlink_message_read_string_strdup() a bit 2024-10-11 02:38:16 +09:00
Yu Watanabe ae298c938b sd-netlink: various cleanups
- use uint8_t, uint16_t, and so on, rather than unsigned char, unsigned
  short, and so on, respectively,
- rename output parameters to ret or ret_xyz,
- add several missing assertions.
2024-10-11 02:38:16 +09:00
Yu Watanabe 70516b026b Merge pull request #34684 from yuwata/login-scheduled-shutdown
login: allow to cancel delayed action by CancelScheduledShutdown()
2024-10-10 19:32:52 +09:00
Yu Watanabe ff5ba2d6fe sd-event: rename output parameters to ret 2024-10-10 19:02:53 +09:00
Yu Watanabe 6e27477666 ukify: fix return value type of resolve_at_path()
Follow-up for eca003de2f.
2024-10-10 08:02:13 +02:00
Yu Watanabe 67226c3cb1 repart: fix typo
Follow-up for d3032e651e.
2024-10-10 05:30:11 +09:00
Yu Watanabe d866b0135f core/mount: fix typo
Follow-up for 00ad3f0227.
2024-10-10 05:29:08 +09:00
Yu Watanabe a029550507 Merge pull request #34687 from DaanDeMeyer/mkosi
Various fixes
2024-10-10 05:26:14 +09:00
Yu Watanabe 2a796b9f52 stub: reindent lines
Follow-up for 2ea0487c1b.
2024-10-10 05:16:36 +09:00
Yu Watanabe f16d33f3a7 Merge pull request #34665 from poettering/fastopen-fallback
resolved: fix MSG_FASTOPEN fallback logic
2024-10-10 03:21:35 +09:00
Yu Watanabe e318675398 Merge pull request #34641 from behrmann/ukifystyle
Type annotate and format ukify
2024-10-10 02:21:29 +09:00
Yu Watanabe 0bba543573 logind: add comment why we save action in execute_shutdown_or_sleep()
When I first read the code, I was confused about that. Hopefully, this
helps maintain code a bit.
2024-10-10 01:59:53 +09:00
Yu Watanabe 70eedbafd9 login: use event_reset_time_relative() at one more place 2024-10-10 01:59:53 +09:00
Yu Watanabe e4b138548f login: provide delayed action in ScheduledShutdown property
Even though we can get the existence of delayed action through
PreparingForShutdownWithMetadata property or friends, for consistency
with CancelScheduledShutdown() method, it is better to also provide the
information through ScheduledShutdown property.
2024-10-10 01:59:31 +09:00
Yu Watanabe dc09c61f19 login: allow to cancel delayed action by CancelScheduledShutdown()
Fixes #34554.
2024-10-10 01:43:21 +09:00
Yu Watanabe fa3faf8abb Merge pull request #34636 from WilliButz/repart/verity-hash-max-data-size
repart: support verity hash partitions sized for custom data size
2024-10-10 00:51:40 +09:00
Yu Watanabe af1a594b55 Merge pull request #34691 from poettering/polkit-varlink-field-macro
polkit: introduce common macro for generating polkit allowInteractive…
2024-10-10 00:44:29 +09:00
Yu Watanabe 2e8a581b9c core: drop implicit support of PrivateTmp=off
Follow-up for 0e551b04ef.

Similar to the previous commit, but for PrivateTmp=.
2024-10-09 08:11:42 +09:00
Yu Watanabe dc995a9b23 core/dbus: add assertions 2024-10-09 06:57:11 +09:00
Yu WatanabeandRenjaya Raga Zenta 0881cf3d51 core/dbus: introduce bus_verify_manage_units_async_impl()
Then, make bus_verify_manage_units_async() and _full() inline.

Co-authored-by: Renjaya Raga Zenta <ragazenta@gmail.com>
2024-10-09 06:55:32 +09:00
Yu Watanabe d030946765 core/dbus: move bus_verify_xyz() to dbus-util.c 2024-10-09 06:54:45 +09:00
Yu Watanabe edd3f4d9b7 core: drop implicit support of PrivateUsers=off
Follow-up for fa693fdc7e.

The documentation says the option takes a boolean or one of the "self"
and "identity". But the parser uses private_users_from_string() which
also accepts "off". Let's drop the implicit support of "off".
2024-10-09 05:39:54 +09:00
Yu Watanabe e607a7317f oomd: separate entries with comma for readability 2024-10-09 05:36:11 +09:00
Yu Watanabe 05314b1823 oomd: update system context when oomctl is invoked
Otherwise, oomctl shows 0 memory and swap usage when swap monitoring
is not enabled.
=======
$ oomctl
Dry Run: no
Swap Used Limit: 90.00%
Default Memory Pressure Limit: 60.00%
Default Memory Pressure Duration: 20s
System Context:
        Memory: Used: 0B Total: 0B
        Swap: Used: 0B Total: 0B
Swap Monitored CGroups:
Memory Pressure Monitored CGroups:
...
======
2024-10-09 05:36:11 +09:00
Yu Watanabe 0f1a09203e oomd: drop unused usec_now 2024-10-09 05:36:11 +09:00
Yu Watanabe 483ab07534 systemctl: separate memory usage with comma
Just for readability.

Before:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
     Memory: 4.7M (peak: 14.3M swap: 1M swap peak: 1.1M)

After:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
     Memory: 4.7M (peak: 14.3M, swap: 1M, swap peak: 1.1M)
2024-10-09 05:36:11 +09:00
Yu Watanabe 1cafbecabe core: suppress one debugging log
Otherwise, the log is shown even when getting properties.
Even though it is in the debug level, that's quite noisy.

[  338.785847] TEST-55-OOMD.sh[1624]: Oct 07 16:35:15 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.786985] TEST-55-OOMD.sh[1624]: Oct 07 16:35:17 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.787412] TEST-55-OOMD.sh[1624]: Oct 07 16:35:20 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.791776] TEST-55-OOMD.sh[1624]: Oct 07 16:35:22 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.792938] TEST-55-OOMD.sh[1624]: Oct 07 16:35:24 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793225] TEST-55-OOMD.sh[1624]: Oct 07 16:35:26 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793424] TEST-55-OOMD.sh[1624]: Oct 07 16:35:28 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.796448] TEST-55-OOMD.sh[1624]: Oct 07 16:35:31 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.797997] TEST-55-OOMD.sh[1624]: Oct 07 16:35:33 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.799206] TEST-55-OOMD.sh[1624]: Oct 07 16:35:35 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
2024-10-09 05:36:11 +09:00
Yu Watanabe 223a67e572 tree-wide: replace reallocarray() with GREEDY_REALLOC() 2024-10-08 19:56:09 +09:00
Yu Watanabe 5f9f38b8df sd-bus: introduce bus_process_cmsg()
- Close all fds on failure.
- Close pidfd on success.
2024-10-08 19:56:00 +09:00
Yu Watanabe 483db6867a analyze: use RET_GATHER() 2024-10-08 19:36:50 +09:00
Yu Watanabe 25999f868f test: add test cases for timestamp with time zone 2024-10-08 19:36:38 +09:00
Yu Watanabe 6d3012bab4 time-util: copy input string before fork()
Fixes #34670.
2024-10-08 19:15:54 +09:00
Yu Watanabe eb87d3e1e9 time-util: fix parsing timestamp with NZ timezone
Fixes a bug caused by ef658a63f8.
2024-10-08 19:15:00 +09:00
Yu Watanabe 9f0d2d64cc core: use memdup_suffix0() at one more place 2024-10-08 14:43:23 +09:00
Yu Watanabe 858eac353b prioq: use GREEDY_REALLOC() and structured initializer
No functional change, just refactoring.
2024-10-08 14:43:23 +09:00
Yu Watanabe bf34d642bc Merge pull request #34669 from bluca/semaphore
Update mkosi debian ref and try to speed up semaphore build
2024-10-08 14:42:26 +09:00
Yu Watanabe 14dde316c7 sd-json: use sd_json_dispatch_const_string() in sd_json_dispatch_string()
Also, do similar for json_dispatch_user_group_name().
2024-10-07 09:53:36 +02:00
Yu Watanabe f769518c9a tree-wide: drop doubled empty lines 2024-10-07 09:51:37 +02:00
Yu Watanabe 1faf2e5332 network: use Network.name for bus path
No functional change, just refactoring.
2024-10-07 09:48:57 +02:00
Yu Watanabe a02166297c networkctl: sort ifindexes in status command
Before:
$ networkctl status
● Interfaces: 372, 368, 373, 375, 376, 377, 378, 379, 381, 391, 3, 1201, 1202, 1184, 1610, 9, 8, 1340, 2, 1, 1256, 7

After:
$ networkctl status
● Interfaces: 1, 2, 3, 7, 8, 9, 368, 372, 373, 375, 376, 377, 378, 379, 381, 391, 1184, 1201, 1202, 1256, 1340, 1610
2024-10-07 09:48:00 +02:00
Yu Watanabe dd9a02ce88 homectl: drop unnecessary brackets
Follow-up for 164ca24d74.
2024-10-07 09:01:57 +02:00
Yu Watanabe ec846d9db3 Merge pull request #34491 from AdrianVovk/sysupdate-fixups
Quick sysupdate fixups
2024-10-07 15:38:58 +09:00
Yu Watanabe 51e905b9fa Merge pull request #34408 from Werkov/fix-device-limits
core/cgroup: Apply IODevice*= directives in configured order
2024-10-07 14:05:44 +09:00
Yu Watanabe 96067f7669 udev-node: introduce node_remove_symlink()
Also
- make the failure propagated,
- remove /dev/block or /dev/char if empty.

Hopefully, no effective functionality changed. Just refactoring.
2024-10-07 09:56:26 +09:00
Yu Watanabe 2a41b4b0f4 udev-node: rename node_symlink() -> node_create_symlink()
Also adds short comment for the NULL arguments.

No functional change, just refactoring.
2024-10-07 09:56:26 +09:00
Yu Watanabe 88d186e482 test: add test case for issue #34637 2024-10-07 09:56:26 +09:00
Yu Watanabe 09373c1a50 udev-node: skip stack directory creation for diskseq
The disk/by-diskseq symlink should not be shared with multiple block
devices. Hence, it is not necessary to create stack directory for the
symlink that manages which device owns the symlink.

This is not just a optimization.
If a service unit tries to mount a disk image but the service fails, then
the diskseq of the loop device for the image may be continuously increased
during restart, and inodes in /run may increase rapidly, as the stack
directories are cleaned up only when udev queue is empty.

Fixes #34637.
2024-10-07 09:56:26 +09:00
Yu Watanabe bba5f48acf TODO: fix typo
Follow-up for 26e6986527.
2024-10-07 09:54:00 +09:00
Yu Watanabe ffe967c598 Merge pull request #34432 from YHNdnzj/path-lookup-refactor
path-lookup: several cleanups
2024-10-07 09:31:47 +09:00
Yu Watanabe 61c7f38f10 Merge pull request #34638 from YHNdnzj/laccess-error-check
various: correct laccess() error check
2024-10-06 13:50:11 +09:00
Yu Watanabe 82f2c33db5 tpm2-util: show loaded libraries in 'systemd-analyze has-tpm2'
After 3b16e9f419, even the libraries are
documented in the man page, it is useful to mention which libraries are
checked in the command output.

Of course, the dependencies are kind of implementation detail, and may
be changed in the future version, but that's especially why I think
showing the library deps in the output is useful.

systemd-analyze is a debugging tool, and already shows many internal
states. I think there is nothing to prevent from showing the deps.

Prompted by #34477.
2024-09-30 15:40:14 +02:00
Yu Watanabe 4046c49c13 Merge pull request #34549 from weblate/weblate-systemd-main
Translations update from Fedora Weblate
2024-09-25 06:49:48 +02:00
Yu Watanabe bfa834f138 Merge pull request #34511 from YHNdnzj/strv-extend-strv-consume
basic/strv: introduce strv_extend_strv_consume()
2024-09-21 13:57:02 +09:00
Yu Watanabe f48bc69ca1 Merge pull request #34502 from yuwata/strv_find_closest
strv: introduce strv_find_closest()
2024-09-21 13:56:34 +09:00
Yu Watanabe 0f03562d97 Merge pull request #34515 from YHNdnzj/machined-machines-by
machined: modernize a bit
2024-09-21 13:53:41 +09:00
Yu Watanabe 3ae0e54527 machine: fix bus method argument name: who -> whom
Follow-up for cd2fb04960.
2024-09-21 05:38:01 +09:00
Yu Watanabe 07919a1857 verbs: use strv_find_closest()
This also makes the list of verbs is always shown on failure.
2024-09-21 05:10:47 +09:00
Yu Watanabe ffdf497860 strv: introduce strv_find_closest()
Follow-up for 1e1ac5d53b.
2024-09-21 05:06:12 +09:00
Yu Watanabe 427848ffd0 Merge pull request #34510 from keszybz/mkosi-version-checks
Bump minimum required mkosi version
2024-09-21 03:16:25 +09:00
Yu Watanabe 146b44d0a0 sd-ipv4acd: fix assertion triggered when an ARP received in STARTED state
When a network is busy, an ARP may be received before the timer event
source triggered first time.

Fixes #34489.
2024-09-20 14:21:42 +02:00
Yu Watanabe 72689baf48 Merge pull request #34499 from YHNdnzj/sd-path-trivial-cleanup
sd-path: trivial cleanups
2024-09-20 08:54:51 +09:00
Yu Watanabe fc19ad8227 Merge pull request #34496 from YHNdnzj/tmpfiles-neg-errno
tmpfiles: ERRNO_IS_NOINFO -> _IS_NEG_, correct negative errno checks
2024-09-20 08:54:34 +09:00
Yu Watanabe 754d6414f8 Merge pull request #34480 from yuwata/test-seccomp-suppress-sync
seccomp-util: pass negative fds as is to fsync() and friends
2024-09-20 08:27:33 +09:00
Yu Watanabe c07e10628b test: add tests for seccomp_suppress_sync() 2024-09-20 04:32:56 +09:00
Yu WatanabeandMike Yuan 144fbbac23 seccomp-util: pass negative fds as is to fsync() and friends
Closes #34478.

Co-authored-by: Mike Yuan <me@yhndnzj.com>
2024-09-20 04:30:53 +09:00
Yu Watanabe a3c2a9ee5d Merge pull request #34486 from DaanDeMeyer/test-process-util
test-process-util: Migrate to new assertion macros
2024-09-19 23:28:15 +09:00
Yu Watanabe 3b16e9f419 man/systemd-analyze: mention required libraries for TPM2 support
Closes #34477.
2024-09-19 19:21:08 +09:00
Yu Watanabe d5a7f3b7d4 tpm2-util: colorize output of 'systemd-analyze has-tpm2' 2024-09-19 19:14:19 +09:00
Yu Watanabe f1c16ca6d6 shell-completion/analyze: add has-tpm2 2024-09-19 19:08:49 +09:00
Yu Watanabe b094398b0f tpm2-util: update comment
has-tpm2 command is moved to systemd-analyze.

Follow-up for 58e359604f.
2024-09-19 19:08:10 +09:00
Yu Watanabe 1ee6570843 tpm2-util: do not load tpm2 libraries when not interested in the existence of the libraries
For example, 'bootctl status' only interested in if the efi has TPM2
support and a TPM2 driver is loaded. Hence, not necessary to load
libtss2.
2024-09-19 19:06:46 +09:00