Commit Graph
86146 Commits
Author SHA1 Message Date
Yu Watanabe f2a54dac72 vmspawn/firstboot/homectl: fixes for plymouth (#40558) 2026-02-03 23:38:38 +09:00
Yu Watanabe 50ddcf8554 udev: create /run/udev/queue file earlier (#40518)
When udevd received a uevent or inotify event, then we will queue
events. To minimize the race between processing these events by udevd
and user invocation of 'udevadm settle', let's create /run/udev/queue
file earlier.
On some errors, no event may be queued, but in that case, the file will
be removed by the post event source if nothing queued. See on_post().

Hopefully mitigate the issue #40499.
2026-02-03 23:36:28 +09:00
Daan De Meyer ae6dcaff0d portable: Don't refuse copying out instance of template that exists
There's no reason to refuse copying out capsule@abc.service even if
capsule@.service already exists on the host, so let's optionally not
search for templates if we can't find an instance when looking up
units and use it in portabled.
2026-02-03 15:03:51 +01:00
Daan De Meyer 4d388536ee tree-wide: Allow running capsules as any user
For many use cases DynamicUser= just doesn't cut it. Specifically lots
of stuff wants to run as root. Let's support this use case by relaxing
our checks for capsules a bit.
2026-02-03 15:00:32 +01:00
Daan De Meyer b231c4dcb4 core: Improve logging when we cannot create destination mountpoint
If we fail to create a parent directory, then the error from
make_mount_point_inode_from_path() will always be
"No such file or directory" which doesn't tell us anything. Add logging
for the mkdir_parents() call as well so we get a useful error.
2026-02-03 15:00:32 +01:00
Yu Watanabe eb5b797d7c journal: check validity of PID field in syslog/kmsg earlier
Then, let's make syslog_parse_identifier() returns PID as pid_t, rather
than the string.

This also makes the function refuse ridiculously long identifier.

Fixes #40456.
Fixes oss-fuzz#477990732 (https://issues.oss-fuzz.com/issues/477990732).
2026-02-03 21:55:49 +09:00
Yu Watanabe dd839b1463 parse-util: rename trivial argument for parse_pid()
The function parse_pid() trivially returns pid, hence it is not
necessary to name the argument for storing result as 'ret_pid'.
2026-02-03 21:43:17 +09:00
Yu Watanabe 7e81423fb8 journal: check the length of timestamp field in syslog message
No functional change. Just refactoring and adding assertion.
2026-02-03 21:43:17 +09:00
Yu Watanabe 8d607f93b7 journal: make security label always NUL-terminated
Then, we can drop label_len or label_size arguments at various places.

While doing this, SCM_SECURITY is now ignored when SELinux is disabled
or when it contains embedded NUL.
2026-02-03 21:43:17 +09:00
Yu Watanabe 0dcbb30f49 fuzz: assume all reproducers as binary
Even if parsers expect text data, reproducers may not be suitable
for being handled as a text file.
2026-02-03 21:43:17 +09:00
Yu Watanabe dc709eff0b udev: create /run/udev/queue file earlier
When udevd received a uevent or inotify event, we will queue or trigger
synthesized events. To minimize the race between processing these events
by udevd and user invocation of 'udevadm settle', let's create /run/udev/queue
file earlier.
On some errors, no event may be queued, but in that case, the file will
be removed by the post event source if nothing queued. See on_post().

Hopefully mitigate the issue #40499.
2026-02-03 21:25:01 +09:00
Yu Watanabe b7363d3330 udev: remember UUIDs of triggered events
Otherwise, /run/udev/queue file may be removed before udevd receives
the triggered uevents. This avoids the following race:

1. uevent A is being processed,
2. received an inotify event and trigger a synthesized uevent,
3. uevent A has been processed,
4. the uevent queue becomes empty, and /run/udev/queue is removed,
5. received and queued the synthesized uevent, and /run/udev/queue is recreated.

With this patch, /run/udev/queue is not removed in step 4. Hence,
'udevadm settle' will wait for the synthesized event being processed.

This is similar to waiting for child processes that reread partitions
(thus trigger synthetic events) being terminated, but for synthetic
events triggered by the manager.
2026-02-03 21:25:01 +09:00
Yu Watanabe 95b40e4cf3 udev/watch: drop redundant argument
The arguments dev and target are always same.
2026-02-03 21:25:01 +09:00
Luca Boccassi 75cb25c0b9 firstboot/homectl: hide plymouth splashscreen when asking questions
When plymouth is enabled, the screen gets all garbled when firstboot
runs and asks questions. Disable the splash screen, but only when
actually asking questions.
2026-02-03 13:21:03 +01:00
Thorsten Kukuk a40d934007 getty: remove --issue-file parameter
agetty from util-linux is meanwhile following the configuration file
specification for /etc/issue. The usage of "--issue-file" breaks this
on distributions with current util-linux.
2026-02-03 21:00:19 +09:00
Yu Watanabe 4e5ceed9c5 ssh-generator: several cleanups (#40556) 2026-02-03 20:59:18 +09:00
Zbigniew Jędrzejewski-Szmek 65040d0876 Followups for the recent chagnes to stability statements (#40540) 2026-02-03 12:50:39 +01:00
Zbigniew Jędrzejewski-Szmek 2cbea2dd75 docs: update old man page links to the official location 2026-02-03 12:49:37 +01:00
Zbigniew Jędrzejewski-Szmek d905ac0da1 docs/INCOMPATIBILITIES: describe the new meson option 2026-02-03 12:49:37 +01:00
Luca Boccassi 7f7622285d homectl: trim some trailing whitespace 2026-02-03 12:47:12 +01:00
Luca Boccassi 610d8c3dfc vmspawn: do not pass console=hvc0 in GUI mode
This breaks when using qemu's GUI mode. Follow mkosi's example.

Follow-up for 773ca1def8
2026-02-03 10:50:34 +01:00
Yu Watanabe 0375558799 github/linter: disable ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT and update super-linter to 8.4.0 (#40554) 2026-02-03 17:44:10 +09:00
Yu Watanabe 9b011d3f5e ssh-generator: drop unused variable 2026-02-03 16:50:00 +09:00
Yu Watanabe 9666541a56 ssh-generator: drop redundant check
The loop STRV_FOREACH() below does nothing if the strv is empty.
2026-02-03 16:50:00 +09:00
Yu Watanabe 70510c2c90 ssh-generator: fix memleak 2026-02-03 16:50:00 +09:00
Yu Watanabe 65b50ae2c8 sd-bus: do not log in higher than LOG_DEBUG from library
Follow-up for 6c8de404c9.

This also adds full stop to the log message, and make "vs" followed by
dot for consistency to other messages.
2026-02-03 16:49:46 +09:00
Yu Watanabe 3d6dfabd8c meson: Don't install systemdstatedir (/var/lib/systemd) (#31627) 2026-02-03 10:08:54 +09:00
dependabot[bot] 8e217c4690 build(deps): bump super-linter/super-linter in the actions group
Bumps the actions group with 1 update: [super-linter/super-linter](https://github.com/super-linter/super-linter).


Updates `super-linter/super-linter` from 8.3.2 to 8.4.0
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/d5b0a2ab116623730dd094f15ddc1b6b25bf7b99...12562e48d7059cf666c43a4ecb0d3b5a2b31bd9e)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-version: 8.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-03 09:04:13 +09:00
Yu Watanabe 90c71778d2 github/linter: disable ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT for super-linter
Since super-linter 8.4.0, it is enabled by default and requires GITHUB_TOKEN.
We do not provide GITHUB_TOKEN for the action, then it fails with the following:
```
Failed to get [GITHUB_TOKEN]. Terminating because status reports were explicitly enabled,
but GITHUB_TOKEN was not provided.
```

Also, even if GITHUB_TOKEN is set, the feature provides annoying
messages in each PR. See https://github.com/super-linter/super-linter/issues/7458
So, let's disable the feature.
2026-02-03 08:59:46 +09:00
Antonio Alvarez Feijoo 2f76b10b94 import-generator: fix sysext/confext ordering in initrd
In the initrd, order the generated `systemd-import@.service` units before the
initrd-specific sysext/confext units.
2026-02-03 08:18:41 +09:00
Mike Yuan c27d1b3eec ssh-generator: follow symlink when searching for sshd@.service
unit_file_exists() currently does not follow symlinks, as it is
mainly used to test whether the unit (of any install state)
has been seen under search dirs. However, in ssh-generator
we should search for and honor whatever the distro ships,
which might be an alias or linked externally.
2026-02-03 08:17:34 +09:00
Luca Boccassi ce41216e49 ask-password: install polkit policy
The policy was added, but never hooked into meson to be installed,
so it's unused. Install it.

Follow-up for 066f6bfb62
2026-02-03 08:16:25 +09:00
Yu Watanabe ab8603d26b Fixes for ask-password (#40549) 2026-02-03 07:48:13 +09:00
Yaping Li c498f3790f [metrics] Add a basic CLI
systemd-report will list all the metrics.
2026-02-02 08:03:56 -08:00
Yaping Li bb1ef2edf7 [metrics] Add basic system wide and per unit metrics
This commit adds some basic metrics and integration tests.

System wide metrics:
- units_by_type_total: target/device/automount etc.
- units_by_state_total: active/reloading/inactive etc.

Two per unit metrics which shows the current state of a unit:
- unit_active_state
- unit_load_state

A metric for service state:
- nrestarts

Here are some sample outputs:

units_by_type_total:

{
        "name" : "io.systemd.Manager.units_by_type_total",
        "value" : 52,
        "fields" : {
                "type" : "target"
        }
}
{
        "name" : "io.systemd.Manager.units_by_type_total",
        "value" : 82,
        "fields" : {
                "type" : "device"
        }
}
{
        "name" : "io.systemd.Manager.units_by_type_total",
        "value" : 2,
        "fields" : {
                "type" : "automount"
        }
}

units_by_state_total:

{
        "name" : "io.systemd.Manager.units_by_state_total",
        "value" : 216,
        "fields" : {
                "state" : "active"
        }
}
{
        "name" : "io.systemd.Manager.units_by_state_total",
        "value" : 0,
        "fields" : {
                "state" : "reloading"
        }
}
{
        "name" : "io.systemd.Manager.units_by_state_total",
        "value" : 120,
        "fields" : {
                "state" : "inactive"
        }
}

unit_active_state:

{
        "name" : "io.systemd.Manager.unit_active_state",
        "object" : "multi-user.target",
        "value" : "active"
}
{
        "name" : "io.systemd.Manager.unit_active_state",
        "object" : "systemd-sysusers.service",
        "value" : "inactive"
}

unit_load_state:

{
        "name" : "io.systemd.Manager.unit_load_state",
        "object" : "multi-user.target",
        "value" : "loaded"
}

nrestarts:

{
        "name" : "io.systemd.Manager.nrestarts",
        "object" : "user@0.service",
        "value" : 0
}
{
        "name" : "io.systemd.Manager.nrestarts",
        "object" : "user-runtime-dir@0.service",
        "value" : 0
}
2026-02-02 08:03:56 -08:00
Yaping Li fd73cd6c91 [metrics] Introduce metrics API framework
This commit introduces the shared code for the metrics API framework:

- Metrics API definitions
- Code to set up the varlink server
- The describe method which shows all the metrics families
- The list method which lists all the metrics
- Type definitions related to MetricFamily
- Common code to build json objects
2026-02-02 08:03:48 -08:00
Luca Boccassi 15075cfe26 mkosi: update debian commit reference to ecec6127927ca59726e3d3535a2b2344f585cf74
* ecec612792 Stop installing /var/lib/systemd/
* 120f84266d d/rules: use --no-also for networkd and journald
* 41780703f2 d/rules: do not restart sockets, it fails if the service is running
* 5f219fbd65 Increase number of sections of sd-stub on amd64 too
* 5832d7f614 d/systemd.postinst: use --no-dbus for daemon-reexec
2026-02-02 16:28:55 +01:00
Max Gautier 9013347ba9 Don't install systemdstatedir (/var/lib/systemd)
systemdstatedir is created by tmpfiles conf (tmpfiles.d/systemd.conf.in)
already.
By shipping it, systemd prevents the effect of tmpfiles.d/var.conf.in:

q /var 0755 - - -

This should helps implementing the "Hermetic /usr" pattern.

Links: https://0pointer.net/blog/fitting-everything-together.html
2026-02-03 00:10:06 +09:00
Yu Watanabe 4c6afaab19 mkosi: workaround issue in mdadm-4.5 + linux-6.18
After debian updated the kernel from 6.17 to 6.18, mdadm command fails
with the following:
```
+ mdadm --create /dev/md/mdmirror ...
mdadm: size set to 64512K
mdadm: Can't open /sys/module/md_mod/parameters/legacy_async_del_gendisk
mdadm: init md module parameters fail
```

This seems a bug in mdadm, and fix is already merged in the upstream:
https://github.com/md-raid-utilities/mdadm/pull/228
Until the fix is backported, let's workaround the issue.

See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1125390
2026-02-02 15:32:48 +01:00
Zbigniew Jędrzejewski-Szmek 65f72f5dbb ask-password: remove files in /run when query is aborted
Because of the missing 'goto', if the query was aborted, we
would leave behind the ask.* ini file.
2026-02-02 15:16:23 +01:00
Zbigniew Jędrzejewski-Szmek f01c99c67e ask-password: reject control chars and quotes in query description
As reported in https://yeswehack.com/vulnerability-center/reports/705270,
YesWeHack issue #YWH-PGM9780-66, if a newline is injected into the message
field, it is passed through unmolested and lands in the .ini file. This
obviously would cause the parser to be confused.

Let's forbid any control characters or quotes in those fields. If we want
something more complicated in the future, we can add a custom validation
function and allow some escaping mechanism.
2026-02-02 15:16:23 +01:00
Antonio Alvarez Feijoo 5327755f8b discover-image: fix typo in log message 2026-02-02 22:24:28 +09:00
Michael Vogt 96dd2df514 nspawn: extract snapshot creation into new shared helper
This commit extracts the creation of the snapshot for
nspawn into a shared helper. Its not a lot of code but its
subtle so having a single place seems beneficial.

While extracting the snapshot code got tweaked/simplified based
on the feedback from Yu (many thanks!).

With that we can simplify the snapshot delete and error handling
as well. The shared helper is then going to be used by vmspawn
when it also gets the --ephemeral option.
2026-02-02 09:04:37 +01:00
Jim Spentzos e831a44b07 po: Translated using Weblate (Greek)
Currently translated at 35.9% (95 of 264 strings)

Co-authored-by: Jim Spentzos <jimspentzos2000@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/el/
Translation: systemd/main
2026-02-02 05:26:31 +09:00
Mike Yuan 7e6003b9bc Update the "portability and stability" document (#40502) 2026-02-01 12:43:18 +01:00
Zbigniew Jędrzejewski-Szmek fcff83a534 meson: conditionalize tmpfiles.d/legacy.conf
This is a compat interface, so let downstream like Arch drop it easily.
2026-02-01 09:40:10 +01:00
Zbigniew Jędrzejewski-Szmek 0acd1b4f35 units: restore runlevel[0-6].target aliases
This partially reverts commit e58ba80a40. Those
aliases were removed as part of the removal of sysvinit compat, but the removal
was immediately reported as a regression by users. In particular, users can
have one of those set as the default target, or use those names in Wants= or
Requires= dependencies. At least in Fedora, the removal was immediately
reverted.

When looking at our "portability and stability promise", I noticed that those
units are explicitly listed in the promise. Let's restore them upstream. They
are conditionalized under a new -Dcompat-sysv-interfaces=bool option, so that
downstreams like Arch that wasnt to strictly avoid legacy interfaces can easily
disable them. They are dropped from the docs, like we do for all deprecated
interfaces.
2026-02-01 09:40:10 +01:00
Yu Watanabe 389254d9df boot: fix typo in variable name
Fixed by GitHub Copilot.
2026-02-01 08:26:07 +01:00
Zbigniew Jędrzejewski-Szmek f4dd927e5c docs/PORTABILITY_AND_STABILITY: update the policy
The kernel has a "don't break userspace" policy [1] which is very easy
to understand and like (even if the details are complicated). We had a
complicated policy statement, but the actual practice is that we'll
generally avoid changes that cause problems for users. So the whole
detailed table is more of a guideline than something that we can rely
on.

To improve public perception, and to align the docs with practice, let's
make a general promise to keep stability, and change the existing table
to a "guideline" that tells people which interfaces to use and which not
to use so that use and development of systemd don't conflict or create
pain.

The existing document was very long, and I think it'll have a bigger
impact if it shorter. In particular, the chart is dropped, because it
was of limited use and severly outdated, because we have added many new
interfaces and components without updating it. Adding the missing
elements (and then keeping it updated) would be a lot of effort. The
chart would be most useful to somebody trying to build a systemd
reimplementation, but there haven't been many attempts like this, so
let's save the work and drop it and make the document shorter.

I also dropped the mentions of Debian. Back in the day, we did indeed
adopt many Debian conventions for config files and such, but over the
years the scope of the project has grown quite a bit and that part
of systemd is a small fraction now. And we've adopted conventions
and ideas from many other places too, so we don't mention Debian
specifically.

[1] https://docs.kernel.org/admin-guide/reporting-regressions.html
2026-01-31 17:28:42 +01:00
Zbigniew Jędrzejewski-Szmek 0c40aef7ef emacs: drop obsolete emacs property
New emacs warns on every open about the old attribute. Let's assume that
everybody who uses emacs uses the latest version, so we can drop the compat.
2026-01-31 17:26:17 +01:00