1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-22 22:03:43 +03:00

62612 Commits

Author SHA1 Message Date
Luca Boccassi
18afac6e90 man: fix shellcheck warning for html.in
SC2015: Note that A && B || C is not if-then-else. C may run when A is true.
(cherry picked from commit a5979f0bd50234ff9cad47f160d121628e0e3bbe)
2023-04-27 21:30:38 +01:00
OMOJOLA JOSHUA DAMILOLA
4629419038 added more test cases
(cherry picked from commit e2a4411a2b683e3e5b78c1d4931b5e1029d3ba6e)
2023-04-27 21:30:38 +01:00
Franck Bui
05ae9e276c test: fix regexp in testsuite-74.mount.sh
Several whitespaces can separate "ext4" and "sd-mount-test" strings.

(cherry picked from commit 208d9ad16840aa781efb68bb9c7b1d8f7d03760a)
2023-04-27 21:30:38 +01:00
Franck Bui
295012f7fa test: drop extraneous bracket in testsuite-74.mount.sh
(cherry picked from commit 8607a39e0886f83c9c9f34ae4457c927ef4a932e)
2023-04-27 21:30:38 +01:00
Zbigniew Jędrzejewski-Szmek
ff7040b193 busctl: also assume --full if not writing to terminal
If people grep the output, it probably shouldn't be ellipsized.

(cherry picked from commit f735076c548abe9878e98c2da044458dd0e684f3)
2023-04-27 21:30:38 +01:00
Zbigniew Jędrzejewski-Szmek
00977a8e74 busctl: use size_t for set size
Also reduce the scope of variables.

(cherry picked from commit bc1f1eba776434f84f082bf4935b736c94dbb0f1)
2023-04-27 21:30:38 +01:00
Zbigniew Jędrzejewski-Szmek
802fded9a5 busctl: do not truncate property values when --full
(cherry picked from commit d82267e567698e23e8fd915f057d5d67c912aa09)
2023-04-27 21:30:38 +01:00
Zbigniew Jędrzejewski-Szmek
e400a62a92 oomd: add inline comments with param names
(cherry picked from commit ebfb601945b564142d6471fc10aa611c26dbd8b7)
2023-04-27 21:30:38 +01:00
Yu Watanabe
4067ec52f4 test: add more testcases for rm_rf()
(cherry picked from commit 0278b1c80101cc0d857c1becd0c3a51b2eb14a44)
2023-04-27 21:30:38 +01:00
Yu Watanabe
201830df21 rm-rf: also chmod() directory if it cannot be opened
Otherwise, directory with zero access mode cannot be removed.

(cherry picked from commit 808c8b25eece33c503430151641f5f77676af38c)
2023-04-27 21:30:38 +01:00
Yu Watanabe
d91f7eb0fb rm-rf: mask file mode with 07777 when passed to chmod()
No functional change hopefully, just for safety.

(cherry picked from commit da19c07198167946d35be9fdf908bb683da49cfe)
2023-04-27 21:30:38 +01:00
Yu Watanabe
80417f90b0 rm-rf: fix errno handling
(cherry picked from commit cd2cd095db6f26bf9889ef26f1b105843220b803)
2023-04-27 21:30:38 +01:00
Mike Yuan
ed18c2ab79 core/main: also check the argument terminator
For future-proof reasons, in case we will add
another option that starts with --deserialize.

Addresses 4f44d2c4f7 (r107285603)

(cherry picked from commit 09567df7db75824f1b8bf0b5cc721febda03cb56)
v253.3
2023-04-03 21:58:37 +01:00
Mike Yuan
4f4e0bab0d core: do early setup check for arguments with '=' too
Follow-up for d2ebd50d7f9740dcf30e84efc75610af173967d2

We now modify our cmdline to use '=' for all arguments,
but didn't change early setup check to work with that.
So every daemon-reexec does a full setup, thus breaking
running user sessions.

Fixes #27106

(cherry picked from commit 4f44d2c4f76922a4f48dd4473e6abaca40d7e555)
2023-04-03 00:10:52 +01:00
Дамјан Георгиевски
a3f2884ef2 add a github workflow action to make a release from tags
make a github release for every tag that starts with `v*`,
and a pre-release if the tag contains "-rc".

on the 'systemd/systemd' repo, the "Release" will be draft, so that the
release manager can fill up the notes manually.

on 'systemd/systemd-stable' the release will be created immediately.

info about the action used:
https://github.com/softprops/action-gh-release

(cherry picked from commit 86c20937c29da637878a1282444b057bc1a519fb)
2023-04-03 00:10:52 +01:00
Luca Boccassi
c5bc8bb080 CI: install python3-pyelftools for mkosi job
mkosi's action added it after the pin, but we can't move forward
without other systemd changes
2023-03-30 01:45:40 +01:00
Daan De Meyer
af0c090db5 mkosi: Narrow glob used to install python packages
Let's make sure we only install the python3 and python39 python
packages, instead of all the packages of all versions that are
packaged.

