Commit Graph
62986 Commits
Author SHA1 Message Date
Mike Yuan 5d2ab010df journalctl: fix when --since, --until and --lines are used altogether
This is a follow-up for #26669 (81fb5375b3).

After the mentioned commit, we stopped checking if the
entry is within the range of --until if --lines is used.

However, when --since, --until and --lines=N are used
altogether, and the number of lines between --since
and --until is smaller than N, we would seek to --since
later (f582695107).
This breaks the assumption that if --lines is set,
the boundary is never exceeded because the counter of
outputs gets us covered.
2023-03-09 21:36:12 +09:00
Zbigniew Jędrzejewski-Szmek b2d3e2a0dc tests: merge test-tmpfiles.c into test-tmpfile-util.c
The former was added in 65b3903ff5,
but the name is confusing: the test has nothing to do with systemd-tmpfiles.
It had one function that mostly tested functions from tmpfile-util.c, so
just move it into the latter.
2023-03-09 21:35:53 +09: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 b9872fe1dd macro: support the case that the number of elements has const qualifier
Follow-up for 5716c27e1f.

Addresses https://github.com/systemd/systemd/pull/26303#issuecomment-1460712007.
2023-03-09 08:41:43 +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
Zbigniew Jędrzejewski-Szmek 080ecabfd7 localed: print a custom message if libxkbcommon.so is unvailable
Follow-up for 82c2095a5e.

> I feel like the logging here may be a bit confusing on the new path.
> Previously you did get a message that explained what was going on. Now you get
> an info message that the layout could not be compiled, and … that's all. I can
> imagine this being a confusing red herring if someone was trying to debug a
> problem and saw this message. Perhaps we should log something else instead/as
> well, on the case where libxkbcommon isn't present, to say that's what we're
> logging about and it just means we can't validate the configuration, not that
> it's definitely invalid?
2023-03-09 11:16:13 +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 2ca6f09b30 Merge pull request #26656 from yuwata/mkdir-error-code
mkdir: fix error code
2023-03-08 21:23:07 +00:00
Dmitry V. Levin ba1ca5ef26 CODING_STYLE: note that 'unsigned' form is preferred over 'unsigned int' 2023-03-08 21:17:23 +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 b27e5e2aca udev_rules_parse_file: issue diagnostics about line continuation at EOF
When udev rules file ends with a line continuation, the parser
used to silently ignore the line without any diagnostics at all.
It's time to break the vow of silence and let the parser issue some
error diagnostics.
2023-03-08 18:55:40 +00:00
Luca Boccassi 82c63b0731 Merge pull request #26716 from mrc0mmand/more-tests
test: add a couple of tests for systemd-escape and systemd-id128
2023-03-08 18:55:40 +00:00
Dmitry V. Levin 5040401b43 test: check udevadm verify diagnostics of unused labels 2023-03-08 18:55:40 +00:00
Dmitry V. Levin 7a771d1da6 udevadm-verify: check for unused labels
Check for unused labels in the specified udev rules files, report such
labels and exit with a non-zero exit code if any unused labels are
found.
2023-03-08 18:55:40 +00:00
Dmitry V. Levin 45183cdd6d test: add a test for udevadm verify 2023-03-08 18:55:40 +00:00
Dmitry V. Levin 9382642c40 meson.build: check udev rules using udevadm verify
Although udev rules are already being checked by rule-syntax-check.py
script, also check them using udevadm verify which performs more
thorough checks.
2023-03-08 18:55:40 +00:00
Dmitry V. Levin f94e9529fe rules: do not use blkid builtin if built without blkid support
When built without blkid, then udev-builtin-blkid is not built,
and the verifier warns about the unknown builtin:

60-persistent-storage.rules:114 Unknown builtin command: blkid --hint=session_offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}
60-persistent-storage.rules:117 Unknown builtin command: blkid --noraid
60-persistent-storage.rules:120 Unknown builtin command: blkid
60-persistent-storage.rules: udev rules check failed
2023-03-08 18:55:40 +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
Dmitry V. Levin 4f5de15731 udev_rules_parse_file: mark logged issues
Traditionally, all issues found in udev rules by udev_rules_parse_file()
are logged and ignored, so there was no mechanism to propagate the
information about these issues back to the caller.

Introduce such a mechanism by adding a new member to UdevRuleFile.
This new member is a bitmask describing which log levels were used
in messages logged with regards to the rule file.

