1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00
Commit Graph

66130 Commits

Author SHA1 Message Date
Luca Boccassi
7f0bf48d31 Update NEWS 2023-07-24 10:45:28 +01:00
Luca Boccassi
b41ab9b3f4 softreboot: ensure all processes are killed
Having surviving processes is not ready yet as a feature, so ensure
everything is killed on the transition for now
2023-07-24 10:45:28 +01:00
Luca Boccassi
3835b9aa4b Revert "core: add IgnoreOnSoftReboot= unit option"
The feature is not ready, postpone it

This reverts commit b80fc61e89.
2023-07-22 23:27:27 +01:00
Daniel Rusek
acfff02c8f po: Translated using Weblate (Czech)
Currently translated at 93.3% (212 of 227 strings)

Co-authored-by: Daniel Rusek <mail@asciiwolf.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/cs/
Translation: systemd/main
2023-07-22 18:43:25 +01:00
Dan Streetman
63477a71df tpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm spec
To keep compatibility with any existing object authValues with trailing 0's,
change tpm2_get_pin_auth() to trim trailing 0's, which is what the TPM
implementation will do. This should retain compatibility with any existing
authValues that contain trailing 0's.

Note that any existing authValues with trailing 0's are unlikely to have worked
in the way that systemd uses them in object sealing, which is as a bind key for
the encryption (and policy) session. However, it is better to be compatible
with the TPM spec (and implementations) even if previously created objects that
are affected may not have worked.

Fixes: #28414
2023-07-21 23:10:03 +01:00
Luca Boccassi
73d6f20155
Merge pull request #28487 from yuwata/statx-fixlets
util: fix error handling of statx()
2023-07-21 23:09:40 +01:00
Dan Streetman
adb7fe82c7 Revert "cryptenroll: drop unmet condition"
This reverts commit cefa4a02ab.

Because the first 'break' is inside a nested for loop, this second 'break' is
needed to exit the outer for loop.

Fixes: #28451
2023-07-21 18:59:26 +01:00
Luca Boccassi
686b983040
Merge pull request #26541 from DaanDeMeyer/xfs-whitespace-fix
mkfs-util: Escape spaces with slashes in protofile format
2023-07-21 18:58:27 +01:00
Yu Watanabe
68a4fc8b53 fd-util: do not call statx() twice when it does not provide mount ID
Previously, in path_is_root_at(), if statx() does not provide mount ID,
path_get_mnt_id_at() was called, but it also calls statx(). Let's avoid
the second trial.
2023-07-22 02:22:06 +09:00
Yu Watanabe
bd96111d5f fd-util: make path_is_root_at() not fail even when /proc is mounted
path_get_mnt_id_at() -> fd_fdinfo_mnt_id() may return -EOPNOTSUPP when
/proc is mounted, and -ENOSYS otherwise, when an old kernel is used.
2023-07-22 02:20:27 +09:00
Yu Watanabe
7487115766 mountpoint-util: statx() may return EINVAL if the kernel does not support the syscall
When statx() is called with AT_STATX_DONT_SYNC, glibc's fallback code
returns EINVAL. See statx_generic() in glibc.
2023-07-22 02:20:22 +09:00
Yu Watanabe
d35ff4b60e stat-util: fix error handling of statx()
When newer glibc is used, but kernel does not support statx(), then
glibc try to fallback with fstatat(). That's quite similar to our
implementation, but the supported flags are different, and if
unsupported flags are specified, it returns EINVAL.

Let's handle the case more gracefully.
2023-07-22 02:14:54 +09:00
Zbigniew Jędrzejewski-Szmek
671903b315
Merge pull request #28436 from rpigott/zsh-fixups
zsh systemctl completion fixups
2023-07-21 19:13:53 +02:00
Luca Boccassi
b80fc61e89 core: add IgnoreOnSoftReboot= unit option
As it says on the tin, configures the unit to survive a soft reboot.
Currently all the following options have to be set by hand:

Conflicts=reboot.target kexec.target poweroff.target halt.target
Before=reboot.target kexec.target poweroff.target halt.target
After=sysinit.target basic.target
DefaultDependencies=no
IgnoreOnIsolate=yes