This also fixes the CentOS 8 CI because python3.11-pytest was failing
to install.

We have to ship our own powertools repo definition because we need to
enable module_hotfixes for powertools to coerce dnf into installing
some of the python packages.

(cherry picked from commit 89de1d983ea84d7147011c52b55aa47a7cce862c)
2023-03-30 01:45:40 +01:00
Zbigniew Jędrzejewski-Szmek
bfc03cae41 shared/exec-util: null_or_empty_path() does not return boolean
We shouldn't report that the file is empty if the stating fails. Let's do the
same as in other places, and just ignore the error and let the subsequent
operation fail.

(cherry picked from commit 7d0c47dad0d4282c3924a654a8fe18fc5d7766f8)
v253.2
2023-03-29 16:56:51 +02:00
Lennart Poettering
a2ef3c97bd man: correct/tweak text about unit name syntax
Unit names can be 255 characters long, not 256.

We first say "name prefix" and then continue with "unit prefix".
Confusing. Couldn't figure out which term is better hence settled on
"unit name prefix".

(cherry picked from commit 75f7e5e54704e643aa9b50ce03ed02a49e75333f)
2023-03-29 16:56:51 +02:00
David Tardon
e4c7553874 journal-vacuum: count size of all journal files
Currently, active journal files are excluded, which means that vacuuming
may not remove anything even if *MaxUse= has been exceeded.

(cherry picked from commit 9ea46af4f2368b41d57705bac09774778126507f)
2023-03-29 16:56:51 +02:00
Frantisek Sumsal
e1ddc48ff9 test: add a couple of tests for userdbctl
(cherry picked from commit 93fe228bb16afdb7c450af26b4d2e5771016a833)
2023-03-29 16:56:51 +02:00
Frantisek Sumsal
0e7745249b userdbctl: flush stdout before running the chain command
Otherwise it's quite difficult to capture the entire output:

$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA//dxI2xLg4MgxIKKZv1nqwTEIlE/fdakii2Fb75pG+ foo@bar.tld
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMlaqG2rTMje5CQnfjXJKmoSpEVJ2gWtx4jBvsQbmee2XbU/Qdq5+SRisssR9zVuxgg5NA5fv08MgjwJQMm+csc= hello@world.tld
hello
$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello | tee
hello

(cherry picked from commit 5b09499cacd3c1c95ab240d041e28cc954a5975d)
2023-03-29 16:56:51 +02:00
Frantisek Sumsal
e17d4351a7 docs: s/authorized_key/authorized_keys/
(cherry picked from commit 13bf3216101af82d36e24e5a95f450f166f5030b)
2023-03-29 16:56:51 +02:00
Frantisek Sumsal
5d2588b594 man: s/io.systemd.Dropin/io.systemd.DropIn/
(cherry picked from commit 8f572d0d82f2f8bb3995faa569da5af1ef7a427d)
2023-03-29 16:56:51 +02:00
Frantisek Sumsal
1185e7f9d3 userdbctl: don't show legend when dumping JSON with services
(cherry picked from commit eedd1da9f992f9b9d38e298207428500b745156b)
2023-03-29 16:56:51 +02:00
Lennart Poettering
7822ae021b analyze: don't claim "@known" was an unlisted syscall
It's a sycall group of our own definition, and the output is erroneous
to claim otherwise. Let's hide it.

This adds syscall_set_add() which is nicely symmetric to the existing
syscall_set_remove().

Follow-up for: 6d6a08547c03f96dc798cda1ef4a8d3013d292d5

(cherry picked from commit 950c0ed38935198a67a57c645e499555eaf006eb)
2023-03-29 16:56:51 +02:00
Lennart Poettering
54f97c0ae5 seccomp-util: add some newer syscalls to existing groups
These three new syscalls are mostly just new flavours or extensions of
existing syscalls, hence add them to the same groups.

(cherry picked from commit 76e86b8dd8cca9f9fee120289945b29e1dbbe215)
2023-03-29 16:56:51 +02:00
Zbigniew Jędrzejewski-Szmek
90ba721560 xdg-autostart-generator: do not warn about unknown fields
My user manager says:
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:256: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:258: Unknown section 'Desktop Action new-window'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:343: Unknown section 'Desktop Action preferences'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:12: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:13: Unknown key name 'SingleMainWindow' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:19: Unknown section 'Desktop Action Quit'. Ignoring.

This is not useful. Those are externally-provided files, and they are likely to
have entries which we know nothing about.

