1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00
Commit Graph

60424 Commits

Author SHA1 Message Date
Daan De Meyer
3388a4b582 test-journal-flush: Don't fail on EADDRNOTAVAIL
File corruption can cause EADDRNOTAVAIL errors. Let's not make these
fatal for the flush test.
2022-10-11 23:03:06 +09:00
Daan De Meyer
9377e53f4f meson: Fix pcrphase unit conditions 2022-10-11 15:29:08 +02:00
Daan De Meyer
88ee6a9e4b logs-show: Always retrieve the boot ID from the entry
If _SOURCE_MONOTONIC_TIMESTAMP was set in the entry, we wouldn't
query the boot ID, leading to every kernel entry in the export mode
to have BOOT_ID=000000000000000. Let's fix this by always querying
the boot ID.
2022-10-11 15:25:12 +02:00
Lennart Poettering
a5a0da085a update TODO 2022-10-11 15:07:32 +02:00
Daan De Meyer
beead603c5
Merge pull request #24629 from DaanDeMeyer/mkosi-kernel
mkosi: Optionally build a kernel image from mkosi.kernel/
2022-10-11 14:37:19 +02:00
Frantisek Sumsal
6788418af1 test: add coverage for the nvme-subsystem
Specifically for:
  - https://github.com/systemd/systemd/pull/24748
  - https://github.com/systemd/systemd/pull/24766
  - https://github.com/systemd/systemd/pull/24946
2022-10-11 13:38:30 +02:00
Yu Watanabe
abb977a61a sd-radv: mention that failures in sending RA are ignored 2022-10-11 16:22:35 +09:00
Yu Watanabe
852bf93826 sd-ndisc: ignore failure in sending solicitation
Even if a bonding master interface has carrier, the underlying slave
interfaces may not. In such a case, sending solicitation fails with
-ENOBUS. Here, let's unconditionally ignore errors, as anyway we will
send a solicitation later.

Fixes #24717.
2022-10-11 16:19:16 +09:00
Yu Watanabe
f4a4493eb5 udev: add one more assertion
Follow-up for 6209bbbd4b.
2022-10-11 00:17:20 +02:00
Richard Phibel
a5b4550213 coredumpctl: Add support for the --root option (after merge fixes) 2022-10-10 21:21:52 +02:00
Lennart Poettering
00675c363f tree-wide: add ERRNO_IS_XATTR_ABSENT() helper
We check the same list of error codes on various xattr operations, and
we should on some more. Add a common helper for this purpose.
2022-10-10 16:00:15 +02:00
Luca Boccassi
dcf1bf3b6d mkosi: update to latest commit
Require dto fix Debian testing/unstable builds, as the initrd is
versioned
2022-10-10 13:19:41 +02:00
Lennart Poettering
4db5c45df8 NEWS: make clear we talk about *system* credentials here
The new conditoins are placed inside of services, but they cannot be
used to test service creds, but only system creds. This deserves
explicit mention, since it might be confusing otherwise.

Reverts a small part of 02380e1946
2022-10-10 20:00:43 +09:00
Yu Watanabe
2164ccdaa2
Merge pull request #24654 from fbuihuu/mount_followup_for_pr_19983
Mount followup for pr 23367
2022-10-10 19:13:22 +09:00
Daan De Meyer
32b61b0559
Merge pull request #24595 from rphibel/support-image-option-in-systemctl-and-coredumpctl
systemctl/coredumpctl: add support for --root and --image options
2022-10-10 11:35:20 +02:00
Yu Watanabe
6209bbbd4b udev: drop assertion which is always false
Fixes a bug introduced by 67c3e1f63a.

Fixes #24945.
2022-10-10 10:26:38 +02:00
Zbigniew Jędrzejewski-Szmek
b1eff892bb shared/pam-util: add pam_syslog_errno() wrapper that sets errno
So far our pam code was using strerror_safe(). But that's not a good approach,
because strerror_safe() is not thread-safe, and the pam code is "library code"
that should be thread-safe. In fact, the whole effort to use strerror() is
unnecessary, because pam_syslog() is documented to support %m. The
implementation in linux-pam simply uses vasprintf(). If we use %m too, we get
rid of the issue. The wrapper sets errno temporarily from the argument.

Apparently some PAM consumers run multiple PAM stacks in threads, so we should
avoid non-thread-safe code.

