1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00
Commit Graph

7420 Commits

Author SHA1 Message Date
Yu Watanabe
5b23987eaf
Merge pull request #26739 from ldv-alt/udevadm-verify
udevadm verify: introduce --root option
2023-03-11 17:12:57 +09:00
Morten Linderud
9e60dc0daf
man: Fix pcrphase.service manvolnum from 1 to 8 2023-03-10 20:29:56 +01:00
Dmitry V. Levin
0a7eda348c udevadm verify: introduce --root option
When udevadm verify is invoked without positional arguments and loads
all rules files from the system like the udev daemon does, this option
can be used to operate on files underneath the specified root path.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin
e8c53080c4 udevadm verify: load all rules from the system if no rules were given
When udevadm verify is invoked without positional arguments, that is,
when no udev rules files are specified, load all rules files from the system
like the udev daemon does, and verify them.
2023-03-10 17:10:41 +00:00
Lennart Poettering
862481ece0
Merge pull request #26693 from poettering/udev-loop-links
udev: add /dev/loop/by-inode/… + /dev/loop/by-ref/… loopback block device symlinks
2023-03-10 09:34:31 +01:00
Ronan Pigott
0b40688d18 load-fragment: add user credential specifiers to user.conf
This enables the ManagerEnvironment= settings in the user's user.conf to
reference some user data like $HOME for the purpose of setting
environment variables derived from these values.
2023-03-10 00:05:37 +00:00
Lennart Poettering
a617007417 mempress: change default PSI window duration to 2s
This changes the PSI window duration we default to for watching memory
pressure events from 1s to 2s. This is because apparently the kernel
will soon disallow window durations other than 2s for unprivileged
processes.

Hence, we'll bump the threshold from 100m to 200ms, and the window from
1s to 2s.
2023-03-09 22:31:20 +01:00
Lennart Poettering
236d1fa210 dissect: allow setting "lo_file_name" field of loopback block devices
When attaching a loopback file this allows us to set an explicit name
for it. This is useful since it allows a caller to pre-select a string
that is directly attached to the loopback file. Via udev rules we'l
later make the device accessible through this name.

Note that "lo_file_name" is supposed to carry a file name of the backing
file, but the kernel actually does not care or enforce any of that, it
just stores the filename and returns it later. This makes it so useful,
as userspace has total control of that field.

"lo_file_name" should not be confused with the sysattr
"loop/backing_file" which is actually maintained by the kernel itself,
and always shows the file to the backing inode without userspace having
direct control over the returned string. Because the sysattr is
generated by the kernel it is subject to file system namespacing and
everything, while "lo_file_name" is not, it's really just a string
passed through the kernel.
2023-03-09 16:41:23 +01:00
Lennart Poettering
07d6072e0e dissect: add commands for attaching/detaching loopback devices
Sometimes it is useful attaching DDIs without mounting them. We could
use "losetup" for that, but doing this in systemd-dissect has various
benefits:

1. we superficially validate the DDI first
2. we set the sector size depending on what we determine
3. we synchronously create the per-partition block devices
2023-03-09 16:40:55 +01:00
Jeidnx
2208d96623 man: fix typo in ukify page 2023-03-09 14:49:37 +01:00
Zbigniew Jędrzejewski-Szmek
ba0e70673c
Merge pull request #26038 from lilyinstarlight/fix/fstab-generator-sysroot-without-cmdline
fstab-generator: use correct targets when /sysroot is specificied in fstab only
2023-03-09 08:51:31 +01:00
Yu Watanabe
00aba43fe6
Merge pull request #26698 from ldv-alt/udevadm-verify
Implement a udev rules syntax checker in the form of
`udevadm verify [OPTIONS] FILE...` command that is based on
`udev_rules_parse_file` interface and would apply further checks
on top of it in the future.

