1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-31 05:47:30 +03:00

67229 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
aea3f594db various: use id128_from_string_not_null()
No functional change. In config_parse_address_generation_type() we would set
the output parameter and then say it's ignored, so it _looked_ like an error in
the code, but the variable was always initialized to SD_ID128_NULL anyway, so
the code was actually fine.
2023-09-02 14:16:25 +03:00
Mike Yuan
4da159bc53
core,systemctl: refuse switching root if we're not in initrd 2023-09-02 15:56:24 +08:00
Mike Yuan
b0c5f0e1f4
core,systemctl: refuse switching root to current root properly
Fixes #28970
2023-09-02 15:56:24 +08:00
Yu Watanabe
2b4fca55d0 Revert "network: ndisc - drop routes of lifetime 0"
This reverts commit 4ccd48cb2693a3603f14a30b6286228597285d92.

From RFC 4861 section 4.2.
> The Router Lifetime applies only to the router's usefulness as a default
> router; it does not apply to information contained in other message fields
> or options.  Options that need time limits for their information include
> their own lifetime fields.

Hence, based on the lifetime field of the message header, we should not
drop any other information.
Note that, in ndisc_router_process_default(), we have already dropp the
default gateway when the lifetime is zero. Hence, we can safely drop the
change.
2023-09-02 14:34:56 +09:00
Christian Hergert
b63beb4d28 oomd: avoid unnecessary wake-ups for ManagedOOMSwap
If there are no "ManagedOOMSwap" entries to monitor, then the event source
can be completely disabled. This scenario appears to be common and avoiding
the wake-ups can save idle energy consumption.

This was discovered while using Sysprof for various GNOME 45 performance
tuning. systemd-oomd goes from waking up a few times a second to no
wake-ups helping keep a laptop in deep(er) sleep.

Signed-off-by: Christian Hergert <chergert@redhat.com>
2023-09-02 02:25:58 +01:00
pelaufer
4502f82beb Adding client_set_state to sd-dhcp-client.c to support a client state change hook 2023-09-01 12:34:13 -06:00
OMOJOLA JOSHUA
ad5db9404e Journal: Add message IDs for emergency-level log messages 2023-09-01 13:59:21 +01:00
msizanoen
904b8bb5a8 sd-login: Fix sd_pidfd_* function signature parameter types
The type of a file descriptor is `int`, not `pid_t`. This should not
have any effects on API consumers as `pid_t` is already typedef'd as
`int` on all glibc-based systems.
2023-09-01 13:29:47 +01:00
Yu Watanabe
c97f268f29 man: mention version info for NFTSet= setting
Follow-up for fc289dd0ad4c223c0fa02dc7e91f7244143fa918.
2023-09-01 13:29:27 +01:00
Yu Watanabe
1d4c874d3c
Merge pull request #24570 from topimiettinen/nft-sets-v2
network: firewall integration with NFT sets
2023-09-01 20:13:39 +09:00
Lennart Poettering
c27465d72d glyph-util: bring glyphs into same order everywhere
The enum definition, the two string tables and the test all were using
different orders (and in case of the test even missed entries).

Let's unify this, and make sure we always use the same order. This
settles the confusion, and makes the order used for the unicode string
table the canonical one, adjusting the other lists to match it. And adds
the missing entries to the tets.
2023-08-31 14:39:49 +02:00
Lennart Poettering
359b5e7539
Merge pull request #29004 from poettering/measure-log
tpm2: whenever we measure, also write a tpm log record
2023-08-31 09:47:35 +02:00
Milton D. Miller II
c23b07df3a NEWS: Typo
Let's not encourage the lawyers.
2023-08-30 20:50:47 +01:00
Luca Boccassi
a699b1e7a9 busctl: do not print start/stop monitoring messages with --quiet/--json 2023-08-30 20:50:32 +01:00
msizanoen
addcecf6f4 journal: Relax boot ID and monotonic clock consistency checks
The monotonic clock value consistency should only be checked if the boot
ID is the same as the last journal entry, and requiring that the current
boot ID be the same as the boot ID of the last entry is not necessary
for ensuring deterministic bisection as we already enforce strict
ordering of the real time clock value in a single journal file.