The new helper returns PAM_BUF_ERR for ENOMEM, and PAM_SERVICE_ERR in other
cases. This may change the returned code in some cases, but I think a) it
doesn't matter much, b) it's probably for the better. E.g. we might now return
PAM_SERVICE_ERR if the dbus message is borked, and PAM_SERVICE_ERR seems
appropriate.
2022-10-10 09:55:21 +02:00
Zbigniew Jędrzejewski-Szmek
50c5b991df basic/errno-util: add helper to protect and set errno in one step
This pattern is used in a few places. Those are changed in this patch.
Subsequent patches will add more.
2022-10-10 09:12:21 +02:00
Jan Janssen
7aa4762ce2 meson: Fix build with --optimization=plain
Note that -O0 is deliberately filtered out as we have to compile with at
least -O1 due to #24202.

Fixes: #24323
2022-10-09 22:15:11 +02:00
Zbigniew Jędrzejewski-Szmek
02380e1946 NEWS: fix typos and reword things
In particular, 'system/service credentials' are now described as simply
'credentials'. The selling point of credentials is that they are transparently
propagated from the system to services, so distinguishing between system and
service credentials is not important.

The description of ordering against initrd-switch-root.target is completely
rewritten. The old description was confused.

I think the description of systemd-measure should be reworked to clearly
describe what new functionality is provided and what policy changes are
built on top. But I don't qrok the details, so I left this part unchanged.
2022-10-09 17:28:53 +02:00
Zbigniew Jędrzejewski-Szmek
01f516314f man: use a list for description of ConditionFirmware=
Also reduce confusion of <replaceable> and <literal> and reword things for
legibility a bit.
2022-10-09 17:28:53 +02:00
Yu Watanabe
ae24e4e80e TODO: fix typo 2022-10-08 15:09:53 +09:00
Yu Watanabe
766c1eae8e NEWS: fix typo 2022-10-08 15:09:47 +09:00
Yu Watanabe
4a874ecea5 NEWS: drop reverted feature for networkd 2022-10-08 15:09:33 +09:00
Daan De Meyer
46fb302f72 Revert "journal: Add --convert= command to journalctl"
This reverts commit 721620e8a3.

This commit was accidentally merged as part of #22998
2022-10-08 03:24:25 +09:00
Zbigniew Jędrzejewski-Szmek
b75bc18887 fuzz: shorten name of fuzz test case
Wide fuzzer case names make meson test output very wide…
2022-10-08 03:24:01 +09:00
Lennart Poettering
a0769ee489 update NEWS for v250-rc1 2022-10-07 18:11:04 +02:00
anarcat
9aafd310cc man/shutdown: document how to switch to single-user mode
Before Debian switched to systemd, `shutdown now` would reset the system into
single user mode, doing roughly the equivalent of `telinit 1`.

Now, systemd's `shutdown` command does not behave that way; it defaults to
`poweroff` which might be confusing for users (like me) used to the previous
method.

Because I don't use the command often, I keep being stumped by this behavior,
and every time I look at the `shutdown(1)` manpage, I don't understand why I
can't find what I am looking for. This patch should make sure that people like
me find their way back to some sort of reason.

Maybe the *proper* way to fix this would be to restore the more classic
behavior, but I'm definitely not going to climb that hill. Besides, I clearly
remember the time I found out about the `shutdown` command and was *really*
confused when it brought me back to a command-line prompt. That was really
counter-intuitive and I find that change to actually be a good thing. So I'm
not proposing to change this behavior, merely document it better.

I originally added this to the `-P` option but it was suggested adding a new
`COMPATIBILITY` section instead, where other such issues could be added.

The `COMPATIBILITY` section is not actually officially documented. `man(1)`
talks about a `CONFORMING TO` section, but `shutdown(1)` is not
POSIX (`shutdown(2)` is, of course), so there's no actual standard on how this
should work.

