1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00
Commit Graph

8036 Commits

Author SHA1 Message Date
Michal Sekletar
76f2191d8e logind: introduce CreateSessionWithPIDFD()
This new D-Bus API uses pidfd to refer to the session leader. Also,
pam_systemd will try to make use of it when pidfd support is available.
2023-10-26 14:28:48 +01:00
Daan De Meyer
c173be0d4c
Merge pull request #29708 from DaanDeMeyer/bootctl-always
Always build bootctl
2023-10-25 22:59:59 +02:00
Mike Yuan
8c29f6a572 man/systemd.unit: add PropagatesStopTo= to reverse property table 2023-10-25 19:34:17 +01:00
Daan De Meyer
7e7ea1b1c8 meson: Always build systemd-measure
Same idea as with bootctl, we might be doing image builds from a
system that doesn't boot with UEFI but we still might want to measure
stuff for the image we're building so let's not gate this behind
ENABLE_BOOTLOADER.
2023-10-25 16:49:30 +02:00
Daan De Meyer
dedb925eaf meson: Always build bootctl
bootctl is rather useful to have, even if on a system without UEFI,
as it has a number of verbs that are unrelated to UEFI (e.g kernel-identify),
and more importantly, it supports --root to operate on directory trees
(which could be intended to be deployed on UEFI) so let's make sure we
always build it.
2023-10-25 16:49:24 +02:00
Luca Boccassi
7470e161cf
Merge pull request #29553 from keszybz/analyze-cat-config-tldr
analyze/cat-config: add switch to print only "interesting" parts of conffiles
2023-10-25 09:53:19 +01:00
Mike Yuan
828ad30470 sleep-config: make hybrid sleep always use 'suspend' disk mode
If user requests hybrid sleep, we should always use 'suspend'
disk mode. If that's not supported, let's correctly report it
so they can choose plain hibernation instead. HybridSleepMode=
serves no purpose in this case and should be removed.

Addresses https://github.com/systemd/systemd/pull/29681#discussion_r1369812785
2023-10-24 19:07:03 +02:00
Zbigniew Jędrzejewski-Szmek
5737c890d6 binfmt: add --tldr 2023-10-24 18:32:18 +02:00
Zbigniew Jędrzejewski-Szmek
f80f5dd6cc sysctl: add --tldr 2023-10-24 18:32:18 +02:00
Zbigniew Jędrzejewski-Szmek
918560d70f sysusers: add --tldr 2023-10-24 18:32:17 +02:00
Zbigniew Jędrzejewski-Szmek
1be6a5db21 tmpfiles: add --tldr
This is like --cat-config, but omits the comments and empty lines.
The name is incoungrous with --cat-config, but I don't see a nice way to
call it that wouldn't be annoyingly long.

pager_open() is moved to cat_config() to remove some lines from run().
2023-10-24 18:32:17 +02:00
Zbigniew Jędrzejewski-Szmek
063c838206 analyze/cat-config: add switch to print only "interesting" parts of config files
When looking at configuration, often a user wants to suppress the comments and
just look at the parts that actually configure something, roughly equivalent to
  systemd-analyze cat-config … | rg -v '^(#|;|$)
This switch implements this natively, skipping lines that start with a comment
character or only contain whitespace.