This mechanism is going to be used by udevadm verify in subsequent
commits.
2023-03-08 18:55:40 +00:00
Zbigniew Jędrzejewski-Szmek ad078f59fa Merge pull request #26678 from yuwata/foreach_array
macro: introduce FOREACH_ARRAY() macro
2023-03-08 19:06:20 +01:00
Luca Boccassi af2fb2f250 core: log message when reloading finishes
Reloading might be slow, especially when under memory pressure, and watchdogs
might be triggered. It is useful to have timestamped telemetry in the journal
to see how long a reload takes.
2023-03-08 18:41:07 +01:00
Frantisek Sumsal bb076d77f4 test: add a couple of tests for systemd-id128 2023-03-08 16:28:37 +01:00
Frantisek Sumsal c38cad7aea test: add a couple of tests for systemd-escape 2023-03-08 16:28:37 +01:00
Frantisek Sumsal 8fc58b35ea random-seed: drop extraneous "we" 2023-03-08 16:28:37 +01: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
Chitoku 0f9c8d0291 timesync: stop re-sync on network configuration change when no link servers are configured (#26708)
This commit fixes an issue where systemd-timesyncd re-synchronizes the
system clock every time the network configuration is updated, no matter
whether link servers are actually changed.

Fixes a bug introduced by e05dd7718d.
2023-03-08 19:52:55 +09:00
Zbigniew Jędrzejewski-Szmek 82c2095a5e localed: skip verification when libxkbcommon is not installed
When compliled without libxkbcommon, we do no verification and accept the
arguments as given. When compliled against with, if dlopen() works, we do the
verification. But if dlopen() fails, we would refuse the call and return
SD_BUS_ERROR_INVALID_ARGS. 5de344704d added things
this way when converting to dlopen(), but it seems not very useful: it can be
expected that when the library is supported but missing at runtime, we degrade
softly, and that the behaviour is something inbetween the cases of hard disable
at compilation time and full support. But right now we behave more strictly then
if disabled at compilation. Change the code to just warn if dlopen fails, but
accept the arguments.

(There are various minimization scenarios where forcing the installation of
libxkbcommon is not useful. E.g. a small installation where we want to set the
keymap via logind, but the configuration is managed by a configuration
management system and is known to be valid. Verification via libxkbcommon is
just overhead in this case.)

800f65f827 moved the check earlier, so now even
a noop case of setting the values that were already in place can fail.
C.f. https://bugzilla.redhat.com/show_bug.cgi?id=2175244.
2023-03-08 19:44:12 +09: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
Frantisek Sumsal 16600a8661 test: add a couple of tests for busctl 2023-03-08 12:53:44 +09:00
Luca Boccassi e079120505 Merge pull request #26706 from jengelh/master
doc: various orthographic fixes
2023-03-07 21:34:03 +00:00
Luca Boccassi ce0cac4c8e Merge pull request #26695 from poettering/dissect-mount-helper
make "systemd-dissect --mount" available as /sbin/mount.ddi
2023-03-07 20:07:17 +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
Daan De Meyer 1a87882635 Merge pull request #26709 from DaanDeMeyer/mkosi-drop-debug
mkosi: Various cleanups
2023-03-07 15:49:06 +01:00
Daan De Meyer 2f88bb9aee mkosi: Fix locations of mkosi-check-and-shutdown files 2023-03-07 15:25:19 +01:00
Daan De Meyer 925bb83ea5 mkosi: Drop debug logging
The spurious "connection timed out" errors from nspawn should be
fixed now that we're running the latest version.
2023-03-07 15:25:19 +01:00
Daan De Meyer 8d29e401ce mkosi: Drop kernel command line masking in CI
These services should be disabled by default and not need explicit
masking anymore.
2023-03-07 15:25:19 +01:00
Daan De Meyer 523d71076d mkosi: Update to latest
So that we don't enable services by default anymore on Debian.
2023-03-07 15:25:02 +01:00
Jan Engelhardt 18fe76eba5 doc: correct wrong use "'s" contractions 2023-03-07 13:39:31 +01:00
Jan Engelhardt e6faa51a84 doc: replace wrong idiom in homed comment 2023-03-07 13:06:43 +01:00
Jan Engelhardt 3ff1721c21 doc: replace wrong á preposition by à 2023-03-07 13:06:43 +01:00
Luca Boccassi 0531ac585a Merge pull request #26648 from bluca/kernel_install_guid
kernel-install: also try to find $BOOT by partition GUID
2023-03-07 11:26:12 +00:00
Yu Watanabe 9d0d39ee53 conf-files: fix potential memleak in conf_files_list_strv_internal() on failure
This also changes the used hash_ops from path_hash_ops to
string_hash_ops, as the key is not a path, but a filename.
2023-03-07 18:43:34 +09: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