1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-10 16:58:28 +03:00

79985 Commits

Author SHA1 Message Date
Yu Watanabe
96ff465861 missing_syscall: name_to_handle_at is supported by glibc since 2.14
Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.
2025-03-04 02:24:49 +09:00
Yu Watanabe
65e844bdb8 missing_syscall: gettid is supported by glibc since 2.30
Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.
2025-03-04 02:24:49 +09:00
Yu Watanabe
69a5c4b14c missing_syscall: getrandom is supported by glibc since 2.25
Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.
2025-03-04 02:24:49 +09:00
Yu Watanabe
6ca5be8d3f missing_syscall: memfd_create() is supported by glibc since 2.27
Now, our baseline of glibc is 2.31, hence it is OK to drop it.
2025-03-04 02:24:36 +09:00
Yu Watanabe
a997f3387f chattr-util: drop mostly unused 'previous' argument from chattr_path() and friends 2025-03-04 00:47:12 +09:00
Lennart Poettering
047a4111df
mount-tool: various tweaks (#36584)
Split out from #36337
2025-03-03 13:57:27 +01:00
Lennart Poettering
6263fda39b
tty-askpw-agent: react to SIGTERM while waiting for console (#36568)
I noticed that systemd-tty-password-agent would time out when asked to
stop via SIGTERM, and eventually be killed, under some circumstances. It
took me a while but i figured out what was going on:

systemd-ask-pw-agent blocks SIGTERM because it wants async notifications
on SIGTERM via signalfd() to listen on. That mostly works great: except
for one case: if we actually get a pw query request, and hence need to
acquire the terminal: we issue open_terminal() in that case, but if the
terminal is used otherwsie we'll hang, and because SIGTERM is blocked
we'll hang and cannot exit cleanly.

Address that: optionally, in open_terminal() look for SIGTERM by
unblcking the signal mask via ppoll() while we wait.
2025-03-03 13:56:44 +01:00
Daan De Meyer
fe7413d195 test: Connect test unit to console when running interactively
When running interactively, let's connect the test unit directly
to the console. This enables adding "bash" anywhere within an
integration test to get a shell within the test environment.
2025-03-03 12:35:11 +01:00
Daan De Meyer
070de658a9 test: Disable status messages when we start running a test
As soon as we start running a test, we want pid 1 to stop showing
status messages so let's tell pid 1 to stop showing status messages.
2025-03-03 12:33:56 +01:00
Daan De Meyer
854a8c21d0 test: Move getty-pre.target logic into integration-test-wrapper.py
Also pull in getty-pre.target via Wants= so it actually gets pulled
into the transaction.
2025-03-03 11:51:13 +01:00
Daan De Meyer
c9a50ebd8f test: Check stdin for interactivity, not stderr 2025-03-03 11:44:42 +01:00
Lennart Poettering
1965d2b222 io-util: fix ppoll_usec() bypass
If a non-zero timeout is specified we should not bypass ppoll() even if
no fds are specified, since it will still act as a time based sleep in
that case.
2025-03-03 10:47:09 +01:00
Lennart Poettering
99e6d1b924 units: don't block on terminating agents
Terminating the plymouth/console agents when the wall agent takes over
can happen asynchronously, after all the pw queries are async anyway and
hence can be seen by both the plymouth/console agents and the wall
agent.

By stopping the two agents with "--no-block" we add a bit of robustness,
since trouble of them exiting won't block the wall agent to start.

This addresses the issue the previous commit fixes in a different way.
2025-03-03 10:47:09 +01:00
Lennart Poettering
789f4f7ee0 tty-askpw-agent: react to SIGTERM while waiting for console
I noticed that systemd-tty-password-agent would time out when asked to
stop via SIGTERM, and eventually be killed, under some circumstances.
It took me a while but i figured out what was going on:

systemd-ask-pw-agent blocks SIGTERM because it wants async notifications
on SIGTERM via signalfd() to listen on. That mostly works great: except
for one case: if we actually get a pw query request, and hence need to
acquire the terminal: we issue open_terminal() in that case, but if the
terminal is used otherwsie we'll hang, and because SIGTERM is blocked
we'll hang and cannot exit cleanly.

Address that: optionally, in acquire_terminal() look for SIGTERM by
unblcking the signal mask via ppoll() while we wait.
2025-03-03 10:47:09 +01:00
Mike Yuan
bb12d57cd5
mount-tool: never bind to device on explicit x-systemd.device-bound=no 2025-03-03 10:45:57 +01:00
Mike Yuan
0a7295b388
mount-tool: correct arg_bind_device check 2025-03-03 10:45:56 +01:00
Mike Yuan
36d4437c5b
mount-tool: accept fstab-style identifiers for remote what too
fstab-style identifiers have stable translation to absolute paths
in the file system, hence it makes no sense to reject them
even for remote mounts.
2025-03-03 10:45:56 +01:00
Mike Yuan
70b1f3e0a2
mount-tool: some modernizations and log message tweaks 2025-03-03 10:45:56 +01:00
Jörg Behrmann
759fdb3a35 tests: remove cache=unsafe from TEST-64-UDEV-STORAGE
mkosi switch to the newer -blockdev qemu option in systemd/mkosi#3557 [1], but
cache=unsafe is an option only -drive supports.

Since the qemu-system_x86-64 man page [2] says this, cache.writeback=on is the
default and mkosi setting the other two options to the values corresponding to
unsafe, it should be fine to drop the cache=unsafe option.

┌─────────────┬─────────────────┬──────────────┬────────────────┐
│             │ cache.writeback │ cache.direct │ cache.no-flush │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writeback    │ on              │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│none         │ on              │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writethrough │ off             │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│directsync   │ off             │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│unsafe       │ on              │ off          │ on             │
└─────────────┴─────────────────┴──────────────┴────────────────┘

[1] https://github.com/systemd/mkosi/pull/3557
[2] https://manpages.ubuntu.com/manpages/noble/en/man1/qemu-system-x86_64.1.html
2025-03-03 09:45:49 +01:00
Steve Ramage
241a0f6e0a core: DelegateNamespaces= does not depend on seccomp (#36580) 2025-03-03 14:34:31 +09:00
Lennart Poettering
f2e38b01e0 sd-id128: gracefully handle systems where kernel keyring access is blocked
In various scenarios we invoke containers with access to the kernel
keyring blocked. Let's make sure we can handle this properly: when the
invocation ID is stored in in the kernel keyring and we try to read it
and get EPERM we should handle it gracefully, like EOPNOTSUPP.
2025-03-03 14:30:41 +09:00
Lennart Poettering
c179f03911
osc-context: several follow-ups (#36579) 2025-03-02 22:00:09 +01:00
Jörg Behrmann
369655330d vmspawn: switch from -drive to -blockdev option 2025-03-02 21:54:30 +01:00
Mike Yuan
14a40a6d1c
core/main: don't write shutdown OSC context outside of pid1
Follow-up for 98c283131cda67c98946ef373e3bb33aa52de59a
2025-03-02 16:22:40 +01:00
Mike Yuan
20a7802852
run: send out TERM= only if actually set
Follow-up for 4d6eb6441a5332c285e35907894c7d4f3463ba64
2025-03-02 16:22:00 +01:00
Mike Yuan
02fc6c55e5
run: log about osc_context_open_chpriv() failure
Follow-up for 575922c914c732bb77c99aee54c84dc365d60631
2025-03-02 16:21:59 +01:00
Mike Yuan
cada508fd8
osc-context: drop unneeded temporary variable 2025-03-02 16:21:59 +01:00
Mike Yuan
ffabfef921
login/pam_systemd: use isatty_safe()
Follow-up for d8069b8add9a2290d7ed85012f8459fccfc632ed
2025-03-02 16:21:59 +01:00
Lennart Poettering
f2b1de6f5b Revert "sd-json: add new sd_json_variant_unset_field() call"
This reverts commit b6a2df630701de0bcf77850ced213d7fc3d0c4de.

The functionality is entirely redundant, we already have
sd_json_variant_filter() which does the same, and is in fact even more
powerful, since it takes a list instead of a single field to remove.
2025-03-02 11:04:15 +00:00
Chris Grant
5bc576225a hwdb: Add accel orientation quirk for the GPD Pocket 4 2025-03-02 13:57:00 +09:00
Jaroslav Škarvada
d8af5c262c hwdb: add Code Mercenaries Hard- und Software GmbH Virtual RC USB
It's official VRC USB dongle. Make it work in SDL apps, wine,
Steam, ... and fix the erratic mouse events when the dongle is in use.
2025-03-02 13:56:14 +09:00
Daan De Meyer
daa2547e31 Add a few more bypass environment variables
When we're building ParticleOS images, we don't want the package
manager (or mkosi) to run systemd-sysusers, systemd-tmpfiles or
systemctl preset so let's add a few more bypass environment
variables that we can set to have execution of these skipped like
we already have $SYSTEMD_HWDB_UPDATE_BYPASS and $KERNEL_INSTALL_BYPASS.
2025-03-01 16:22:53 +01:00
Daan De Meyer
38701809a8
core: Add DelegateNamespaces= (#36532) 2025-03-01 15:18:45 +01:00
dependabot[bot]
a60cb5c425 build(deps): bump github/codeql-action from 3.27.5 to 3.28.10
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.28.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f09c1c0a94...b56ba49b26)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 14:09:07 +01:00
dependabot[bot]
e24cd759e1 build(deps): bump ossf/scorecard-action from 2.4.0 to 2.4.1
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](62b2cac7ed...f49aabe0b5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 14:08:38 +01:00
dependabot[bot]
c736862058 build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.4.0 to 5.5.3.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](cc6721c45a...dd551ce780)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 14:08:15 +01:00
Daan De Meyer
8234cd9989 core: Add DelegateNamespaces=
This delegates one or more namespaces to the service. Concretely,
this setting influences in which order we unshare namespaces. Delegated
namespaces are unshared *after* the user namespace is unshared. Other
namespaces are unshared *before* the user namespace is unshared.

Fixes #35369
2025-03-01 13:54:58 +01:00
Yu Watanabe
aaa5065d8f
bump minimum required version of glibc to 2.31, and drop many fallback logic around statx() (#36558)
glibc-2.31 was released on 2020-02-01, which is more than 5 years ago.
Let's also bump the baseline of glibc.
2025-03-01 04:18:17 +09:00
Daan De Meyer
54ae0edc4a dissect: Skip partitions with _empty label 2025-02-28 17:00:50 +01:00
Lennart Poettering
8a69330e54
homed: port to notify_recv() + convert to PidRef (#36557)
Just some refactoring/modernization
2025-02-28 17:00:31 +01:00
Yu Watanabe
ee739ea692 mountpoint-util: make statx() failure critical
Two error conditions are unreachable, as now both glibc and kernel
support statx(). In other many places, failure in statx() are handled as
critical, even if it is filtered by seccomp or so. Let's follow the same
way here.
2025-03-01 00:40:22 +09:00
Yu Watanabe
d5ddc0e0d3 stat-util: drop statx_fallback()
Now both our required baseline of glibc and kernel support statx.
2025-03-01 00:33:32 +09:00
Yu Watanabe
998e6394ea test-stat-util: check if linux/stat.h is actually included from sys/stat.h 2025-03-01 00:33:32 +09:00
Yu Watanabe
4424e6c811 tree-wide: drop workarounds for statx()
struct statx in glibc header was introduced in glibc-2.28
(fd70af45528d59a00eb3190ef6706cb299488fcd), but at that time,
sys/stat.h conflicts with linux/stat.h. Since glibc-2.30
(5dad6ffbb2b76215cfcd38c3001778536ada8e8a), sys/stat.h includes
linux/stat.h if exists.

Since now our baseline of glibc is 2.31. Hence, we can drop workarounds
for struct statx by importing linux/stat.h from newer kernel (v6.14-rc4).
2025-03-01 00:33:28 +09:00
Yu Watanabe
24845c4ff6 README: bump supported minimum glibc version to 2.31
The current glibc versions used by major distributions:
CentOS 9:  2.34
CentOS 10: 2.39
Fedora 40: 2.39
Fedora 41: 2.40
Fedora 42: 2.41
Ubuntu 20.04 LTS (focal): 2.31
Ubuntu 22.04 LTS (jammy): 2.35
Ubuntu 24.04 LTS (noble): 2.39
Ubuntu 24.10 (oracular):  2.40
Debian 11 (Bullseye, oldstable): 2.31
Debian 12 (Bookworm, stable):    2.36
openSUSE SLE-15-SP6: 2.38
openSUSE Tumbleweed: 2.40

Hence, based on our supporting policy, we can bump the base line to 2.31.
This commit does not change anything on our source code. But, will drop
many workarounds for supporting older glibc in later commits.
2025-02-28 23:38:45 +09:00
Yu Watanabe
a3d0471b03 basic/linux: update kernel headers from v6.14-rc4 2025-02-28 23:38:45 +09:00
Yu Watanabe
914d1ec171 tmpfiles: fix output value assignment
Fixes a bug in 7eeda1da90c79ba420a6d82c1d9589b23048d79f (v256).
2025-02-28 23:38:02 +09:00
Yu Watanabe
91421f8379 recurse-dir: fix wrong assertion and error code in log
Fixes a bug in b5a07e524e42d2594174ca1a5b72aa4fdb9af94c (v250).
2025-02-28 23:37:52 +09:00
Michal Koutný
1644724a4d sd-event: Fix sd_event_source leak
Hinted by CID#1591563 but the issue is different -- when
sd_event_source_set_destroy_callback() fails, we would use the old
n_sources value and possibly missing sd_event_source_unref() of the last
added source.
2025-02-28 15:16:53 +01:00
Lennart Poettering
3b0103aaa5 homed: port worker management to PidRef 2025-02-28 14:18:23 +01:00