Resolves: #26606
2023-03-09 13:05:57 +09:00
Luca Boccassi
25a45b0dd1
Merge pull request #26119 from kraxel/uki.install
kernel-install: improve uki handling
2023-03-08 21:25:25 +00:00
Luca Boccassi
79fb1d4e7e
Merge pull request #26711 from keszybz/man-page-stuff
Man page tweaks
2023-03-08 20:29:18 +00:00
Dmitry V. Levin
acdba85e0e udevadm: introduce new 'verify' command
We seem to have no tool to verify udev rule files.  There is a simple
udev rules syntax checker in the tree, test/rule-syntax-check.py, but
it is too simple to detect less trivial issues not detected by udev,
e.g. redundant comparisons (#26593) or labels without references.

Such a tool would be beneficial not only for maintaining udev rules
distributed along with udev, but also and even more so for maintaining
third party udev rules that are more likely to have issues with syntax
and semantic correctness.

Implement a udev rules syntax and semantics checker in the form of
'udevadm verify [OPTIONS] FILE...' command that is based on
udev_rules_parse_file() interface and would apply further checks
on top of it in subsequent commits.

Resolves: #26606
2023-03-08 18:55:40 +00:00
Yu Watanabe
0744ed0f26
Merge pull request #26713 from keszybz/man-getenv
Add note to docs that setenv() cannot be called in parallel with getenv()
2023-03-09 00:16:30 +09:00
Zbigniew Jędrzejewski-Szmek
d329bae3e6 man: use more references 2023-03-08 15:32:59 +01:00
Zbigniew Jędrzejewski-Szmek
8c51e1520b man: add mention that libsystemd uses getenv()
See #26688: getenv() is not thread-safe, and could a possible source of
problems when a multi-threaded program calls setenv()/putenv()/unsetenv() in
parallel. It is not possible to avoid getenv() calls in general, since $PATH,
$LANG, $SHELL, $USER, $HOME, $TZ may need to be accessed at any time.
Add a warning to our docs so that people are aware of the issue.

Closes #26688. (Real fixes will need to be in glibc and gnome-shell or other
programs.)

The text is added to threads-aware.xml to be included in various places. By
including it in libsystemd-pkgconfig.xml, it is automatically added to all sd-*
pages. The text is also included explicitly in pages for a few other functions
which are call getenv().
2023-03-08 15:32:59 +01:00
Zbigniew Jędrzejewski-Szmek
81707069fc
Merge pull request #26685 from yuwata/man-missing-services
man: mention two missing services
2023-03-08 09:35:03 +01:00
Luca Boccassi
e079120505
Merge pull request #26706 from jengelh/master
doc: various orthographic fixes
2023-03-07 21:34:03 +00:00
Zbigniew Jędrzejewski-Szmek
695e39dd63 man: adjust description of CPUAccounting=
For any user on a semi-recent kernel, effectively this setting is pointless.
We should deprecate it once not needed anymore for the v1 hierarchy. For
now, adjust the description.
2023-03-07 16:22:13 +01:00
Zbigniew Jędrzejewski-Szmek
dca031d229 man: add a note about session autogrouping
When cpu controller is disabled, thing would often still behave as if
it was. And since the cpu controller can be enabled "magically" e.g. by
starting user@1000, add a note for users to be careful. Autogrouping
is described well in the man page, incl. how to enable or disable it,
so it should be enough to refer to that.
2023-03-07 16:22:13 +01:00
Zbigniew Jędrzejewski-Szmek
396d298d6b man: tweak details in descriptions of pids and cpu configuration
For CPUWeight=: there is an important distinction between our default of
[not set], and the kernel default of "100". Let's not say that our default
is "100" because then 'systemctl show' output is hard to explain.

For task accounting, it's the kernel that does the accounting, not systemd.
2023-03-07 16:22:13 +01:00
Zbigniew Jędrzejewski-Szmek
253d0d591b man: describe how cgroup controllers are turned on
For a user, information which cgroup controllers are enabled based on
the unit configuration is rather important. Not only because it determines
what resource control is peformed by the kernel, but also because controllers
have a non-negligible cost, especially for deep nesting, and users may want
to *not* have controllers enabled.

Our documentation did its best to avoid the topic so far. This was partially
caused by the support for cgroup v1, which meant that any discussion of
controllers had to be conditional and messy. But v1 is deprecated on its way
out, so it should be fine to just describe what happens with v2.

The text is extended with a discussion of how controllers are enabled and
disabled, and an example, and for various settings that enable controllers
the relevant controller is now mentioned.
2023-03-07 16:22:13 +01:00
Zbigniew Jędrzejewski-Szmek
87291a26f5 man: explain route-only domains a bit more
The details discussion of how search and route-only domains work is in
systemd-resolved.service(8). But users are more likely to look at
resolved.conf(5), because that's where Domains= is described. So let's add a
reference to the other man page there, and also strengthen the text a bit. In
particular, in systemd-resolved.service(8) we say "route-only", which makes
the distinction with search domains clearer. Let's use the same in the other
man page too.

This is based on feedback from Lukáš Nykrýn that the man page is not clear
enough.
2023-03-07 16:22:13 +01:00
Jan Engelhardt
18fe76eba5 doc: correct wrong use "'s" contractions 2023-03-07 13:39:31 +01:00
Gerd Hoffmann
3d5f0bfe4e kernel-install: handle uki installs automatically
Detect image type using "bootctl kernel-identify $kernel",
store result in KERNEL_INSTALL_IMAGE_TYPE.

