Commit Graph
51571 Commits
Author SHA1 Message Date
Lennart Poettering 562f7bde88 resolved: refresh resolv.conf files when link goes away
This might have the effect that some DNS server or search domain
disappears, hence rewrite the relevant files.

See: #27543
2024-10-18 20:58:50 +09:00
Lennart Poettering 2e2826d7d9 resolved: add some more comments to varlink interface
This is by no means complete, but gets us a bit closer.
2024-10-18 19:17:36 +09:00
Lennart Poettering af7674f4ad networkd: raise limits on number of address 8x
Limits should be enforced, but not in a way real setups collide with
them.

There have been multiple reports that current limits are too low, hence
raise them 8x.

Fixes: #24852
2024-10-18 19:13:49 +09:00
Adrian Vovk fafc3c2d5c GREEDY_REALLOC_APPEND: Make more type safe
Previously, GREEDY_REALLOC_APPEND would compile perfectly fine and cause
subtle memory corruption if the caller messes up the type they're passing
in (i.e. by forgetting to pass-by-reference when appending a Type* to an
array of Type*). Now this will lead to compilation failure
2024-10-18 14:22:58 +09:00
Lennart Poettering 49fd31df58 Merge pull request #34801 from poettering/async-sd-notify-close
pid1: close unexpected fds received via sd_notify() asyncronously
2024-10-17 14:43:19 +02:00
Lennart Poettering 67fd2f0ef3 Merge pull request #34795 from YHNdnzj/bump-kernel-baseline-5.4
Bump kernel baseline to 5.4
2024-10-17 14:42:25 +02:00
Lennart Poettering 4b3d7feb19 pid1: close fds we receive via sd_notify() and cannot make use of asynchronously
This addresses #11112 fully. It mostly was addressed by
99620f457e already, but for fds not
even passed to the fdstore, this adds the missing asynchronous close
codepath.

Fixes: #11112
2024-10-17 09:50:57 +02:00
Lennart Poettering 33dd894546 fdset: optionally, close remaining fds asynchronously 2024-10-17 09:48:05 +02:00
Ryan Wilson f436c2195a Reformat load-fragment-gperf.gperf.in
This commit reformats load-fragment-gperf.gperf.in after changes
made for adding the ManagedOOMMemoryPressureDurationSec= property.
2024-10-16 20:12:47 -07:00
Ryan Wilson 63d4c4271c cgroup: Add ManagedOOMMemoryPressureDurationSec= override setting for units
This will allow units (scopes/slices/services) to override the default
systemd-oomd setting DefaultMemoryPressureDurationSec=.

The semantics of ManagedOOMMemoryPressureDurationSec= are:
- If >= 1 second, overrides DefaultMemoryPressureDurationSec= from oomd.conf
- If is empty, uses DefaultMemoryPressureDurationSec= from oomd.conf
- Ignored if ManagedOOMMemoryPressure= is not "kill"
- Disallowed if < 1 second

Note the corresponding dbus property is DefaultMemoryPressureDurationUSec
which is in microseconds. This is consistent with other time-based
dbus properties.
2024-10-16 20:12:38 -07:00
Ryan Wilson c43ef2e883 oomd: Refactor DefaultMemoryPressureDurationSec= to use conf parser
Parsing DefaultMemoryPressureDurationSec= is currently split between
conf parser, main() and manager_start() methods. This commit centralizes
parsing and bounds checking logic within a single custom conf parser
function.
2024-10-16 20:05:48 -07:00
Yu Watanabe cadb074b9c Merge pull request #34793 from yuwata/journalctl-copy-arguments
journalctl: copy arguments
2024-10-17 01:52:03 +09:00
Mike Yuan 102efcd312 Bump kernel recommended baseline to v5.4 2024-10-16 18:06:11 +02:00
Yu Watanabe cd4b71b861 machine: fix typo
Follow-up for ad0d4f9a4c.
2024-10-17 00:48:43 +09:00
Yu Watanabe 6a6c0dab30 pidref: fix typo
Follow-up for de34ec188c.
2024-10-17 00:46:45 +09:00
Yu Watanabe e776ab8e21 ukify: fix typo
Follow-up for 02eabaffe9.
2024-10-17 00:44:41 +09:00
Yu Watanabe 8333badeb2 Merge pull request #34381 from DaanDeMeyer/extension-submounts
sysext: Deal with nested mounts properly
2024-10-17 00:11:17 +09:00
Luca Boccassi 5f911aca84 Fix maybe-uninitialized warnings with gcc 14.2
../src/resolve/resolved-bus.c: In function ‘call_link_method’:
../src/resolve/resolved-bus.c:1769:16: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
 1769 |         return handler(message, l, error);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1755:15: note: ‘l’ was declared here
 1755 |         Link *l;
      |               ^