This is not very user friendly. If new default dependencies are added,
or new shutdown/reboot types, they also have to be added manually.

The new option is much simpler, easy to find, and does the right thing
by default.
2023-07-21 18:05:41 +02:00
Zbigniew Jędrzejewski-Szmek
03d298e1e5
Merge pull request #28460 from bluca/scope_run_env
run: disable --expand-environment by default for --scope
2023-07-21 15:41:56 +02:00
Daan De Meyer
776be5964d mkfs-util: Escape spaces with slashes in protofile format 2023-07-21 15:35:50 +02:00
Yu Watanabe
dc8b82a5b4 test-ukify: use systemd-measure and bootctl in build directory
And skip tests if systemd-measure is not found.
Then, we can safely run test_ukify.py directly.
2023-07-21 15:32:02 +02:00
Daan De Meyer
ce8b4261eb xfs: Bump minimal size to 300M
From the xfsprogs source code:

* We don't support filesystems smaller than 300MB anymore.  Tiny
* filesystems have never been XFS' design target.  This limit has been
* carefully calculated to prevent formatting with a log smaller than
* the "realistic" size.
*
* If the realistic log size is 64MB, there are four AGs, and the log
* AG should be at least 1/8 free after formatting, this gives us:
*
* 64MB * (8 / 7) * 4 = 293MB

So let's accommodate and bump the minimal XFS filesystem size to 300M.
2023-07-21 14:22:53 +02:00
Topi Miettinen
d0b2839ddc homework-luks: fix typos 2023-07-21 21:11:04 +09:00
Yu Watanabe
df1dccd255 udev: decrease devlink priority for iso disks
Previously, if the priority is same, devlinks are always replaced by
newer events. The commit 331aa7aa15 changes
that to keep the existing devlink. That should not change any behavior
when the devices that request the same symlink do not have any
dependency, e.g. when /dev/sda1 and /dev/adb1 request the same
/dev/disk/by-label symlink, as there are no guarantee that which device
is processed first.

However, when devices has dependency, e.g. /dev/sda and /dev/sda1
request the same /dev/disk/by-label symlink, previously the symlink
always pointed to the partition, as the partition is always processed
later. But, 331aa7aa15 makes the symlink
point to the whole disk.

The change by 331aa7aa15 is crucial to
improve performance of devlink handling, especially when a system has
large number of disks with same label or so. Hence, cannot and should
not be reverted.

So, let's workaround the case, as such situation should happen only when
the disk is a hybrind ISO image, I guess.

Fixes #28468.
2023-07-21 11:42:34 +01:00
Yu Watanabe
dc3b5e0432 tree-wide: fix typo found by Fossies Codespell report 2023-07-21 19:12:08 +09:00
Michael A Cassaniti
66a8c74c35 repart: Set sector size of loopback devices
When an explicit sector size is set by the user it is also necessary to set the
sector size of any loopback devices. If the sector size is not set for loopback
devices then it can cause file system creation to fail or run into odd issues.
2023-07-21 11:04:39 +01:00
Yu Watanabe
01b030c201 udev: downgrade log level when running without cgroup
The cgroup path is optional, hence it is not necessary to warn the
failure loudly.

Follow-up for f8371dbd56.

Closes #28469.
2023-07-21 12:38:33 +09:00
Yu Watanabe
c0d998248e tree-wide: drop references to /dev/loop/by-ref
Follow-up for #28476.
2023-07-21 10:24:20 +09:00
Yu Watanabe
d168daa5c2
Merge pull request #28476 from bluca/revert_loop_links
Revert "udev: add /dev/loop/ symlinks"
2023-07-21 10:21:06 +09:00
Luca Boccassi
9915cc6086 Revert "udev: add /dev/loop/ symlinks"
Turns out this causes a regression and breaks losetup. It will need to
be reworked in conjunction with util-linux changes.

Fixes https://github.com/systemd/systemd/issues/28475

This reverts commit 5ac52d1f7b.
2023-07-20 22:28:23 +01:00
Luca Boccassi
5022fab15f Revert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks"
This reverts commit f5e46b9e09.
2023-07-20 22:26:40 +01:00
Luca Boccassi
d05553797e NEWS: note that sd-run --expand-environment will change 2023-07-20 17:41:38 +01:00
Luca Boccassi
8167c56bfa run: disable --expand-environment by default for --scope
The intention was to have this option enabled by default everywhere,
but unfortunately at least one case was found where it breaks
compatibility of a program using systemd-run --scopes and expecting
variables not to be expanded:

