Commit Graph

48381 Commits

Author SHA1 Message Date
Yu Watanabe
1716bac658 Merge pull request #31808 from keszybz/sundry-cleanups
Sundry cleanups
2024-03-16 01:40:56 +09:00
Zbigniew Jędrzejewski-Szmek
c7fa1470f9 portablectl: add forgotten value to --help
Followup for 82047a6aa7.
2024-03-15 16:07:58 +01:00
Zbigniew Jędrzejewski-Szmek
80fcdb731d journal: use empty_to_null() in one more place
Follow-up for 45bcab66a9.
2024-03-15 16:07:58 +01:00
Luca Boccassi
e82131bf7f portable: when logging about attaching, include the used profile
Useful information to have in the logs.

Mar 14 16:45:27 H systemd-portabled[510]: Successfully attached ephemeral '/usr/share/minimal_0.raw' and its extension(s) '/usr/share/app0.raw' using profile 'default'
2024-03-15 15:05:08 +00:00
Luca Boccassi
681b1645b4 Merge pull request #31791 from yuwata/sd-dhcp-server-several-preparations
sd-dhcp-server: several cleanups and extension
2024-03-15 15:04:04 +00:00
Zbigniew Jędrzejewski-Szmek
c78e86ab8d Merge pull request #31777 from keszybz/unit-retitling-and-comments
Unit retitling and comments
2024-03-15 15:57:10 +01:00
Yu Watanabe
dbf66cd1ab network/address: acquire address in address_process_request()
Previously, if an [Address] section is configured with a null address,
e.g. Address=0.0.0.0/24, then we acquired a free address in
link_request_address().

With this commit, we queue a request with the null address as is, and
acquire a free address later in address_process_request(). Similary,
now IPv4ACD daemon is configured in address_process_request().

With this change, we can make the address acquisition depend on other
conditions, e.g. if the persistent storage is ready or not.
2024-03-15 14:54:49 +00:00
Unique-Usman
6a57d86bf9 Added a test file for the dirent-util.c 2024-03-14 22:53:32 +00:00
Yu Watanabe
5ed4c2b944 sd-dhcp-server: also save the server address and netmask to the leases file
And introduce a tiny helper to retrieve these information.
The function is not used at this time, but will be used later.
2024-03-15 04:15:10 +09:00
Yu Watanabe
d47f83302e sd-dhcp-server: rearrange the parser of the leases file
No functional changes, just refactoring and preparation for later
commits.
2024-03-15 04:15:10 +09:00
Yu Watanabe
11b88419ae sd-dhcp-server: make sd_dhcp_server_set_lease_file() optionally take directory fd
Currently, though, no valid directory fd is passed to the function call.
Preparation for later commits.
2024-03-15 04:15:10 +09:00
Lennart Poettering
f63c1ada25 Merge pull request #31739 from poettering/pid1-sd-notify-tweaks
pid1: send various notifications via sd_notify() reporting boot progress
2024-03-14 18:43:57 +01:00
Yu Watanabe
134fe8d274 network: introduce link_requeue_request() 2024-03-15 02:28:48 +09:00
Yu Watanabe
c91f8f90ba network: use link_start_dhcp4_server() at one more place
Otherwise, even if the persistent storage is not ready, the DHCP server
may be started e.g. by unplugging and plugging cable.

Follow-up for 5582b36c38.
2024-03-15 02:28:38 +09:00
Lennart Poettering
e6ceea090a nspawn: add some debug logging for sd_notify() messages received by the container manager 2024-03-14 17:24:20 +01:00
Lennart Poettering
6dfa0a9d4c manager: send an sd_notify() message informing the container manager when systemd's special UNIX signals become available
From the outside it's difficult to determine whether (and when) the PID1
inside a container supports systemd's more complete set of UNIX process
signals or not. Let's make this easier, and simply send a notification
message when we are ready.
2024-03-14 17:24:16 +01:00
Lennart Poettering
e62731f942 manager: modernize code that enables special signal delivery to PID 1 2024-03-14 17:24:13 +01:00
Lennart Poettering
95be59f907 ssh-generator: introduce ssh-access.target
This new passive target is supposed to be pulled in by SSH
implementations and should be reached when remote SSH access is
possible. The idea is that this target can be used as indicator for
other components to determine if and when SSH access is possible.

One specific usecase for this is the new sd_notify() logic in PID 1 that
sends its own supervisor notifications whenever target units are
reached. This can be used to precisely schedule SSH connections from
host to VM/container, or just to identify systems where SSH is even
available.
2024-03-14 17:23:28 +01:00
Lennart Poettering
b2d6bb5b34 core: notify supervisor over targets we reach, as we reach them
Let's inform the the supervisor about various happenings of our service
manager, specifically the boot milestones we reach.

We so far have only a singular READY=1 message, to inform about bootup
completion. But sometimes it is interesting to have something for
finegrained, in particular something that indicates optional components
that have been activated.

Usecase for this: in a later PR I intend to introduce a generic
"ssh.target" that is supposed to be activated when SSH becomes available
on a host. A supervisor (i.e. a VMM/hypervisor/container mgr/…) can
watch for that, and know two things:

1. that SSH is generally available in the system
2. when it is available