../src/resolve/resolved-bus.c: In function ‘bus_method_get_link’:
../src/resolve/resolved-bus.c:1828:13: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
 1828 |         p = link_bus_path(l);
      |             ^~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1816:15: note: ‘l’ was declared here
 1816 |         Link *l;
      |               ^
2024-10-16 16:07:40 +02:00
xujing cc2030f928 pid1: add env var to override default mount rate limit interval
Similar to 24a4542c. 24a4542c can only be set 1 in 1s at most,
sometimes we may need to set to something else(such as 1 in 2s).
So it's best to let the user decide.

This also allows users to solve #34690.
2024-10-16 16:07:26 +02:00
Yu Watanabe ce2b92e8b0 journalctl: do not directly use optarg, but copy optarg before use
Otherwise, if the process forks child processes, then the arguments
cannot be used from them.
To avoid potential issues like the one fixed by
6d3012bab4.
2024-10-16 23:06:42 +09:00
Luca Boccassi 6eb8d2bc3a Merge pull request #34791 from poettering/live-mount-tweak
tweaks to live mount property logging
2024-10-16 14:43:14 +01:00
Daan De Meyer ddbddebe0c sysext: Deal with nested mounts properly
Nested mounts should be carried over from host to overlayfs to overlayfs
(and back to host if unmerged). Otherwise you run into hard to debug
issues where merging extensions means you can't unmount those nested mounts
anymore as they are hidden by the overlayfs mount.

To fix this, before unmerging any previous extensions, let's move the nested
mounts from the hierarchy to the workspace, then set up the new hierachy, and
finally, just before moving the hierarchy into place, move the nested mounts
back into place.

Because there might be multiple nested mounts that consists of one or more
mounts stacked on top of each other, we make sure to move all stacked mounts
properly to the overlayfs. The kernel doesn't really provide a nice way to do
this, so we create a stack, pop off each mount onto the stack and then pop from
the stack again to the destination to re-establish the stacked mounts in the same
order in the destination.
2024-10-16 14:18:24 +01:00
Daan De Meyer 5e81ce42e7 sysext: Run unmerge in a subprocess
Preparation for later commit where we need a private mount namespace
for unmerge.
2024-10-16 14:18:24 +01:00
Yu Watanabe d0ad4e88d4 journalctl: erase verify key before free
Even optarg is erased, copied string was not erased.
Let's erase the copied key for safety.
2024-10-16 20:53:57 +09:00
Daan De Meyer 04f0a17e92 mount-util: Make get_submounts() a public function 2024-10-16 11:37:57 +01:00
Yu Watanabe 7693e8d9d0 test: fix TOCTOU in test-json
Follow-up for 60ae3b86fb.
Fixes CID#1563782.
2024-10-16 10:06:57 +01:00
Lennart Poettering d24d546dd1 core: move debug logging from _can_live_mount() functions to caller
Let's debug log the returned dbus error where we want the logging, but
don't log it, where we don't.

This removes the noisy logging from the property handler for the
CanLiveMount property, but keeps it in place for the MountImage() method
call where we want it.

Alternative to #34175

Follow-up for 5162829ec8 and 1cafbecabe
2024-10-16 10:50:15 +02:00
Luca Boccassi dc851222cd core: one more Mount -> LiveMount rename
Missed by earlier search-and-replace

Follow-up for 5162829ec8
2024-10-16 10:49:41 +02:00
Michael Ferrari 28dbee46d5 gpt-auto: remove directory check for ESP mount
Ensure that we always attempt to mount the `ESP` partition to `/boot`
when there is no `XBOOTLDR` partition.

Fixes an issue when booting without a `XBOOTLDR` partition and an empty
root partition, since it would mount the `ESP` partition to `/efi/`
unconditionally causing boot entries to not be under `/boot/` as
recommended by the Boot Loader Specification.
2024-10-16 10:09:38 +09:00
Yu Watanabe 770980bc13 Merge pull request #34781 from poettering/write-string-rename-full
fileio: write_string_file() naming clean-ups
2024-10-16 06:18:57 +09:00
Lennart Poettering 92881e7a4f json-util: initialize "remote" flag for PidRef when parsing JSON pidref serializations
Now that we have a way to recognize "remoteness" of a PidRef, let's make
sure when we decode a JSON pidref we initialize things that way.
2024-10-15 18:26:05 +02:00
Lennart Poettering 7e3e540b88 pidref: add explicit concept of "remote" PidRef
This PidRef just track some data, but cannot be used for any active
operation.

