1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-27 01:57:35 +03:00

69462 Commits

Author SHA1 Message Date
Frantisek Sumsal
1ea27bd79e test: load the io controller before checking if io.latency exists
Otherwise the following test gets always skipped.
2023-12-05 19:58:48 +00:00
Daan De Meyer
0689d46a75 repart: Fix sysext definitions for --make-ddi=
CopyFiles= does not support multiple directories separated by
whitespace. Instead the setting has to be specified multiple times.
2023-12-05 19:26:58 +00:00
Luca Boccassi
a14b75e218 selinux: downgrade log about state to trace
It is printed on every invocation of sd-executor, which is noisy and not useful

Follow-up for: bb5232b6a3b8a
2023-12-05 19:25:50 +00:00
Zbigniew Jędrzejewski-Szmek
26e82eef01 sd-journal/catalog: modernize write_catalog() 2023-12-05 19:20:25 +01:00
Zbigniew Jędrzejewski-Szmek
d333b236f4 networkd: unvoidify fwrite()
Those were the only two places we did that, so for consistency it's better
to drop it.
2023-12-05 19:18:28 +01:00
Zbigniew Jędrzejewski-Szmek
f9568765d4 variuos: fwrite() does not set errno
The man page doesn't even mention errno. It just says that ferror() should
be used to check for errors. Those writes are unlikely to fail, but if they
do, errno might even be 0. Also, we have fflush_and_check() which does
additional paranoia around errno, because we apparently do not trust that
errno will always be set correctly.
2023-12-05 19:18:23 +01:00
Zbigniew Jędrzejewski-Szmek
dd0630277b TEST-26: add test for systemctl edit --stdin 2023-12-05 18:47:19 +01:00
Zbigniew Jędrzejewski-Szmek
329050c5e2 systemctl: add "edit --stdin"
This is a fancy wrapper around "cat <<EOF", but:
- the user doesn't need to figure out the file name,
- parent directories are created automatically,
- daemon-reload is implied,
so it's a convenient way to create units or drop-ins.

Closes https://github.com/systemd/systemd/issues/21862.
2023-12-05 18:47:19 +01:00
Luca Boccassi
f83a74dfb8 switch-root: also check that mount IDs are the same, not just inodes
If /run/nextroot/ has been set up, use it, even if the inodes are
the same. It could be a verity device that is reused, but with
different sub-mounts or other differences. Or the same / tmpfs with
different /usr/ mounts. If it was explicitly set up we should use it.

Use the new helper to check that the mount IDs are also the same,
not just the inodes.
2023-12-05 17:20:27 +00:00
Luca Boccassi
5134e54625 basic: add fds_are_same_mount() helper 2023-12-05 17:20:27 +00:00
Zbigniew Jędrzejewski-Szmek
232f017b1a systemctl: add message when edit is aborted
If the user edits result in an empty file (after stripping), we would silently
not do anything, aborting the edit. This is rather confusing, let's emit a
notice:

  $ build/systemctl --user edit asdf.service --full --stdin </dev/null
  /home/zbyszek/.config/systemd/user/asdf.service: after editing, new contents are empty, not writing file.

(This also works with an editor, instead of --stdin. The message is printed on
the console and is visible after the editor exits.)

While at it, fix the condition to skip writing file after stripping. We had
"old_contents", but we modified that string. In some code flows, we would
compare the stripped old contents (i.e. a string which by defintion doesn't
have a newline at the end) with a string to which we just appended a newline
(i.e. a string which by defintion has a newline at the end).
2023-12-05 18:11:45 +01:00
Zbigniew Jędrzejewski-Szmek
5161836bd0 shared/edit-util: split out function to populate temp file
In preparation for future changes: I want to add a mode where interactive
editing is not done, and when this preparation is moved to a helper, it's much
easier to skip it.