Extend layout autodetection to check the kernel image type
and pick layout=uki for UKIs.

Resolves: #25822
2023-03-07 08:14:46 +01:00
Gerd Hoffmann
642617f431 kernel-install: remove math slang from man page 2023-03-07 08:14:46 +01:00
Lennart Poettering
92828ba603 man: document /sbin/mount.ddi 2023-03-06 23:00:52 +01:00
Josef Miegl
417283c5c3 network: geneve: add InheritInnerProtocol flag 2023-03-06 20:58:30 +00:00
Yu Watanabe
25e12db5e4
Merge pull request #26650 from yuwata/udev-trigger
test: generate debugging logs for udevd after restart
2023-03-06 16:36:34 +09:00
Yu Watanabe
61ccf030ae man: mention systemd-growfs-root.service 2023-03-06 07:15:29 +09:00
Yu Watanabe
5e97505335 man: mention systemd-fsck-usr.service 2023-03-06 07:15:12 +09:00
Zbigniew Jędrzejewski-Szmek
cfba58fe79
Merge pull request #26651 from yuwata/meson-cleanups
Several meson cleanups
2023-03-05 13:38:55 +01:00
Yu Watanabe
181d719542 man: add an example to (re-)apply new settings to a network interface
Closes #26601.
2023-03-04 20:07:56 +09:00
Yu Watanabe
9b7f499ff1 man: sync the default .link file in example 2023-03-04 14:35:01 +09:00
Yu Watanabe
ff0a9199d4 man: fix doubled word 2023-03-03 23:13:23 +09:00
наб
f8b7ff8493
man: fix typo (#26655) 2023-03-03 23:01:51 +09:00
Yu Watanabe
d2ec38e2b2 meson: rename conflicting target names
The update-man-rules and update-dbus-docs targets are both declared in the
main meson.build and man/meson.build, so we cannot build the target with
'meson compile' command:
====
$ meson compile update-man-rules
INFO: autodetecting backend as ninja

ERROR: Can't invoke target `update-man-rules`: ambiguous name.Add target type and/or path:
- ./man/update-man-rules:custom
- ./update-man-rules:run
====
Let's rename the targets declared in man/meson.build.
2023-03-03 19:56:38 +09:00
Yu Watanabe
11fa81bf77 meson: add missing man rules for new sd-login functions
Follow-up for d71f5b1217,
c4ef14dc2a, and
d622fefc00.
2023-03-03 14:38:13 +09:00
Lennart Poettering
a4b13ae1be doc: add document explaining memory pressure handling 2023-03-01 09:43:24 +01:00
Lennart Poettering
6bb0084204 pid1: add unit file settings to control memory pressure logic 2023-03-01 09:43:23 +01:00
Lennart Poettering
bf1b9ae487 pam_systemd: process the two new capabilities user records fields in pam_systemd
And also: by default, for the systemd-user service and for local
sessions (i.e. those assigned to a seat): let's imply CAP_WAKE_SYSTEM
for them by default. Yes, let's pass one specific capability by default to local
unprivileged users.

The capability services exactly once purpose: to allow system wake-up
from suspend via alarm clocks, hence is relatively limited in focus. By
adding this tools such as GNOME's Alarm Clock app can simply allocate a
CLOCK_REALTIME_ALARM (or ask systemd --user to do this) timer and it
will wake up the system as necessary.

Note that systemd --user will not pass the ambient caps on by default,
so even with this change, individual services need to use
AmbientCapabilities= to pass this on to the individual programs.

Fixes: #17564 #21382
2023-02-28 21:42:29 +01:00
Lennart Poettering
fada2c75a4 homectl: make the new caps field configurable via homectl 2023-02-28 21:42:29 +01:00
Antonio Alvarez Feijoo
835b781fc1 man: fix typo in systemd.generator 2023-02-28 15:37:29 +00:00
Yu Watanabe
e6faa55878
Merge pull request #26578 from thkukuk/main
sd-login: add sd_uid_get_login_time interface #26574
2023-02-26 07:54:11 +09:00
Thorsten Kukuk
634c64a517 sd-login: document that result is in microseconds 2023-02-25 16:14:11 +01:00
Thorsten Kukuk
d622fefc00 sd-login: add sd_uid_get_login_time interface #26574 2023-02-25 16:14:11 +01:00
Lennart Poettering
aff131775b man: add two missing commands to synopsys 2023-02-24 17:11:57 +01:00
Lennart Poettering
0a75dca1cc
Merge pull request #26579 from poettering/manager-env-clean-up
service manager env var clean-up fixes
2023-02-24 14:11:57 +01:00