This fixes an issue where a new journal file is unnecessarily created
every boot, potentially wasting storage space.
2023-08-30 20:17:18 +07:00
msizanoen
2f766aca1e journal: Don't write to journal files without the new boot ID update behavior guarantee
With the old boot ID update behavior there's no way to compare the boot
ID of a new entry to be written with the boot ID of the last entry in
the journal in a performant manner, and therefore no way to determine if
monotonic clock value consistency checking is needed. Refuse to open
journal files without the new boot ID update behavior guarantee to
simplify consistency checking.
2023-08-30 20:16:45 +07:00
Luca Boccassi
b0881b65a6 mkosi: pin CentOS9 kernel to working version
Newer kernels are affected by a regression that causes a kernel panic
on shutdown, so pin them for now. Can be reverted once that problem is
fixed.

https://bugzilla.redhat.com/show_bug.cgi?id=2234390
2023-08-30 14:11:11 +01:00
Lennart Poettering
a4e941ee1f test: add test for new measurement log 2023-08-30 13:08:17 +02:00
Lennart Poettering
cb19bdaebf tpm2: whenever we measure, also write a tpm log record
Previously we only logged our measurements to the journal. This is not a
great solution though, since regular logs are subject to rotation, which
is something we really cannot have for measurements (as it means we can
never reproduce the PCR values from the data). Hence, let's maintain an
explicit log.

