Commit Graph
86154 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek c46cc2630d man: make it clear that homectl -A/T/N do not take an argument
Just like in the --help strings, we need to avoid confusion between
short options which take an argument and those that don't.
2026-02-13 11:07:27 +01:00
Zbigniew Jędrzejewski-Szmek 952f3a5dbf homectl: drop --and-resize and --and-change-password
The two options are were not documented or ever used in the codebase.
Additionally, the parser expected an argumentless option, while the option
table declared a required argument. So I think this was added for debugging
and never excercised properly. Since there was no public documentation for
those, it's as if they never existed, so it should be fine to drop them.
2026-02-13 11:07:26 +01:00
Zbigniew Jędrzejewski-Szmek 097f130731 resolvectl: split out helper to parse stdin
No functional change, just splitting up of a lengthy function.
2026-02-13 11:07:25 +01:00
Zbigniew Jędrzejewski-Szmek b4df0a9ee6 nspawn: split out helper to parse --private-users
This is just to make parse_argv() slightly more managable.
2026-02-13 11:07:22 +01:00
Zbigniew Jędrzejewski-Szmek 26de1563d0 nspawn: simplify parsing of --hostname/--machine 2026-02-11 12:50:51 +01:00
Zbigniew Jędrzejewski-Szmek c1fcc80421 journal-upload: drop custom option error handling
The line to set opterr=0 was added in the initial commit in
3d090cc6f3. But afaict, this never worked as
intended, because ':' must be the first char in optstring given to
getopt_long() for it to return ':' for a missing option value. Since
this wasn't set, getopt_long() would return '?', and the missing value
would be handled as an unknown option:
  $ build/systemd-journal-upload --key
  Unknown option --key.
  $ build/systemd-journal-upload --asdf
  Unknown option --asdf.

Let's just do the standard thing:
  $ build/systemd-journal-upload --key
  build/systemd-journal-upload: option '--key' requires an argument
  $ build/systemd-journal-upload --asdf
  build/systemd-journal-upload: unrecognized option '--asdf'
2026-02-11 11:48:29 +01:00
Zbigniew Jędrzejewski-Szmek 7b6f1ea371 cryptenroll: simplification 2026-02-11 11:47:59 +01:00
Zbigniew Jędrzejewski-Szmek 4a991af017 cryptenroll: split out parser for --wipe-slot= 2026-02-11 11:47:52 +01:00
Zbigniew Jędrzejewski-Szmek ff12bcd4fb path: simplify run()
No functional change, just less indents.
2026-02-11 11:47:18 +01:00
Zbigniew Jędrzejewski-Szmek e4c6ee2ce5 mount-tool: fix confusion in --help
See grandparent commit for explanation.
2026-02-11 11:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 84f6967558 importctl: fix confusion in --help
See parent commit for explanation.
2026-02-11 11:46:38 +01:00
Zbigniew Jędrzejewski-Szmek cb406988ac cgtop: fix confusion in --help
When we say '-n --iterations=N' in --help, this means that the program
can be invoked with '-n N' or '--iterations=N' or '--iterations N'.
(The short option is specified without the argument.)

Here we tried to use '-p --order=path' to mean that the program can be
invoked with '-p' or '--order=path', but that is incompatible with the
established convention.