Background: for https://github.com/systemd/systemd/pull/34703 it makes
sense to track explicitly if some PidRef is not a local one, so that we
never attempt to for example "kill a remote process" and thus
acccidentally hit the wrong process (i.e. a local one by the same PID).
2024-10-15 18:26:05 +02:00
Lennart Poettering 518632ce1e debug-generator: create prefix dir of generate unit file
Strictly speaking, it's more correct if we create the prefix path before
writing our unit file.
2024-10-15 18:21:04 +02:00
Lennart Poettering 5048a6bd65 dropin: use WRITE_STRING_FILE_MKDIR_0755 to create drop-in prefix path 2024-10-15 18:21:00 +02:00
Lennart Poettering db21bf5ae9 shared: modernize drop_in_file() a bit
Make the return parameters optional, since we don't actually need them
in all cases (see later commits).
2024-10-15 18:20:57 +02:00
Lennart Poettering 8a0adc973a fileio: clean up write_string_file() naming
let's rename the "_ts" flavour of these calls "_full" instead, exposing
the full functionality. And then keep two more minimal versions around:
one "_at" (which has the ts parameter suppressed, but keeps the dir_fd
one). And one without suffix (which supresses both).

Do the same for the label versions of these calls.
2024-10-15 18:20:27 +02:00
Luca Boccassi e1efa9d804 core: do not fail if ignorable img.v/ vpick dir is missing
Do not fail if the directory is missing entirely, other than just empty

Follow-up for 00f546e25e
Follow-up for 5e79dd96a8
Follow-up for 622efc544d
2024-10-15 18:17:25 +02:00
Lennart Poettering c83818edd1 Merge pull request #34778 from poettering/userdb-error-tweak
userdb: handle userbd replies indicating invalid user/group names like record not found
2024-10-15 18:17:06 +02:00
Lennart Poettering 34599ddfc6 Merge pull request #34747 from yuwata/busctl-json-fd
busctl: dump passed fd info
2024-10-15 14:38:18 +02:00
Lennart Poettering 69cc4ee134 userdb: return ESRCH if userdb service refuses a user/group name as invalid
if a userdb service refuse a user/group name as invalid, let's turn this
into ESRCH client-side following that there definitely is no user/group
record for a completely invalid user/group name.

Replaces: #34558
2024-10-15 14:15:21 +02:00
Lennart Poettering 12641ecd67 sd-varlink: add new sd_varlink_error_is_invalid_parameter() helper 2024-10-15 14:15:21 +02:00
Lennart Poettering 59577d2416 network: add AF_TO_ADDRESS_FAMILY() helper
Make some code a bit shorter.
2024-10-15 20:44:39 +09:00
Yu Watanabe 7a3ee9217e machine: add MachineImage interface
Follow-up for fb0ea6a6a3.
Fixes #34772.
2024-10-15 20:44:13 +09:00
Yu Watanabe d115bd5ab4 Merge pull request #34771 from ZLima12/run0-root-working-directory
run: fix bug causing run0 to ignore `-D /`.
2024-10-15 20:43:47 +09:00
Yu Watanabe a5f2609828 Merge pull request #34442 from yuwata/network-dhcp6-information-requesting-ia-pd
network/dhcp6: allow to request IA_PD on information requesting mode
2024-10-15 20:42:46 +09:00
Yu Watanabe ba0d3d490f busctl: show information of passed file descriptor 2024-10-15 19:09:38 +09:00
Yu Watanabe 60ae3b86fb sd-json: introduce json_variant_new_fd_info()
Currently this is not used, but will be used later.
2024-10-15 19:09:38 +09:00
Yu Watanabe 32944d1c7a sd-json: introduce json_variant_new_devnum() and friends 2024-10-15 19:09:38 +09:00
Yu Watanabe 28b9c823c7 fs-util: make readlink_malloc() inline 2024-10-15 19:09:38 +09:00
Yu Watanabe c284aa7bf1 busctl: minor coding style cleanups
- rename output parameter of json_transform_and_append(),
- return from call() earlier to reduce indentation,
- add several missing error messages.
2024-10-15 19:09:38 +09:00