For formats that have section headers, section headers are skipped, if only
followed by stuff that would be skipped. (The last section header is printed
when we're about to print some actual output.)

Note that the caller doesn't know if the format has headers or not. We do format
type detection in pretty-print.c. So the caller only specifies tldr=true|false, and
conf_files_cat() figures out if the format has headers and whether those should
be handled specially.

The comments that show the file name are always printed, even if all of the file
is suppressed.

This is a partial answer to the discussions in
https://github.com/systemd/systemd/pull/28919,
https://github.com/systemd/systemd/pull/29248. If the default config is shown in
config files, the user can conveniently use '--tldr' to show the relevant parts.
2023-10-24 15:59:34 +02:00
Mike Yuan
1f82c21dce
sleep-config: remove HibernateState= & HybridSleepState=, restrict
SuspendState= not to include "disk"

I don't know why these existed in the first place, but as I
justified in the comments, it's simply not sensible to allow
HibernateState= or HybridSleepState= to take values other than
'disk'. So let's just remove those options. Also, SuspendState=
should not contain 'disk'.
2023-10-23 23:12:27 +08:00
NAHO
e6e5a272ed docs: correct parenthesis placement in 'man/tmpfiles.d.xml'
Correct the parenthesis placement in 'man/tmpfiles.d.xml' to prevent the
following formatting:

> lock ( shared or exclusive) is
2023-10-22 18:12:58 +01:00
Mike Yuan
5d4072d0ed
man,docs: suffix directories with / 2023-10-21 06:25:35 +08:00
Valentin David
7a876307bb stub: Ignore the boot counter when looking for .extra.d directory
If `foo+3-0.efi` is booted when there are some files in `foo.efi.extra.d`,
those files are ignored. But after the boot is blessed and the system rebooted,
those file are taken into account, and the boot is different from first
boot. This behavior is a bit puzzling.

Instead we now ignore the counter and always look for the extra files in
`foo.efi.extra.d` and always boot the same way.
2023-10-20 16:18:09 +01:00
Luca Boccassi
f455365031
Merge pull request #29626 from bluca/auto_soft_reboot
systemctl: automatically softreboot/kexec if set up on reboot
2023-10-20 13:46:46 +01:00
Luca Boccassi
665a3d6d15 systemctl: automatically softreboot/kexec if set up on reboot
Automatically softreboot if the nextroot has been set up with an OS
tree, or automatically kexec if a kernel has been loaded with kexec
--load.

Add SYSTEMCTL_SKIP_AUTO_KEXEC and SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT to
skip the automated switchover.
2023-10-20 11:45:37 +01:00
Joerg Behrmann
cf37171890 credentials: document that their path is stable for system services 2023-10-20 11:44:46 +01:00
Lennart Poettering
612a91c11a man: document the order in which we talk to DNS servers 2023-10-20 10:12:51 +01:00
Luca Boccassi
017e8094f6 man: mention that inhibit blocks soft-reboot too 2023-10-20 00:35:12 +01:00
Mike Yuan
2ee346160c
systemctl: is-failed: check if system is degraded when no unit given
Closes #3335
2023-10-19 00:12:28 +08:00
Luca Boccassi
cdc022802c
Merge pull request #29441 from evelikov/no-input-delay
sd-boot: add "menu-disabled" option to "timeout", disabling the 100ms input polling
2023-10-17 23:45:44 +01:00
Zbigniew Jędrzejewski-Szmek
ee691c802b
Merge pull request #29242 from fbuihuu/update-main-config-file-headers
config files: update their header to reflect that they can be install…
2023-10-17 18:56:09 +02:00
Emil Velikov
6efdd7fec5 sd-boot: add way to disable the 100ms delay when timeout=0
Currently we have a 100ms delay which allows for people to enter/show
the boot menu even when timeout is set to zero.

In a handful of cases, that may not be needed - both in terms of access
policy, as well as latency.

For example: the option to provide the boot menu may be hidden behind an
"expert only" UX in the OS, to avoid end users from accidentally
entering it.

In addition, the current 100ms input polling may cause unexpected
additional delays in the boot. Some example numbers from my SteamDeck:

 - boot counting/rename/flush doubles 300us -> 600us
 - seed/hash setup doubles 900us -> 1800us
 - kernel/image load gets ~40% slower 107ms -> 167ms

It's not entirely clear why the UEFI calls gets slower, nevertheless the
information in itself proves useful.

This commit introduces a new option "menu-disabled", which omits the
100ms delay. The option is documented throughout the manual pages as
well as the Boot Loader Specification.

v2:
 - use STR_IN_SET

v3:
 - drop erroneous whitespace

v4:
 - add a new LoaderFeature bit,
 - don't change ABI keep TIMEOUT_* tokens the same
 - move new token in the 64bit range, update API and storage for it
 - change inc/dec behaviour to TIMEOUT_MIN : TIMEOUT_MENU_FORCE
 - user cannot opt-in from sd-boot itself, add assert_not_reached()

v5:
 - s/Menu disablement control/Menu can be disabled/
 - rewrap comments to 109
 - use SYNTHETIC_ERRNO(EOPNOTSUPP)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-17 15:09:53 +01:00
Mike Yuan
707ecf1423 core/mount: allow disabling stop propagation from backing device
With file systems that have volume management functionalities or
volume managers like LVM, it's fine for the backing device of a mount
to disappear after mounted. Currently, we enforce BindsTo= or
StopPropagatedFrom= on the backing device, thus prohibiting such
cases. Instead, let's make this configurable through x-systemd.device-bound.

Closes #16801
Closes #29543
2023-10-17 11:23:36 +01:00
Yu Watanabe
dced8fe402
Merge pull request #29588 from keszybz/net-naming-scheme-255
Untangle the net-naming-scheme mess with SR-IOV-R "representor" information
2023-10-17 19:18:29 +09:00
Daan De Meyer
37ba73b1b2
Merge pull request #28373 from DaanDeMeyer/udevadm-query
Add --json and filtering options for --export-db to udevadm info
2023-10-17 10:16:43 +02:00
Zbigniew Jędrzejewski-Szmek
64f2cf77d1 NEWS, man: move description of SR-IOV-R net naming to v255
https://github.com/systemd/systemd/pull/29582 adds the "v254" name. This also
changes what the default is and what "latest" refers to. Without the name, the
code could be enabled via runtime configuration. Nevertheless, it could be
enabled at compilation time. In other words:
  meson setup build -Ddefault-net-naming-scheme=v254
would work, but
  net.naming-scheme=v254
would fail.

It is possible that people were using the compile-time override, so I think
we should allow "v254" scheme to stay and clearly document that it wasn't the
default.

Unfortunately, unless people manually introduced the compile-time override, we
were never actually testing the new code too. So all the pull request testing
was not useful.
2023-10-16 21:21:54 +02:00
Daan De Meyer
a6b4b2fa01 udev: Enable filtering the output of udevadm info --export-db
Let's support the same filtering options that we also support in
udevadm trigger in udevadm info to filter the devices produced by
--export-db.

One difference is that all properties specified by --propery-match=
have to be satisfied in udevadm info unlike udevadm trigger where just
one of them has to be satisfied.
2023-10-16 17:02:00 +02:00
Lennart Poettering
cde8cc946b
Merge pull request #29272 from enr0n/coredump-container
coredump: support forwarding coredumps to containers
2023-10-16 16:13:16 +02:00
Luca Boccassi
7c83d42ef8 mount-util: use mount beneath to replace previous namespace mount
Instead of mounting over, do an atomic swap using mount beneath, if
available. This way assets can be mounted again and again (e.g.:
updates) without leaking mounts.
2023-10-16 14:33:47 +01:00
Daan De Meyer
d6e5f170ef Add --json switch to udevadm info
This allows getting the udevadm info --export-db and query "all" output
as JSON.
2023-10-16 13:01:54 +02:00
Nick Rosbrook
cfc015f09e man: document CoredumpReceive= setting 2023-10-13 15:28:50 -04:00
Nick Rosbrook
a90f80c7e7 man: move NFTSec= entry to "Network Accouting and Control" section
Currently it is in the "Memory Pressure and Control" section, which does
not seem accurate.
2023-10-13 15:28:50 -04:00
Luca Boccassi
5986e3f4db
Merge pull request #29502 from keszybz/sd-boot-config-tweaks
Tweaks to sd-boot UX
2023-10-12 23:08:56 +01:00
Reto Schneider
b1b16aa977 man/systemd.exec: Update service result table
exec-condition and oom-kill were added without updating this table.
2023-10-12 12:30:21 +02:00
Zbigniew Jędrzejewski-Szmek
6ad3dc409b man: use consistent label for "Reboot Into Firmware Interface"
That is what sd-boot actually displays.
2023-10-12 12:13:56 +02:00
Lennart Poettering
9ff6876555
Merge pull request #29523 from keszybz/kernel-install-dtb-files
Do not look for dtb files in /boot, add support in 60-ukify.install
2023-10-12 10:43:24 +02:00
Zbigniew Jędrzejewski-Szmek
7a9d86bceb man/kernel-install: fix formatting and document /etc/kernel/devicetree
Each filename should be a separate <term>, so that they separated in the
formatted text. Also, we list files in documentation in priority order, but
here they were in reverse order. Also, rework the description of
$KERNEL_INSTALL_CONF_ROOT to say that it makes kernel-install not look at the
other files. This requires some more words, so make this a separate paragraph
and refer from individual items to it. Also, drop some sentences with "Read by
...", they were already outdated.

Partial fix for #28771.

Co-authored-by: Emil Renner Berthing <systemd@esmil.dk>
2023-10-11 17:34:43 +02:00
Yu Watanabe
fc35a9f8d1 network/dhcp4: support IPv6 only mode (RFC 8925)
Co-authored-by: Susant Sahani <ssahani@gmail.com>
2023-10-11 21:42:13 +09:00
Susant Sahani
34bea0a1e9 network/dhcp-server: allow to configure IPv6 only preferred option
Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2023-10-11 21:42:13 +09:00
Lennart Poettering
98d8c37595
Merge pull request #29427 from ddstreet/cryptenroll_specify_handle_index
Cryptenroll specify handle index
2023-10-11 10:47:01 +02:00
Roland Hieber
7c6dd20046 sd-gpt: add defines for big-endian MIPS/MIPS64
According to the respective change in the DPS:
<https://github.com/uapi-group/specifications/pull/86>

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
2023-10-11 10:10:49 +02:00
Laszlo Gombos
63947fede8 man: fix example for systemd.swap-extra 2023-10-10 21:44:45 +02:00
Mike Yuan
3759a17418 man/systemd.exec: document behavior of SetLoginEnvironment= when unset
Follow-up for 854eca4a95

Addresses https://github.com/systemd/systemd/pull/29493#discussion_r1351980046
2023-10-10 12:08:32 +01:00
Dan Streetman
382bfd90c3 cryptenroll: allow specifying handle index of key to use for sealing
This defaults to the SRK index.
2023-10-10 05:40:27 -04:00
Lennart Poettering
b5ac77e9a5
Merge pull request #29493 from YHNdnzj/unit-always-set-user-home
core/execute: always set $USER and introduce SetLoginEnvironment=
2023-10-10 10:16:07 +02:00
Luca Boccassi
68f85761e2 stub: add support for dtb addons
Same as kernel command line addons.
2023-10-09 22:22:09 +01:00
Mike Yuan
854eca4a95
core/execute: always set $USER and introduce SetLoginEnvironment=
Before this commit, $USER, $HOME, $LOGNAME and $SHELL are only
set when User= is set for the unit. For system service, this
results in different behaviors depending on whether User=root is set.

$USER always makes sense on its own, so let's set it unconditionally.
Ideally $HOME should be set too, but it causes trouble when e.g. getty
passes '-p' to login(1), which then doesn't override $HOME. $LOGNAME and
$SHELL are more like "login environments", and are generally not
suitable for system services. Therefore, a new option SetLoginEnvironment=
is also added to control the latter three variables.

Fixes #23438

Replaces #8227
2023-10-10 00:00:26 +08:00