The other option I considered was to add a `BUGS` section, but that seemed to
inflammatory, and definitely counter-productive.
2022-10-07 17:54:31 +02:00
Luca Boccassi
7dbbb3933d Finalize changelog for v252-rc2 2022-10-07 17:09:32 +02:00
Luca Boccassi
5791594a0f meson: bump numbers for v252-rc1 2022-10-07 16:37:36 +02:00
Luca Boccassi
47819da972 Enable PR template for RC phase 2022-10-07 16:37:36 +02:00
Aidan Dang
fd83c98e8a Implement --luks-sector-size for homed 2022-10-07 16:36:04 +02:00
Zbigniew Jędrzejewski-Szmek
6b7834fe5d basic/log: include the log syntax callback in the errno protection block
In general, log_syntax_internal() must keep errno unchanged. But the
call to log_syntax_callback() was added outside of the block protected
by PROTECT_ERRNO.
2022-10-07 16:25:56 +02:00
Zbigniew Jędrzejewski-Szmek
2b9e905540 pam_systemd_home: inline loop variable declaration 2022-10-07 16:25:56 +02:00
Zbigniew Jędrzejewski-Szmek
b0fcb7c045 sd-bus: decrease indentation 2022-10-07 16:24:45 +02:00
Luca Boccassi
b25e08a752
Merge pull request #22998 from DaanDeMeyer/journal-compact-split
journal: Add compact mode
2022-10-07 16:19:03 +02:00
Daan De Meyer
721620e8a3 journal: Add --convert= command to journalctl
--convert writes the journal files read by journalctl to the given
location. The location should be specified as a full journal file
path (e.g. /a/b/c/converted.journal). The directory specifies where
the converted journal files will be stored. The filename specifies
the naming convention the converted journal files will follow.
2022-10-07 12:28:09 +02:00
Daan De Meyer
e81710d3d0 journal: Store offsets to tail entry array objects in chain
Previously, we'd iterate an entry array from start to end every time
we added an entry offset to it. To speed up this operation, we cache
the last entry array in the chain and how many items it contains.
This allows the addition of an entry to the chain to be done in
constant time instead of linear time as we don't have to iterate
the entire chain anymore every time we add an entry.
2022-10-07 12:28:09 +02:00
Daan De Meyer
0e35afff1d journal: Introduce journal_file_data_payload()
journal_file_data_payload() retrieves the payload of a Data object,
optionally decompressing it and checking to see if matches a given
field. This function replaces all the decompression code in the sd-journal
codebase with a single function.

This commit should not introduce any changes in sd-journal behavior.
2022-10-07 12:28:05 +02:00
Daan De Meyer
a9089a6604 journal: Use 32-bit entry item object offsets in compact mode
To do this, we move EntryItem out of journal-def.h and turn it into
a host only struct in native endian mode so we can still use it to
ship the necessary info around.

Aside from that, the changes are pretty simple, we introduce some
extra functions to access the right field depending on the mode and
convert all the other code to use those functions instead of
accessing the raw fields.

We also drop the unused entry item hash field in compact mode. We
already stopped doing anything with this field a while ago, now we
actually drop it from the format in compact mode.
2022-10-07 12:20:57 +02:00
Daan De Meyer
99daf3ce03 journal: Use 32-bit entry array offsets in compact mode
Before:

OBJECT TYPE      ENTRIES SIZE
Unused           0       0B
Data             3610336 595.7M
Field            5310    285.2K
Entry            3498326 1.2G
Data Hash Table  29	 103.1M
Field Hash Table 29      151.3K
Entry Array      605991  1011.6M
Tag              0	 0B
Total            7720021 2.9G

After:

OBJECT TYPE      ENTRIES SIZE
Unused           0	 0B
Data             3562667 591.0M
Field            3971    213.6K
Entry            3498566 1.2G
Data Hash Table  20	 71.1M
Field Hash Table 20	 104.3K
Entry Array	 582647  505.0M
Tag              0	 0B
Total            7647891 2.4G
2022-10-07 12:20:08 +02:00
Daan De Meyer
d06727aec2 journal: Don't allocate objects above UINT32_MAX in compact mode
To allow storing offsets as 32-bit, we should never allocate objects
outside of the 32-bit range.
2022-10-07 12:20:08 +02:00
Daan De Meyer
c92f1ebe5d journal: Run unit tests with and without compact mode enabled 2022-10-07 12:16:11 +02:00
Yu Watanabe
02dfb6a3c9
Merge pull request #24930 from yuwata/network-drop-ndisc-vacuum
network: further follow-ups for recent NDisc PRs
2022-10-07 18:38:34 +09:00
Yu Watanabe
261979ed85
Merge pull request #24931 from bluca/news
hwdb and NEWS
2022-10-07 18:38:18 +09:00
Daan De Meyer
61297656c7 journal: Enable compact mode
We also add an environment variable $SYSTEMD_JOURNAL_COMPACT that
can be used to disable compact mode if needed (similar to
$SYSTEMD_JOURNAL_KEYED_HASH).
2022-10-07 11:28:12 +02:00
Daan De Meyer
87413812c9 journal: Add compact mode
This adds a new flag in preparation for incompatible journal changes
which will be gated behind this flag. The max file size of journal
files in compact mode is limited to 4 GiB.
2022-10-07 11:26:28 +02:00
Luca Boccassi
42c25d70f6 Update hwdb
ninja -C build update-hwdb
2022-10-07 11:00:28 +02:00
Luca Boccassi
23992ce1e9 NEWS: list contributors 2022-10-07 11:00:27 +02:00
Luca Boccassi
167420a394 NEWS: typos 2022-10-07 11:00:27 +02:00