Commit Graph
80426 Commits
Author SHA1 Message Date
Yu Watanabe 34ae6b682b user-runtime-dir: correct quota size calculation (#36884) 2025-04-02 00:59:09 +09:00
Yu Watanabe c5855d9640 notify-recv: several follow-ups for notify_socket_prepare()
Follow-ups for 2351bc991e.
Addresses post-merge review:
https://github.com/systemd/systemd/pull/36911#pullrequestreview-2732136658
2025-04-01 22:22:10 +09:00
Luca Boccassi 79bc7625f6 test: fix usage of --hostnqn= (#36927)
Fixes #36908.
2025-04-01 14:04:23 +01:00
Luca Boccassi a20c2d6589 test and manpages follow-ups (#36924) 2025-04-01 13:52:14 +01:00
Zbigniew Jędrzejewski-Szmek f77a8edfef TEST-46-HOMED: conditionally skip usrquota tests
The tests were failing, because the quota was not enforced.
It seems that we simply don't have privileges to set or display the quota.
The test is running priviled, so this is probably some SELinux:
TEST-46-HOMED.sh[117]: + /usr/lib/systemd/tests/unit-tests/manual/test-display-quota tmpfsquota /dev/shm /tmp
TEST-46-HOMED.sh[1103]: Lacking privileges to query UID quota on /dev/shm: Operation not permitted
TEST-46-HOMED.sh[1103]: Lacking privileges to query UID quota on /tmp: Operation not permitted

If we cannot display the quota, ignore the test results.
In a local run under mkosi, quota is shown and the tests pass. So this is something
about how the testing-farm:fedora-rawhide-x86_64 is configured.
2025-04-01 14:16:40 +02:00
Zbigniew Jędrzejewski-Szmek cb86668f2c TEST-46-HOMED: check for support on /dev/shm and /tmp separately
The test fails in CI. My guess was this is because the enablement of quota on
/tmp and /dev/shm is independent. The former fs is mounted by systemd in the
host, while the latter is mounted in the initrd, so we can end up with quota
support on one but not the other, which is the situation I had on my laptop.
This wasn't actually the source of the problems in CI, but it's a reasonable
change to make anyway.

While at it, test both mountpoints separately.
2025-04-01 14:16:40 +02:00
Zbigniew Jędrzejewski-Szmek cb6b161162 test-display-quota: add a little helper binary to show quota on tmpfs
quota from quota project fails:
$ quota
quota: Cannot stat() mounted device tmpfs: No such file or directory
quota: Cannot stat() mounted device tmpfs: No such file or directory

Having this helper helped me understand what is going on with the quotas when
the tests failed. I think it'd be useful to keep it around for now, even though
it is not actually connected in the tests.
2025-04-01 14:16:40 +02:00
Yu Watanabe c70a113a6c test: replace deprecated --hostid= with --hostnqn=
Fixes #36908.
2025-04-01 19:01:45 +09:00
Luca Boccassi b73a042ab0 man: add missing conditional
Follow-up for d95818f522

man: run 'update-man-rules' again
2025-04-01 10:59:27 +01:00
Luca Boccassi 4b85218629 test: use 'exit 0' instead of 'return' in test scripts
14385s [   66.896852] TEST-87-AUX-UTILS-VM.sh[3744]: + test -x /usr/lib/systemd/systemd-validatefs
14385s [   66.898544] TEST-87-AUX-UTILS-VM.sh[3744]: + echo 'no systemd-validatefs'
14385s [   66.899115] TEST-87-AUX-UTILS-VM.sh[3744]: no systemd-validatefs
14385s [   66.899699] TEST-87-AUX-UTILS-VM.sh[3744]: + return
14385s [   66.900189] TEST-87-AUX-UTILS-VM.sh[3744]: .//usr/lib/systemd/tests/testdata/units/TEST-87-AUX-UTILS-VM.validatefs.sh: line 13: return: can only `return' from a function or sourced script

Follow-up for 6e003d18bb
2025-04-01 10:59:27 +01:00
Yu Watanabe 699c377d0d Revert "test: call nvme-cli with --hostnqn= instead of the deprecated --hostid="
This reverts commit b8942f4ae2.

As commented https://github.com/systemd/systemd/issues/36908#issuecomment-2768507373,
the usage of --hostnqn= is different from --hostid=.
2025-04-01 18:58:43 +09:00
Yu Watanabe cdd2dd2d58 udev-spawn: manage spawned processes by PidRef 2025-04-01 18:25:29 +09:00
Yu Watanabe b15c676b6e udev: trivial cleanups (#36916) 2025-04-01 18:24:34 +09:00
Yu Watanabe 5f8e8186e0 introduce notify_socket_prepare() and use it where applicable (#36911)
This introduces notify_socket_prepare(), which creates an autobind
notify socket and IO event source for the socket. Then, use it where we
send notification messages from worker processes to their manager
process.
2025-04-01 18:20:47 +09:00
Lennart Poettering 1e79a29233 man: run 'update-man-rules' again 2025-04-01 09:26:27 +02:00
Yu Watanabe 6941bf6b77 udev: update log messages 2025-04-01 15:55:52 +09:00
Yu Watanabe cff85857c7 udev: disable timer event source for cleaning up idle workers when no worker exists
No functional change, as the timer event does nothing when there are no
workers.
2025-04-01 15:55:52 +09:00
Luca Boccassi b8942f4ae2 test: call nvme-cli with --hostnqn= instead of the deprecated --hostid=
Fixes https://github.com/systemd/systemd/issues/36908
2025-04-01 11:36:58 +09:00
Zbigniew Jędrzejewski-Szmek 5399910671 TEST-46-HOMED: write zeros instead of random bytes
This should be faster, and equivalent for the purposes of quota calculation.
2025-03-31 22:46:04 +02:00
Mike Yuan 6790db81d6 user-runtime-dir: correct quota size calculation
Follow-up for b1c95fb2e9

Fixes #36245
2025-03-31 22:46:04 +02:00
Yu Watanabe 451277707d validatefs: several follow-ups (#36910) 2025-04-01 05:35:21 +09:00
Yu Watanabe 759eab02da udev: trivial cleanups (#36912) 2025-04-01 05:34:32 +09:00
Yu Watanabe 4c42fc6aa8 sysupdated: use notify_socket_prepare()
This also make it use autobind notify socket.
2025-04-01 03:58:38 +09:00
Yu Watanabe 0ffddd23f4 sysupdate-transfer: use notify_socket_prepare() 2025-04-01 03:58:38 +09:00
Yu Watanabe 66936ba5fa sysupdate-transfer: fix potential memleak 2025-04-01 03:58:38 +09:00
Yu Watanabe 6228924d6e notify: use notify_socket_prepare() 2025-04-01 03:58:38 +09:00
Yu Watanabe adfd9fe14c import: use notify_socket_prepare()
This also make it use autobind notify socket.
2025-04-01 03:58:38 +09:00
Yu Watanabe 0f627f9b35 homed: use notify_socket_prepare()
This also make it use autobind notify socket.
2025-04-01 03:58:34 +09:00
Yu Watanabe 2f973db276 udev-manager: coding style cleanups 2025-04-01 03:34:41 +09:00
Yu Watanabe f594f32c3d udev-manager: use notify_start() and notify_on_cleanup()
No functional change. Just refactoring.
2025-04-01 03:34:41 +09:00
Yu Watanabe 2351bc991e notify-recv: introduce notify_socket_prepare() 2025-04-01 03:26:22 +09:00
Yu Watanabe a6344afbc1 ac-power: follow-up for recent change
Follow-ups for 72586a971b.

- drop 'Options' sections,
- drop underlining for link,
- fix indentation.

Prompted by https://github.com/systemd/systemd/pull/36850#discussion_r2020594171
> the underline stuff we only use for long --help texts that have sections,
> for the section headers. systemctl --help does that for example. This one
> here is not that long, hence doesn't really need section headers, and
> hence no underlining. The clickable links don't need to be explicitly
> underlined, the terminal emulators that supper hyperlinks will underline
> them on their own (for example gnome-terminal uses a dotted line).

Addresses https://github.com/systemd/systemd/pull/36873#discussion_r2017578611
2025-04-01 02:55:28 +09:00
Yu Watanabe 9441880d83 socket-util: introduce socket_autobind() helper (#36893)
Prompted by https://github.com/systemd/systemd/pull/36858#discussion_r2017719305
and #36833.
2025-04-01 02:55:04 +09:00
Mike Yuan 0a7d86d53d units/systemd-validatefs@.service: FailureAction= is a [Unit] knob 2025-03-31 19:23:51 +02:00
Mike Yuan 28bae3dbe3 man/systemd-validatefs@.service: fix typo 2025-03-31 19:23:50 +02:00
Mike Yuan f361fad245 validatefs: use fgetxattr_malloc() where appropriate 2025-03-31 19:23:50 +02:00
Mike Yuan 8950f7651e validatefs: do not use EXIT_* in run()
The plain DEFINE_MAIN_FUNCTION is used, i.e. all >= 0 retvals
are treated as success. No need for EXIT_* annotations.
2025-03-31 19:23:50 +02:00
Mike Yuan 7b8d6fc836 validatefs: insert empty line after short description in help() text
As per our usual coding style.
2025-03-31 19:23:50 +02:00
Mike Yuan 05587cece5 xattr-util: add missing assertions
Follow-up for ed024abac6
and 9fbe26cfa8

Also, let's not get too tangled up in the style of defining variables
in between. The functions are short enough, and vars involved are still
effectively at the beginning... Put differently, the separation from
'int r' is too deliberate and brings no actual value in my eyes.
2025-03-31 19:23:49 +02:00
Luca Boccassi ebc0514a65 test: pass verbose option to nvme-cli
When the test fails due to nvme-cli/kernel issues it's hard to report it
upstream as there's not enough details, add verbose flags
2025-03-31 17:22:30 +01:00
Yu Watanabe 30252c0ca4 introduce systemd-validatefs@.service that ensures file systems can only be used in the way they were intended (#36714)
If we have multiple trusted fs (i.e. luks or dm-verity) we generate via
repart at boot, we must make sure they cannot be "misappropriated", i.e.
used for a different mount they were intended for.

Hence, let's introduce "mount constraint" data (encoded in xattrs on the
root inode of the fs) that tells us where a file system has to be
mounted, and what the gpt partition metadata has to be for the fs to be
valid.

Inspired by this thread:
https://lists.freedesktop.org/archives/systemd-devel/2025-March/051244.html
2025-04-01 01:14:33 +09:00
Mike Yuan 1eeb4f9f47 socket-util: introduce socket_autobind() helper
Prompted by https://github.com/systemd/systemd/pull/36858#discussion_r2017719305
and #36833
2025-03-31 18:11:37 +02:00
Yu Watanabe 7e0f0d702d Several updates for socket option (#36905) 2025-04-01 01:09:04 +09:00
Mike Yuan ddbbc98bd5 socket-util: drop SO_BINDTODEVICE fallback in socket_bind_to_ifindex()
Our baseline is v5.4 now.
2025-03-31 18:00:09 +02:00
Yu Watanabe c7464843ad tree-wide: extend the comment about the issue in __convert_scm_timestamps() 2025-03-31 23:22:38 +09:00
Yu Watanabe 566b8f4d46 core/manager: update comment 2025-03-31 23:22:38 +09:00
Yu Watanabe 385024b75d README: fix version of SO_BINDTOIFINDEX
Follow-up for 33746caf8f.
2025-03-31 23:22:38 +09:00
Yu Watanabe 4216018807 missing_socket: drop unnecessary definitions and update comments
- SO_PEERGROUPS is since kernel v4.13
  (28b5ba2aa0f55d80adb2624564ed2b170c19519e),
- SO_BINDTOIFINDEX is since kernel v5.1
  (f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c).
2025-03-31 23:22:12 +09:00
Lennart Poettering 681e7c6759 update TODO 2025-03-31 15:14:56 +02:00
Lennart Poettering 6e003d18bb ci: add test for new validatefs work 2025-03-31 15:14:53 +02:00