Ideally, we'd just use the TCG Canonical Event Log format 1:1
(https://trustedcomputinggroup.org/resource/canonical-event-log-format/).
However it's not a perfect fit fo us, for various reasons. But let's
follow it (in its JSON incantation) as closely at it makes sense, so
that it can easily be converted to the full format by programs consuming
it.

Code comments explain where we deviate from the TCG CEL-JSON, and what
to do about it when reading the data.
2023-08-30 12:59:34 +02:00
Luca Boccassi
73ac9520ec
Merge pull request #29013 from yuwata/sd-dhcp-client-ensure-iaid-and-duid
sd-dhcp-client: set IAID and DUID earlier
2023-08-30 11:51:39 +01:00
Yu Watanabe
3b981f7428 Revert "test-dhcp-client: add temporary workaround for assertion failure"
This reverts commit 1686c884bfa846f8da87621e87870eb18dd8107c.

The issue should be fixed by the previous commit. Let's drop the
workaround.
2023-08-30 17:37:22 +09:00
Yu Watanabe
5e2a89d84b sd-dhcp-client: ensure IAID and DUID being set on start
After b2851e8d6287ab9bb3cd6e42395271c45ce0e377, if IAID and DUID are not
set on start, calling sd_dhcp_client_set_iaid_duid_en() in
client_message_init() triggers assertion, as the client is already
running at the stage. Let's set IAID and DUID earlier.

Fixes #28990.
2023-08-30 17:37:03 +09:00
Mike Yuan
acf565b499
Merge pull request #29007 from tormath1/tormath1/reload
sysext: fix around `--root` support
2023-08-30 00:39:30 +08:00
Luca Boccassi
8fcc700bd9
Merge pull request #28955 from poettering/generic-pe
unify two disparate PE executable parsers we currently have into one
2023-08-29 16:09:54 +01:00
Luca Boccassi
de6906b1c1
Merge pull request #28999 from keszybz/two-man-ukify-fixe
Make ukify non-experimental
2023-08-29 16:08:49 +01:00
Zbigniew Jędrzejewski-Szmek
7c9de5d85d id128-util: add id128_from_string_not_null() 2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
f4e518e812 systemd-id128: properly document the show verb
https://github.com/systemd/systemd/issues/27514 requested this functionality
among other things, but it is already implemented. The man page was also
missing 'show' in the synopsis, so add that, along with an example.
2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
b5c27ebca4 man: document sd_id128_get_app_specific 2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
62b4bee9bc sd-id128: export sd_id128_get_app_specific()
We exported sd_id128_get_machine_app_specific() and
sd_id128_get_boot_app_specific(). But those operate on the current machine,
and sometimes the user might want to do the same calculation for a different
machine, or an earlier boot, etc. We expose the underlying implementation
to make this easy.
2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
0f7735d7a9 sd-id128: avoid one memcpy
By aligning the output buffer, we can just use the result directly, no need to
copy stuff around.
2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
f1c0ad5279 shared/id128-print: fix indentation, reduce variable scope 2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
782902f217 id128: add option -P to only show value
We have '-P' in systemctl with similar meaning.

Partially closes https://github.com/systemd/systemd/issues/27514.
2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
6a73a4f7c4
Merge pull request #28900 from abderrahim/version-info
man: add version info
2023-08-29 16:59:48 +03:00
Malte Poll
4947de275a mkfs-util: propagate SOURCE_DATE_EPOCH to mcopy
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-08-29 14:58:44 +01:00
Abderrahim Kitouni
ec07c3c80b man: add version info
This tries to add information about when each option was added. It goes
back to version 183.

The version info is included from a separate file to allow generating it,
which would allow more control on the formatting of the final output.
2023-08-29 14:07:24 +01:00
Zbigniew Jędrzejewski-Szmek
594e27b0bc ukify: fail if the config file was not read
Inspired by https://github.com/systemd/systemd/pull/28997.
Noticed by Alvin Alvarado <alvin@striczkof.io>.
2023-08-29 15:16:35 +03:00
Zbigniew Jędrzejewski-Szmek
f65aa477d9 ukify: move to /usr/bin and mark as non non-experimental
The notice in the man page is removed and the tool is moved into the $PATH.
A compat symlink is provided.

It is fairly widely used now, and realistically we need to keep backwards
compat or people will be very unhappy.
2023-08-29 15:16:35 +03:00
Zbigniew Jędrzejewski-Szmek
d3f8b754d4 man/ukify: fix synopsis
Fixup for 7d481546acc8dbd9be05fe7a901e5598487aec02 and
a3f758b3104ee1161d2dbf5a8c1be653340b1672.
2023-08-29 15:16:35 +03:00
Mathieu Tortuyaux
6a69b0d6d8
sysext: skip the reload if --root= is provided
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-08-29 13:55:36 +02:00
Mathieu Tortuyaux
14361f6dd9
sysext: fix --root= support
when provided `--root=` was failing for `status`:
```
$ systemd-sysext --root=/mnt status
Failed to open '/usr/.systemd-sysext/extensions': No such file or directory
```

path was not relative to the given `--root` - same goes for the `need_reload`
as it was inspired from the `verb_status` section.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-08-29 13:55:09 +02:00
Lennart Poettering
d8e2ba1b8e shared: remove now unused pe-header.h 2023-08-29 11:25:52 +02:00
Lennart Poettering
5c425807bf shared: port kernel-image.c over to new common PE parser 2023-08-29 11:25:52 +02:00
Lennart Poettering
8bc9d1aa9f shared: port bootspec.c over to new common PE parser 2023-08-29 11:25:52 +02:00
Lennart Poettering
0786b03969 shared: add common implementation of PE parser 2023-08-29 11:25:52 +02:00
Luca Boccassi
599a312484
Merge pull request #28998 from YHNdnzj/logind-vt-handling
logind: several cleanups
2023-08-29 01:09:10 +01:00
Jan Janssen
29c2f6ac4b meson: Fix version script
Apparently, the `|` has a higher priority…
2023-08-29 01:08:38 +01:00
Frantisek Sumsal
5599c84bcd test: fix debugging of nspawn tests
The pipe stuff introduced in 701e0c2660 causes nspawn to switch the
console from 'interactive' into 'read-only' which is a bit useless when
debugging. Let's set --console=interactive explicitly in such case.

Follow-up to 701e0c2660.
2023-08-29 01:08:08 +01:00
Abderrahim Kitouni
4623eecb2f man: Add xinclude namespace
This will be used by the next commit to add version information to the
nodes.
2023-08-28 18:27:10 +01:00
Luca Boccassi
337e8504f7
Merge pull request #28328 from yuwata/network-ndisc-limit-captive-portal
network: limit number of captive portals by RA
2023-08-28 17:45:22 +01:00
Mike Yuan
08a5bc4f48 Revert "Revert "test: add test case for systemd-update-utmp vs daemon-reexec""
This reverts commit 837773add465bd0a0d1f598203d297cf0129468b.

The original issue #27287 is fixed by #28123. Let's
reintroduce the test for systemd-update-utmp.
2023-08-28 17:43:57 +01:00