1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-14 05:57:40 +03:00

67054 Commits

Author SHA1 Message Date
Frantisek Sumsal
97e2785292 shell-completions: add missing systemctl verbs/options
Resolves: #29048
2023-09-04 11:49:51 +02:00
Frantisek Sumsal
05ebcbd5c5 shell-completions: code cleanup 2023-09-04 11:49:26 +02:00
Victor Westerhuis
9dd8858281 userdbd: Order systemd-userdbd.service after systemd-remount-fs.service
Otherwise the root filesystem might still be readonly and
systemd-userdbd fails to start.

Explicitly pick systemd-remount-fs.service instead of local-fs-pre.target
to prevent a dependency cycle.
2023-09-04 09:47:05 +08:00
Luca Boccassi
f7f842f888 mkosi: temporarily disable Arch
The mkosi Arch CI doesn't work as the keyring package is out
of date and cannot be built due to various build toolchain
issues. Disable the job as it always fails and confuses
submitters.
2023-09-03 14:40:24 +01:00
Luca Boccassi
626a9eba09
Merge pull request #28988 from keszybz/sd128-arbitrary-values
Add sd-id128 and systemd-id128 functionality to do "app specific" with any "base"
2023-09-03 14:05:32 +01:00
Luca Boccassi
809eb17134
Merge pull request #28976 from yuwata/network-ndisc-drop-on-zero-lifetime
network/ndisc: also drop configurations with infinite lifetime on RA …
2023-09-03 14:04:58 +01:00
Luca Boccassi
4b246347ba
Merge pull request #28963 from YHNdnzj/loginctl-table
loginctl: use vertical table for {user,session,seat}-status
2023-09-03 14:04:24 +01:00
Mike Yuan
62f643a34d
Merge pull request #28793 from poettering/switch-root-flags-tweak
various switch-root tweaks/fixes
2023-09-03 11:18:18 +08:00
Robby Red
f06bee168b
hwdb: Added config for RCA W101SA23T1 (#29041) 2023-09-03 11:17:15 +08:00
dependabot[bot]
475974eb5b build(deps): bump actions/checkout from 3.5.3 to 3.6.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](c85c95e3d7...f43a0e5ff2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-02 19:13:09 +00:00
dependabot[bot]
c5de4ee02b build(deps): bump meson from 1.2.0 to 1.2.1 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.2.0...1.2.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-02 19:12:43 +00:00
dependabot[bot]
3bb5656ff1 build(deps): bump github/codeql-action from 2.21.2 to 2.21.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.2 to 2.21.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0ba4244466...00e563ead9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-02 19:12:34 +00:00
Mike Yuan
bf366954fa
loginctl: use vertical table for {user,session,seat}-status
To make alignment better and more manageable.

Requested in https://github.com/systemd/systemd/pull/27769#discussion_r1203952407
2023-09-02 22:59:57 +08:00
Mike Yuan
00614746e9
string-util: introduce strrepa 2023-09-02 22:59:15 +08:00
Mike Yuan
62efc7629b
format-table: use format_timestamp_relative_monotonic 2023-09-02 22:58:00 +08:00
Yu Watanabe
218f3738d8 network/ndisc: drop captive portals with zero lifetime earlier
This also adds a comment about that we use the main lifetime for captive
portals.
2023-09-02 22:25:17 +09:00
Lennart Poettering
c6c5d20de5
Revert "shutdown: do not umount recursively before MS_MOVE"
This reverts commit 6b219b74de53729249956221a971047aab7c96e0.

This commit doesn't look right to me. We have to unmount everything
recursively *before* we MS_MOVE because the MS_MOVE will not get rid of
it for us, and we simply cannot access these mounts after the MS_MOVE is
complete anymore.

This is a fundamental difference between MS_MOVE and pivot_root(). The
latter repivots the entire mount table getting rid of anything outside
of the new root. MS_MOVE otoh just mounts a bunch of mount points to the
top, leaving in place whatever might be underneath it.

Thus, if we go through the MS_MOVE codepath we must unmount everything
explicitly before doing so because otherwise the mounts will be pinned
forever, but be entirely invisble to userspace.
2023-09-02 19:47:58 +08:00
Lennart Poettering
95648f9ed0
switch-root: when pivot_root() fails, but old root shall be mounted, do so
If pivot_root() fails, we'll fall back to switching root via MS_MOVE.
Unlike pivot_root() that won't place the old root fs anyway, but just
hide it. That's problematic during shutdown for example, since after all
we might still want to access it from the exitrd, to disassemble it
properly.

Hence let's make things somewhat systematic: regardless if pivot_root()
or MS_MOVE is used, always make the old root fs show up in the selected
new dir.
2023-09-02 19:47:58 +08:00
Lennart Poettering
c2d62118f7
switch-root: rework SWITCH_ROOT_SKIP_RECURSIVE_RUN flag
Negative flags always raise eyebrows. Let's normalize
SWITCH_ROOT_SKIP_RECURSIVE_RUN to become SWITCH_ROOT_RECURSIVE_RUN, i.e.
make recursive behaviour opt-in, rather than opt-out. We only want it
for the initrd→host transition, and in all other cases we'd prefer to
avoid it.

This allows us to simplify some code. Also, normalize the mount point
table in switch_root() a bit, to be static const, and then just select
between two mount flag sets via SWITCH_ROOT_RECURSIVE_RUN, where the
mount flag without MS_BIND (i.e. zero) just means "skip this entry".

This does not actually change anything in behaviour, it's just
refactoring.

Follow-up for: b12d41a8bb7c99f7d7a1c7821a886d98b42d9ce0
2023-09-02 19:47:57 +08:00
Zbigniew Jędrzejewski-Szmek
a53dc9b130
Merge pull request #29017 from msizanoen1/fix-onboot-rotate
journal: Relax boot ID and monotonic clock consistency checks
2023-09-02 14:26:44 +03:00
Zbigniew Jędrzejewski-Szmek
698287d7dc
Merge pull request #28971 from YHNdnzj/soft-reboot-is-better-switch-root
core,systemctl: use path_is_root & limit switch-root to initrd transitions
2023-09-02 14:22:53 +03:00
Zbigniew Jędrzejewski-Szmek
437e217a48 man: add version information
I'm keeping this as a separate commit. It is the first time version
information is manually added after 6a73a4f7c466887a03c9939300ba6864203b1b3f
and we might want to revert this later.
2023-09-02 14:17:29 +03:00
Zbigniew Jędrzejewski-Szmek
ed856ea15c TODO: add entry about service and socket units 2023-09-02 14:17:29 +03:00
Zbigniew Jędrzejewski-Szmek
716126c069 id128: rework conditional to reduce indentation 2023-09-02 14:17:29 +03:00
Zbigniew Jędrzejewski-Szmek
fa96afb4c4 sd-id128: do not allow null 'app_id' param
If it is null, we get the 'base' param unchanged:
$ build/systemd-id128 show 00000000000000000000000000000001 \
  --app-specific=00000000000000000000000000000000
00000000000000000000000000000001

This is not good, because it breaks our promise that the base (usually either
machine-id or boot-id) cannot be derived from the result. Some application
using the library could use a null app id, inadvertently exposing the machine
or boot id. (This could happen because of forgotten initialization, or maybe
because the app id is configurable, and the user configures it wrongly.)

Note: the other way the secret is not exposed:
$ build/systemd-id128 show 00000000000000000000000000000000 \
  --app-specific=00000000000000000000000000000002
4f63080959264900b0d88d999dae2d3a

Normally systemd would not allow a null machine-id or boot-id, but we can let
the user do the calculation that if they want to.
2023-09-02 14:17:29 +03:00
Zbigniew Jędrzejewski-Szmek
b37e8184a5 id128: allow combining --app with show
This effectively exposes sd_id128_get_app_specific() on the commandline.

Fixes https://github.com/systemd/systemd/issues/27514.
2023-09-02 14:17:29 +03:00
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
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