(cherry picked from commit b5a70eeecdb593f8498c0bc163d5a12297cfb55d)
2023-03-29 16:56:51 +02:00
наб
f6388f561c find-esp: don't silently error bootctl install if presumed XBOOTLDR part is stx_dev_major=0 but not btrfs
btrfs_get_block_device_fd() returns -ENOTTY if fstatfs().f_type !=
BTRFS_SUPER_MAGIC

btrfs_get_block_device_fd() is run by verify_fsroot_dir() by
verify_xbootldr() by find_xbootldr_and_warn() if
statx($presumed-XBOOTLDR).stx_dev_major == 0 ("maybe a btrfs device")

Every bootctl verb_install() runs find_xbootldr_and_warn(), by default
with /boot

If your /boot .stx_dev_major=0 but /not/ btrfs, bootctl install/update
quietly exits 1 with no note so as to what exactly failed (debug also
empty, and the strace isn't exactly clear since no syscall actually
failed)

This is the case on ZFS and the Debian filesystem layout: /boot/efi is
the ESP, and everything else under / is ZFS:
  $ sudo env SYSTEMD_LOG_LEVEL=debug bootctl update
  Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
  Found container virtualization none.
  File system "/boot" is not a FAT EFI System Partition (ESP) file system.
  Using EFI System Partition at /boot/efi.
  Checking whether /boot/efi/EFI/systemd/ contains any files…
  $ echo $?
  1
and funnier still:
  $ sudo bootctl update --graceful
  $ echo $?
  1

Which is great, and also breaks postinst, which runs precisely the
latter, with no feedback at all

By checking for -ENOTTY we accept that the path being investigated
"is not it" if it's on ZFS (and any other filesystem that returns
.stx_dev_major == 0 but isn't btrfs)