https://sources.debian.org/src/pbuilder/0.231/pbuilder-checkparams/#L400

Example run:

systemd-run --quiet --scope --description=pbuilder_build_xfce4-notes-plugin_1.10.0-1.dsc '--slice=system-pbuilder-build-xfce4\x2dnotes\x2dplugin_1.10.0\x2d1-449932.slice' chroot /var/cache/pbuilder/build/449932 dpkg-query -W '--showformat=${Version}' apt

Restore backward compatibility and make the option disabled by default
when --scope is used, and enabled by default for other types.

In case --expand-environment is not specified and a '$' character is
detected, print a warning to nudge users toward specifying the
parameter as needed. In the future we can then flip the default.

Follow-up for 2ed7a221fa
2023-07-20 17:37:27 +01:00
Yu Watanabe
b0efbe9b81 test: use XDG_STATE_HOME for %S and %L
This fixes the test failure when invoked by a user.
===
Running ./systemd-tmpfiles --user on 'f /tmp/test-systemd-tmpfiles.1foag_ur/test-content.n_9r_xhm/arg - - - - %S'
expect: '/home/watanabe/.config'
actual: '/home/watanabe/.local/state'
Traceback (most recent call last):
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 233, in <module>
    test_valid_specifiers(user=True)
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 135, in test_valid_specifiers
    test_content('f {} - - - - %S',
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 88, in test_content
    assert content == expected
           ^^^^^^^^^^^^^^^^^^^
AssertionError
===

This also makes the test uses fallback paths.

Follow-up for b50aadaff2.
2023-07-20 12:54:54 +01:00
Yu Watanabe
4fc925a026 test: fix a syntax error in test-ukify
Follow-up for d7d36252e5.

Fixes #28464.
2023-07-20 09:55:32 +02:00
Ronan Pigott
9ec0808370 zsh: use glob matching for template names
Template names can be learned from the filesystem, so there isn't a need
to parse the output of systemctl list-unit-files in this case. This
should accelerate the completion of some verbs like enable.
2023-07-19 15:07:39 -07:00
Ronan Pigott
ae6fb82cd9 zsh: remove unit property caching
The existing caching policy isn't very sensible for this cache. We could
write a different policy, but I don't think there is much value in
caching these values, as in my experience the command used to generate
them is quick.
2023-07-19 14:27:45 -07:00
Ronan Pigott
110ba0ccf9 zsh: update default caching policy for units
The existing caching policy was completely bogus.

In the first stanza, despite the comment, the pattern given would
consider the cache invalid if it was more than 1 hour old.

The second stanza was also incorrect, since the output of `systemctl
--all` is not unit file paths, but unit names. When they were being
tested against the cachefile mtime, the test would always fail becuase
of the nonexistant file (hopefully).

In fact it's not very useful to test if the unit files have newer mtime
in this case anyway, since we are only caching their names. Also,
`systemctl --all` is an unfortunately slow operation to be used in
testing for the cache validity — we want this operation to at least be
faster than rebuilding the cache.

I've rewritten this stanza with my best guess at its original intent. It
now checks against the mtime of the parent directories in the search
path, which should be updated and cause the cache to rebuild when we
add, remove, or rename any unit files.
2023-07-19 14:27:45 -07:00
Zbigniew Jędrzejewski-Szmek
e51846adc0 man: clarify DNSSEC= again
https://github.com/systemd/systemd/pull/28407#issuecomment-1640900239
2023-07-19 15:13:01 +02:00
Dmitry V. Levin
f0406e118f locale-util: fix _() definition
The previous definition was not quite appropriate for the library code
because it relied on the message domain set by textdomain() invocation
which is not necessarily the same message domain defined in
GETTEXT_PACKAGE macro.

The only code that uses _() so far is located in pam_systemd_home.c.

Fixes: 20f56fddcd ("Add gettext support")
2023-07-19 14:02:04 +02:00
Luca Boccassi
7177c9022e
Merge pull request #28445 from bluca/run_host_release
core: copy the host's os-release for /run/host/os-release
2023-07-19 09:34:06 +01:00
Daan De Meyer
95f3bd0b51
Merge pull request #28447 from mrc0mmand/test-network
network: fix fetching link properties
2023-07-19 08:07:31 +02:00
Yu Watanabe
149aedb89b kernel-install: silently ignore unexpected arguments for 'remove' command
The shell script version of kernel-install silently ignored unexpected
arguments, but C version refused that. Unfortunately, Fedora's kernel
script specifies kernel file even for 'remove' command. Let's accept
extra arguments and silently ignore them to keep backward compatibility.

Fixes #28448.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2223794.
2023-07-19 07:24:36 +02:00
Frantisek Sumsal
8bdece7479 network: fix fetching link properties
This fixes regression introduced in 5a0c810462 with which all requests
for link properties ended up with EINVAL as we kept hitting
the signature_is_single() assert in sd_bus_get_property().
2023-07-18 23:08:19 +02:00
Frantisek Sumsal
7e107bc31f test-network: probe a couple of uncovered networkctl codepaths 2023-07-18 21:42:39 +02:00
Frantisek Sumsal
aca99a3a38 test-network: validate JSON where applicable 2023-07-18 21:42:39 +02:00
Daan De Meyer
e30c6e913c repart: Always take --offline into account 2023-07-18 18:26:23 +02:00
Luca Boccassi
25c66abbed NEWS: note that /run/host/os-release is available more broadly 2023-07-18 17:26:02 +01:00
Luca Boccassi
947d836a6e man: explicitly note that units surviving soft-reboot should not pin resources 2023-07-18 17:26:02 +01:00
Luca Boccassi
3f37a82545 core: copy the host's os-release for /run/host/os-release
Currently for portable services we automatically add a bind mount
os-release -> /run/host/os-release. This becomes problematic for the
soft-reboot case, as it's likely that portable services will be configured
to survive it, and thus would forever keep a reference to the old host's
os-release, which would be a problem because it becomes outdated, and also
it stops the old rootfs from being garbage collected.

Create a copy when the manager starts under /run/systemd/propagate instead,
and bind mount that for all services using RootDirectory=/RootImage=, so
that on soft-reboot the content gets updated (without creating a new file,
so the existing bind mounts will see the new content too).

This expands the /run/host/os-release protocol to more services, but I
think that's a nice thing to have too.

Closes https://github.com/systemd/systemd/issues/28023
2023-07-18 17:26:02 +01:00
Zbigniew Jędrzejewski-Szmek
7e90814f0a Deprecate efivar SystemdOptions
As mentioned in the NEWS entry, it seems to see very little use, but adds
complexity in our code. It was added mainly with the goal of making it easier
for people using grub2 to modify their boot configuration, but grub2 is gaining
support for BLS snippets. On the systemd side, we now have credentials. So
let's deprecate this, and if there's no outcry, remove it in a few releases.
2023-07-18 17:30:06 +02:00
Petr Menšík
96d384ca4f Include in manual what DNSSEC=no means in detail
https://www.rfc-editor.org/rfc/rfc4035.html#section-3.2.1 says
security-aware recursive name server MUST set DO bit when sending
requests. systemd-resolved does not do that by design. State it more
clearly in manual page. Unlike other implementations it disables not
only validation as it stated, but complete DNSSEC awareness.

Signed-off-by: Petr Menšík <pemensik@redhat.com>
2023-07-18 17:28:32 +02:00
Joerg Behrmann
c46f5680ca analyze: don't warn about version spec compliant versions
This commits adds version_is_valid_versionspec and uses it in
analyze-compare-version.c.

version_is_valid_versionspec differs from version_is_valid in that it acepts
empty strings and since valid characters in a version spec version are all
ASCII letters and digits as well as "-.~^", but ",_+" allowed by
version_is_valid are not.

Also give a more specific warning message on invalid characters.
2023-07-18 15:57:15 +01:00
Frantisek Sumsal
1dfa58edd3 Revert "packit: temporarily use older Rawhide spec"
This reverts commit f1adb4a2ea.
2023-07-18 15:28:07 +02:00