Also, indicate that the arg to --cpu is optional.
2026-02-11 11:46:12 +01:00
Lennart Poettering 775f04293d kernel-install refactorings (#40610)
This contains the first two commits from #38764. While @daandemeyer
convinced me to base systemd-sysinstall on a new "bootctl link" rather
than "kernel-install", I think the refactorings I prepped as part of the
original work still make a lot of sense on their own, and I hope I
didn't do them for /dev/null.
2026-02-09 11:54:36 +01:00
Lennart Poettering 7ae2329198 tree-wide: symlink well-known Varlink service entry point sockets into /run/varlink/registry/ (#40590)
This is generally useful, but is particularly useful in context of
https://github.com/mvo5/varlink-proxy-rs which can expose a set of local
Varlink services via a HTTP bridge. The idea is that the sockets linked
into /run/varlink/registry/ are candidates for being exposed like that.

/cc @mvo5
2026-02-09 11:54:15 +01:00
Mike Yuan b026cb94ae path-util: unify path_extract_filename/directory into path_split_prefix_filename() (#40608) 2026-02-09 11:03:14 +01:00
Zbigniew Jędrzejewski-Szmek df8747806b Two cleanups (#40587) 2026-02-09 11:02:41 +01:00
Zbigniew Jędrzejewski-Szmek 8a70fa901e hwdb: quote invalid patterns in error messages
If the pattern is invalid, we don't quite know how it looks, so it's
safer to quote it.

Also simplify the call to sorted().
2026-02-09 11:01:31 +01:00
Zbigniew Jędrzejewski-Szmek 25860000b6 Fix wording in two places
Noticed this while going through the stable series…
Also update location after 97318131fd.
2026-02-09 11:01:15 +01:00
Lennart Poettering 71e651ba82 update TODO 2026-02-09 10:54:18 +01:00
Lennart Poettering a1d3fd1202 test: add superficial test for list-registry 2026-02-09 10:54:18 +01:00
Lennart Poettering e2f23b6deb man: document new varlinkctl feature 2026-02-09 10:54:18 +01:00
Lennart Poettering 607152c742 varlinkctl: add 'list-registry' command 2026-02-09 10:54:17 +01:00
Lennart Poettering 3e4fca7489 chase: add new flag CHASE_MUST_BE_SOCKET
Just like CHASE_MUST_BE_DIRECTORY and CHASE_MUST_BE_REGULAR, but test if
the inode is a socket.
2026-02-09 10:44:47 +01:00
Lennart Poettering c0ee33f48f stat-util: add stat_verify_socket() helper 2026-02-09 10:44:47 +01:00
Lennart Poettering 382f141fea units: symlink well-known Varlink services into /run/varlink/registry/
So far we didn't provide any concept to enumerate local Varlink
services. Let's change that.

Let's define very light-weight scheme for this: provide a well-known dir
/run/varlink/registry/ where services that implement public interfaces
can link their sockets into. When enumerating services it's thus
sufficient to enumerate inodes in that directory.

The usecase for this is twofold:

1. It's simply very useful to be able to see which public services are
   bound on the local system, for debugging/admin/development purposes.

2. At Amutable we'd like to optionally provide a HTTP-to-Varlink bridge
   on individual nodes, that allows remote peers (after authentication)
   to access local Varlink services. For that it's essential we know the
   list of services and their entrypoints to expose, it would be
   security-wise highly problematic for clients to provide AF_UNIX
   entrypoint paths when connecting. hence: let's instead just have a
   dir with the public stuff, and let's ensure the HTTP-to-Varlink
   bridge simply exposes that stuff, and nothing else.

Non-public interfaces (such as the oomd interfaces between PID 1 and
oomd), and interfaces with multiple implementors (such as the resolved
hook interface, or the metrics collection stuff) should not be linked
in.

This is inspired by the Varlink.org "registry" concept, briefly
explained here:

https://varlink.org/FAQ#how-do-i-find-the-service-which-implements-a-local-interface

Note however that the described Varlink interface is not actually
implemented here, the directory is introduced however in a fashion that
conceptually matches the registry defined there, and would allow us to
implement the registry interface on top of it. (One of the reason the
registry Varlink API is not implemented right now is that the URI format
it relies on is entirely unspecified in the Varlink docs right now. Some
research needs to be done to extract what's implemented in the reference
implementation and to determine how it maps to the Varlink entrypoint
address format systemd's own tooling currently uses)

This primarily installs the symlinks via Symlinks= in unit files and via
a new tmpfiles.d/ drop-in. But since we touch all .socket units relating
to Varlink this also sets the FileDescriptorName= to varlink for each,
just to minimize diffrences and make things work more alike (the
services in questin don't care about the name, so this doesn't change).
In one case we replace a pair of separate sockets for two closely
related varlink services by a socket and a symlink, so that we can
safely use Symlinks= to also install the registry symlinks.
2026-02-09 10:44:47 +01:00
Lennart Poettering 4a54381d07 mountfsd: don't cross mount boundaries when looking for owner of foreign UID owned tree (#40578) 2026-02-09 10:36:22 +01:00
Lennart Poettering 05bbe4247b update TODO 2026-02-09 10:33:29 +01:00
Lennart Poettering 2557f78c07 mountfsd: do not cross mount boundaries when looking for parent of foreign UID range owned dirs
This is primarily paranoia: it might be possible for unpriv users to set
up mount hierarchies in unexpected ways when using userns. Hence let's
make protections more rigid: when looking for a parent dir of a foreign
UID owned dir tree, refuse to cross mount boundaries.
2026-02-09 10:33:01 +01:00
Lennart Poettering f5a7247afb stat-util: add statx_verify_directory() helper, similar to stat_verify_directory() but for statx 2026-02-09 10:33:01 +01:00
Lennart Poettering 780f15ee7d mountpoint-util: use xstatx() a bit more 2026-02-09 10:33:01 +01:00
Lennart Poettering 2c756c6964 dirent-util: use xstatx_full() some more 2026-02-09 10:33:01 +01:00
Zbigniew Jędrzejewski-Szmek 15777d6d5c report: many smaller clean-ups/tweaks to systemd-report (#40598)
/cc @keszybz
2026-02-09 10:28:29 +01:00
Lennart Poettering cfee2c1900 kernel-install: allocate "Context" object only in verb_xyz() functions, not already in run()
We soon want to add a Varlink interface to this, but that means that the
various paramaters for the Context object will be sourced from a Varlink
message not from the command line. Hence split apart the parsing logic
so that we alway parse the command line into arg_xyz first, and then,
inside the verb_abc() calls copy the data from there into the Context
object.

This matches a similar pattern in bootctl.
2026-02-09 10:21:16 +01:00
Lennart Poettering 533afe86c3 kernel-install: rework in preparation for varlink
This reworks things a bit, so that the "Context" object can later be
allocated for each Varlink call separately. For example we define a
more precise CONTEXT_NULL that invalidates truly all fields, so that we
can discern "defaults" from "unspecified" later on.

Other minor rearrangements too
2026-02-09 10:21:16 +01:00
Daan De Meyer 7d4ea41bd1 bootctl parts of installer PR (#40447)
This contains the "bootctl install" related work from the #38764 split
out, but also includes the preparatory work already split out into
#40446.

I'll rebase this PR once the prep work is merged.

This has a simple CI test already, and has docs
2026-02-09 09:46:39 +01:00
Mike Yuan 8b7e98f183 journal-send: check if $LOG_NAMESPACE denotes our /run/systemd/journal/ is already namespaced properly 2026-02-09 09:41:47 +01:00
Luca Boccassi a2e55fceee docs: note step to update obs workflow file on release 2026-02-09 09:36:53 +01:00
Luca Boccassi 4834014018 README: note that we now have packages built from stable branch too 2026-02-09 09:36:53 +01:00
Mike Gilbert a304f6c9db meson: use printf instead of echo
The echo builtin provided by some shells (mksh) will interpret \x2d as
an escape sequence. This causes meson to fail:

```
test/fuzz/meson.build:93:52: ERROR: File fuzz-unit-file/dm-back-slash.swap does not exist.
```

Bug: https://bugs.gentoo.org/969789
2026-02-09 09:36:26 +01:00
Lennart Poettering 7e8c35ce80 update TODO 2026-02-09 09:33:07 +01:00
Mike Yuan cc9a9d6a15 tree-wide: use path_split_prefix_filename() where appropriate 2026-02-09 09:07:15 +01:00
Mike Yuan 18a8ea3377 path-util: unify path_extract_filename/directory into path_split_prefix_filename() 2026-02-09 09:05:45 +01:00
Mike Yuan 294855953c path-util: drop redundant condition in path_find_last_component()
Follow-up for 3a7ba9f6b9
2026-02-09 09:05:44 +01:00
Mike Yuan 3788ec1b4a snapshot-util: include shared-forward.h 2026-02-09 09:05:44 +01:00
Lennart Poettering dd8c12e5ec oomd: implement a prekill hook (#38584)
When a cgroup is selected for termination, send varlink messages to
hooks registered in `/run/systemd/oomd.prekill-hooks/`.
oomd waits up to `PreKillTimeoutSec=` seconds for response before
proceeding with the kill.
2026-02-09 08:43:13 +01:00
Mike Yuan 595ea7c2e8 docs/INCOMPATIBILITIES: fix typo 2026-02-09 02:36:50 +01:00
Mike Yuan 6801fdda61 mailmap: deduplicate Lennart and Daan @Amutable 2026-02-09 02:36:27 +01:00
Matteo Croce c1bf450fa0 oomd: implement a prekill varlink event
When a cgroup is selected for termination, send varlink messages
to hooks registered in `/run/systemd/oomd.prekill-hooks/`.
oomd waits up to `PreKillHookTimeoutSec=` seconds for response
before proceeding with the kill.
2026-02-09 02:05:57 +01:00
Matteo Croce 67cbfbbf4b Revert "oomd: move check if processes can be killed into oomd_cgroup_kill()"
This reverts commit 332bce5bd7.

The revert is needed because with the PreKill hook, oomd_cgroup_kill()
is not goint to really kill processes but it just creates the callbacks.
So the check is deferred to the real kill.
2026-02-09 02:05:57 +01:00
Daan De Meyer 8fba6e2b40 oomd: Make OomdCGroupContext reference counted
Preparation for adding oomd hooks.
2026-02-09 02:05:57 +01:00