(cherry picked from commit ed89819f8fd7bfe99cd652082076e85e1417e4e9)
2023-03-29 16:56:51 +02:00
Tobias Powalowski
f492ca7b5d ukify: allow uncompressed kernel images for UNAME detection on aarch64 and riscv64 (#26929)
Uncompressed aarch64 and riscv64 kernels have a different startpoint than x86.
Example output from ukify:
aarch64: NotImplementedError: unknown file format (starts with b'MZ@\xfa')
riscv64: NotImplementedError: unknown file format (starts with b'MZo\x10')
Add check for (b'MZ') to catch both in one call.

Fix:
https://github.com/systemd/systemd/issues/26923
(cherry picked from commit bf9f07a62966043c0f1fd7ac4a249790643d1f9a)
2023-03-29 16:56:51 +02:00
Daan De Meyer
22c47d24a4 core: Settle log target if we're going to be closing all fds
Whenever we're going to close all file descriptors, we tend to close
the log and set it into open when needed mode. When this is done with
the logging target set to LOG_TARGET_AUTO, we run into issues because
for every logging call, we'll check if stderr is connected to the
journal to determine where to send the logging message. This check
obviously stops working when we close stderr, so we settle the log
target before we do that so that we keep using the same logging
target even after stderr is closed.

(cherry picked from commit a3b00f91bb985fa10bc33db5c7883e33dbdf83d0)
2023-03-29 16:56:51 +02:00
Yu Watanabe
ce06e000b8 activate: use log_set_open_when_needed()
Otherwise, several error logs may not be shown.

(cherry picked from commit a723521fd26d40ce90357e4e9b8131f1e1656ab5)
2023-03-29 16:56:51 +02:00
Kevin P. Fleming
b041337a7a bootctl: 'graceful' should ignore EFI variable failures
Suppress errors when creating/writing EFI variables during 'bootctl update' if
'--graceful' mode is active (as the documentation indicates).

Closes #26773.

(cherry picked from commit 06d104d58ffa23c958b9b2a2809c61fb25e6f762)
2023-03-29 16:56:51 +02:00
Thomas Blume
059ca4fe8f udev-rules: fix nvme symlink creation on namespace changes
The nvme by-id symlink changes to the latest namespace when a new namespace gets
added, for example by connecting multiple NVMe/TCP host controllers via nvme
connect-all.
That is incorrect for persistent device links.
The persistent symbolic device link should continue to point to the same NVMe
namespace throughout the lifetime of the current boot.
Therefore the namespace id needs to be added to the link name.

(cherry picked from commit c5ba7a2a4dd19a2d31b8a9d52d3c4bdde78387f0)
2023-03-29 16:56:51 +02:00
Antonio Alvarez Feijoo
2a8c1168b1 man/network-generator: replace dracut.kernel reference with dracut.cmdline
`dracut.kernel.7` is just a symlink to `dracut.cmdline.7`, so the web reference
points to a non-existent URL
(https://man7.org/linux/man-pages/man7/dracut.kernel.7.html).

(cherry picked from commit 9baeb58fcdcd3b8893fc485bb33726820ce46e94)
2023-03-29 16:56:51 +02:00
Antonio Alvarez Feijoo
ad2d77b899 gpt-auto-generator: fix typo
(cherry picked from commit dd23292c080f6e8b972c63b025ad3997972bc9e4)
2023-03-29 16:56:51 +02:00
David Tardon
c86983c58a systemctl: always print circular deps. at the end
Before:
a.target
○ └─b.target
    ├─...
●   └─paths.target

After:
a.target
○ └─b.target
●   ├─paths.target
    └─...

(cherry picked from commit bb7c4a93ea1167b1294f86307d712d45655e9632)
2023-03-29 16:56:51 +02:00
David Tardon
6903f28d8d systemctl: fix formatting of circular dep.
Before:
a.target
○ └─b.target
    └─...
●   └─paths.target

After:
a.target
○ └─b.target
    ├─...
●   └─paths.target

(cherry picked from commit 5a4711e4895e3f7091e0e4da654412232484a5ec)
2023-03-29 16:56:51 +02:00
David Tardon
cee098e4e1 systemctl: fix indentation of circular deps
We're still at level `level` here.

Before:
b.target
○ ├─a.target
  │   └─...
● └─paths.target

After:
b.target
○ ├─a.target
  │ └─...
● └─paths.target

Fixes #26052.

(cherry picked from commit a9f2f486f3d1dd1cd2a58cd384b0e88970e2fda9)
2023-03-29 16:56:51 +02:00
Yu Watanabe
7ca1a3a1d4 tmpfiles: show file type in octal, instead of hex
(cherry picked from commit 056ff0b455ec54c9cadd119b09d0ec36efdee808)
2023-03-29 16:56:51 +02:00
Daan De Meyer
c4848032f1 units: Order user@.service after systemd-oomd.service
The user manager connects to oomd over varlink. Currently, during
shutdown, if oomd is stopped before any user manager, the user
manager will try to reconnect to the socket, leading to a warning
from pid 1 about a conflicting transaction.

Let's fix this by ordering user@.service after systemd-oomd.service,
so that user sessions are stopped before systemd-oomd is stopped,
which makes sure that the user sessions won't try to start oomd via
its socket after systemd-oomd is stopped.

(cherry picked from commit cafd2c0be404cb8879f91d15e05cc8b695b32629)
2023-03-29 16:56:51 +02:00
Daan De Meyer
d1d7788000 repart: Report better errors if partition sizes are too small
(cherry picked from commit e21be7976aba577e0ba66300e631c5ae7feb02d9)
2023-03-29 16:56:51 +02:00
Daan De Meyer
6c21f95640 repart: Zero full verity signature partition size
systemd-dissect requires the entirety of the partition following the
signature to be zeroed, so let's do just that.

(cherry picked from commit d28c6ce62c4915ec5f7e10dc49be5e51c2356dad)
2023-03-29 16:56:51 +02:00
Daan De Meyer
659e7f274e repart: Make sure we seek to beginning of partition target before copy
(cherry picked from commit 6eccec00fb50e1a35f5a11e3339d634541bcc3a8)
2023-03-29 16:56:51 +02:00
Mike Yuan
fd963d1bc8 sleep: fix default values unmatched with manual
(cherry picked from commit f05b4bb9a7a70092641f43486fc7a45c85fc9c63)
2023-03-29 16:56:51 +02:00
Addison Snelling
37f65e46d3 man: fix misspelled executable name (#26858)
(cherry picked from commit 0c868e3fada33c7139112f0268c29307bdcd6ee7)
2023-03-29 16:26:39 +02:00
Franck Bui
7157d721b9 tests: don't use absolute paths when installing binaries in TEST-58-REPART
Let image_install figures the binary paths out itself as not all distributions
ship the mkfs.* tools in the same location. For example openSUSE ships
mksquashfs in /usr/bin/.

(cherry picked from commit 1b971e0117cd78f262dbcb307a8c446e558da6ee)
2023-03-29 16:26:39 +02:00
Franck Bui
1bff31077b tests: fix inverted condition in testsuite-58.sh
(cherry picked from commit 8fd25ba3438487cf79bd693c9022c51699562126)
2023-03-29 16:26:39 +02:00
Zbigniew Jędrzejewski-Szmek
2ead535f0d man: document "Delegate=" a bit more
This case is a bit surprising, even if logical if one understands how the
parser works. Let's be more explicit.

Follow-up for 7b3693e4e4c9cae50fca65136278a62fae11327e.

(cherry picked from commit 449172f943acadc7fd1e2293a615c7cb0d87fcd6)
2023-03-29 16:26:39 +02:00
Daan De Meyer
16183e66f6 man: Fix user generator output paths
These are all under $XDG_RUNTIME_DIR/systemd instead of directly
under $XDG_RUNTIME_DIR.

(cherry picked from commit 80c7d4b8fa9f8283af7f0213739e3463c68a30f6)
2023-03-29 16:26:39 +02:00