e->line is initialized to 1 and overwritten even if sync fails. Theoretically
this is against our style, but the alternative is to propagate a temporary
value of line through the layers, which adds a lot of noise. If we fail, this
EditFile object will not be used for anything, to the changed value of .line
has no effect.
2023-12-05 18:11:38 +01:00
Yu Watanabe
829732d40a basic: fix typo 2023-12-05 23:50:25 +09:00
Mike Yuan
5b3562898a
systemctl: add support for Sleep() logind call 2023-12-05 22:18:32 +08:00
Mike Yuan
cd4dd90b99
logind: introduce Sleep() call and action that automatically choose a sleep operation 2023-12-05 22:18:32 +08:00
Mike Yuan
0f15d14c76
logind: test: make sure string of HandleAction and SleepOperation match 2023-12-05 22:18:32 +08:00
Mike Yuan
181c525e9d
logind: put more struct members into designated initializer 2023-12-05 22:18:32 +08:00
Mike Yuan
c794877f1d
logind: take HandleAction instead of HandleActionData at several places
Preparation for addition of HANDLE_SLEEP.
2023-12-05 22:18:31 +08:00
huyubiao
3769ba7570 fix: The example2 in hwdb.xml is unreasonable
use evdev:atkbd:dmi:bvnAcer:bvr:bdXXXXX:bd08/05/2010:svnAcer:pnX123: instead of evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123
2023-12-05 14:09:18 +01:00
Mike Yuan
24ab77c3cd
hibernate-resume: always clear HibernateLocation if system info matches
Follow-up for a628d933cc67cc8b183dc809ba1451aa5b2996e5

HibernateInfo.from_efi is not actually useful. info.efi is only
set if the system identifier stored in EFI variable matches with
that of the running system, and thus the variable should be cleared
no matter whether resume= is set from kernel cmdline or not.
2023-12-05 16:52:19 +08:00
Mike Yuan
1fe536aa37
sleep: reduce the scope of hibernation_device 2023-12-05 16:52:19 +08:00
Mike Yuan
232efdc5bd
hibernate-util: return 1 for hibernation_is_safe only when all checks pass
The return value is currently not used, but let's correct this.
2023-12-05 16:52:19 +08:00
Frantisek Sumsal
52c1fb6885 test: set correct group for systemd-journal-upload tests
We can't use the systemd-journal-upload user here, since it's created
dynamically by DynamicUser=yes. However, we can use the group specified
in SupplementaryGroups=, so do exactly that.
2023-12-05 09:07:14 +01:00
Frantisek Sumsal
e4d216f2dc Revert "sysusers.d: create the user for systemd-journal-upload.service"
I have no idea what was my reasoning that led to this change, but it is
simply wrong: systemd-journal-upload.service uses
User=systemd-journal-upload together with DynamicUser=yes, so the user
doesn't have to (and shouldn't) exist before starting the service.

See:
  - 941afc4b90
  - db8b8fe77c

This reverts commit 5b9dfd33c6cd4d32ee1fd3681b570e09401c885d.
2023-12-04 19:44:10 +01:00
Luca Boccassi
26522a66a3
Merge pull request #30313 from mrc0mmand/ubuntu-ci
Reduce the number of deny-list files for Ubuntu CI
2023-12-04 18:23:34 +00:00
Yu Watanabe
67bc3c1a8c tools/meson-vcs-tag: the third argument is optional
Follow-up for 1a71ac07adafebe7e0074f92d049f72968ca2d47.
2023-12-04 10:29:52 +00:00
Luca Boccassi
a483c75822
Merge pull request #30314 from DaanDeMeyer/dmi
Document kernel configs required for reading credentials from SMBIOS
2023-12-04 10:29:06 +00:00
Daan De Meyer
6ee9467d4c mkosi: Update comment why we can't use linux-kvm yet 2023-12-04 11:16:52 +01:00
Daan De Meyer
2d05492040 Document kernel configs required for reading credentials from SMBIOS 2023-12-04 11:13:59 +01:00
Frantisek Sumsal
30349b09bd test: reenable TEST-30 on i*86
The original reason for deny-listing it was that it's flaky there. I'm
not sure if that's still the case, but the Ubuntu CI jobs for i*86 are
gone, so this file shouldn't be needed anymore anyway.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal
fc55ef9b69 test: skip TEST-36 on s390x and powerpc
As QEMU there doesn't support NUMA nodes. Also, drop the now unneeded
deny-list file for Ubuntu CI.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal
6743066875 test: check if 'btrfs filesystem' supports 'mkswapfile'
Instead of deny-listing the test on Ubuntu CI, so it gets enabled
automagically once btrfs-progs is updated to a newer version there.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal
a311d4dd30 test: reenable TEST-25-IMPORT in Ubuntu CI
Let's see if #13973 is still an issue.
2023-12-04 10:16:02 +01:00
Luca Boccassi
cc9f4cad8c executor: apply LogLevelMax earlier
SELinux logs before we have a chance to apply it, move it up as it
breaks TEST-04-JOURNAL:

[  408.578624] testsuite-04.sh[11463]: ++ journalctl -b -q -u silent-success.service
[  408.578743] testsuite-04.sh[11098]: + [[ -z Dec 03 13:38:41 H systemd-executor[11459]: SELinux enabled state cached to: disabled ]]

Follow-up for: bb5232b6a3b8a
2023-12-04 11:45:22 +09:00
Yu Watanabe
b88f0fdc87
Merge pull request #30305 from yuwata/seccomp-fix
seccomp: override the default action only when the filter is allow-list
2023-12-04 11:44:58 +09:00
Zbigniew Jędrzejewski-Szmek
8244f394da tests: fix section mapping in test_ukify.py
The regexp only worked if the sections were small enough for the size to
start with "0". I have an initrd that is 0x1078ec7e bytes, so the tests
would spuriously fail.
2023-12-03 12:34:43 +00:00
Luca Boccassi
1707d5daf8
Merge pull request #30297 from keszybz/fixups
A few unrelated fixups for recent commits
2023-12-03 12:34:24 +00:00
Yu Watanabe
78b2ad7d67 seccomp-util: also use ENOSYS for unknown syscalls in seccomp_load_syscall_filter_set()
Follow-up for 2331c02d06cae97b87637a0fc6bb4961b509ccf2.

Note, currently, the function is always called with SCMP_ACT_ALLOW as
the default action, except for the test. So, this should not change
anything in the runtime code.
2023-12-03 18:01:30 +09:00
Yu Watanabe
03c0730ffe seccomp-util: override default action only when the filter is allow-list
Follow-up for 2331c02d06cae97b87637a0fc6bb4961b509ccf2.

Fixes #30304.
2023-12-03 18:00:20 +09:00
Zbigniew Jędrzejewski-Szmek
465a9d2af8 man/systemctl: fix indentation of <xi:include>'s 2023-12-02 21:21:52 +01:00
Zbigniew Jędrzejewski-Szmek
753beeb914 shared/verb: indentation 2023-12-02 16:59:07 +01:00
Mike Yuan
2b98926f98
networkctl: introduce --runtime for editing network config under /run/ 2023-12-02 17:04:57 +08:00
Mike Yuan
7050f7419b
networkctl: drop one assertion
If there're no existing drop-ins, the assertions
are unnecessarily triggered.
2023-12-02 17:04:57 +08:00
Mike Yuan
e9b7408eb9
networkctl: use RET_GATHER more 2023-12-02 17:04:56 +08:00
Zbigniew Jędrzejewski-Szmek
ccd31de8bf stdio-bridge: return immediately if we can
Follow-up for 0321248b79d14ceddd36140b327332f145ae68e7.
2023-12-02 09:47:45 +01:00
Zbigniew Jędrzejewski-Szmek
9ce3440a6f run: fix bad escaping and memory ownership confusion
arg_description was either set to arg_unit (i.e. a const char*), or to
char *description, the result of allocation in run(). But description
was decorated with _cleanup_, so it would be freed when going out of the
function. Nothing bad would happen, because the program would exit after
exiting from run(), but this is just all too messy.

Also, strv_join(" ") + shell_escape() is not a good way to escape command
lines. In particular, one the join has happened, we cannot distinguish
empty arguments, or arguments with whitespace, etc. We have a helper
function to do the escaping properly, so let's use that.

Fixup for 2c29813da3421b77eca5e5cdc3b9a863cad473b9.
2023-12-02 09:47:45 +01:00
Zbigniew Jędrzejewski-Szmek
cffa43255a run: adjust indentation 2023-12-02 09:47:45 +01:00
Zbigniew Jędrzejewski-Szmek
72420d39d7 test-macro: use capital test names for macro tests
It's just easier if the test is named as the thing being tested. Also, this way
inconsistent, because lower in the file uppercase test names are used.
2023-12-02 09:47:11 +01:00
Luca Boccassi
c7ce20f01f NEWS: finalize for v255-rc4 v255-rc4 2023-12-02 02:05:30 +00:00
Luca Boccassi
ebaf2821e6
Merge pull request #30291 from keszybz/seccomp-unknown-syscall
Backwardscompatibly handle syscalls unknown to us or libseccomp
2023-12-02 02:04:24 +00:00