In order to not flood the supervisor with events I only send these out
for target units. We could open this up later, in theory, but I think it
makes sense to tell people instead to define clear milestone target
units if they want a supervisor to be able to track system state.
2024-03-14 17:23:10 +01:00
Lennart Poettering
ad60cdd050 manager: clean up audit/plymouth code a bit
Let's add assert()s, and let's put checks in similar order to emphasize
the symmetry. Also let's do cheap checks first.
2024-03-14 17:23:06 +01:00
Lennart Poettering
e516c4d286 machine-id-setup: inform supervisor about chosen machine ID
Similar as the previous commit, it's useful for a supervisor to know
what machine ID we settlted on, in particular as various other things
are deterministically derived from it, for example MAC addresses and
such.
2024-03-14 17:23:02 +01:00
Lennart Poettering
2f3b55c4f1 hostname-setup: send chosen hostname to supervisor via sd_notify()
once we decided on a hostname, let's tell the supervisor about it. This
is useful for example in order to recognize the system via mDNS/LLMNR or
in a DHCP lease.
2024-03-14 17:22:58 +01:00
Lennart Poettering
5a515940e9 hostname-setup: various modernizations 2024-03-14 17:22:54 +01:00
Lennart Poettering
37d15cd132 manager: make manager_send_ready() more symmetric regarding per-user/per-service scope
Always check the scope explicitly, always assert(m), and name the two
functions in a symmetric way.
2024-03-14 17:22:49 +01:00
Lennart Poettering
fb44dc646b core: normalize how we issue sd_notify() from PID 1
Always cast to (void) if we ignore the return value.

Always pass the first arg as boolean.

Always prefix the first arg with /* unset_environment= */.
2024-03-14 17:20:46 +01:00
Yu Watanabe
6b67cf808a json: introduce json_dispatch_int8() and json_dispatch_uint8() 2024-03-14 23:56:44 +08:00
Yu Watanabe
d30d44883f stat-util: expose fd_is_read_only_fs()
Currently it is not used, but the fucntion is already quite generic and
useful.
2024-03-14 23:45:27 +08:00
Yu Watanabe
cdafb51ab4 Merge pull request #31754 from YHNdnzj/journal-fd-namespace
journal/cat: allow connecting output to specific journal namespace
2024-03-14 19:59:19 +09:00
Zbigniew Jędrzejewski-Szmek
a954b427e9 src/partition: remove unnecessary uses of "make sure" 2024-03-14 11:15:55 +01:00
Lennart Poettering
837eda0522 Merge pull request #31770 from poettering/linkat-replace
introduce linkat_replace() helper, and port various things over to it
2024-03-14 11:03:59 +01:00
Yu Watanabe
af02814a85 ptyfwd: fix typo
Follow-up for d0aa368c85.
2024-03-14 17:40:26 +09:00
Yu Watanabe
f03caa0d3e stat-util: fix typo
Follow-up for 7cff2b79f0.
2024-03-14 17:37:50 +09:00
Lennart Poettering
5655e5c955 creds-util: port make_credential_host_secret() over to link_tmpfile_at()
Let's simplify things by just reusing the primitives we already have.
2024-03-14 09:22:09 +01:00
Lennart Poettering
ccec206498 tmpfile-util: port link_tmpfile_at() over to linkat_replace() 2024-03-14 09:22:09 +01:00
Lennart Poettering
1f27e7b724 fs-util: add new helper linkat_replace() 2024-03-14 09:22:09 +01:00
Lennart Poettering
0b8e36f064 fs-util: move link_fd() from tmpfile-util.c into generic fs-util.c
It's a generically useful call, let's move it so that we can use it at
more places.
2024-03-14 09:17:46 +01:00
Lennart Poettering
dd92ba8a7a path-util: add helper that checks if a path definitely refers to a dir 2024-03-14 09:17:46 +01:00
Mike Yuan
45bcab66a9 journal/cat: allow connecting output to specific journal namespace 2024-03-14 14:25:53 +08:00
Mike Yuan
32104d3251 sd-journal: introduce sd_journal_stream_fd_with_namespace 2024-03-14 14:25:52 +08:00
Mike Yuan
2a11593178 journal-send: introduce journal_stream_path helper 2024-03-14 14:25:52 +08:00
Mike Yuan
baaca3db6a path-util: introduce skip_leading_slash and use it where appropriate 2024-03-14 14:25:52 +08:00
Luca Boccassi
823ef2675d Merge pull request #31761 from CodethinkLabs/vmspawn/bug_fixes
vmspawn: fix two minor bugs
2024-03-13 23:37:50 +00:00
Mike Yuan
1ea275f119 core/cgroup: introduce MemoryZSwapWriteback setting
Added in
501a06fe8e
2024-03-13 23:36:25 +00:00
Daan De Meyer
49fc22f46c Merge pull request #31758 from DaanDeMeyer/kvm
mkosi: Enable KVM
2024-03-14 00:16:43 +01:00
Luca Boccassi
8e35076101 Merge pull request #31584 from yuwata/sd-ndisc-option-parser-cleanups
sd-ndisc: rewrite option parser
2024-03-13 23:06:50 +00:00
Daan De Meyer
d6e8137716 boot: Only use io.systemd.boot.kernel-cmdline-extra for type 1 images
Otherwise the cmdline is duplicated for UKIs.
2024-03-13 23:42:34 +01:00
Sam Leonard
4364a542e3 vmspawn: fix FD passing logic 2024-03-13 15:32:08 +00:00
Sam Leonard
002243ea64 vmspawn: prefix extra kernel-cmdline-extra with -smbios 2024-03-13 15:31:52 +00:00
Evgeny Vereshchagin
a96b4557cb fuzz: make sure DHCP client leases are loaded successfully
Now that fa3357b9e8 is merged the fuzz
target should no longer crash there.
2024-03-14 00:10:08 +09:00
sharad3001
e0cd8a1bdf udev: add assert for EVENT_RESULT_EXIT_STATUS_BASE (#31710)
EVENT_RESULT_EXIT_STATUS_BASE and EVENT_RESULT_SUCCESS has the same value.
Code updated to add assert statement for EVENT_RESULT_EXIT_STATUS_BASE.
2024-03-13 22:25:22 +09:00