]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 months agostdio-bridge: Use customized log message for forwarding bus 34686/head
Daan De Meyer [Thu, 10 Oct 2024 13:54:57 +0000 (15:54 +0200)] 
stdio-bridge: Use customized log message for forwarding bus

Let's more clearly indicate that we failed to set up the server
which forwards messages from the remote client to the local bus
instead of logging a generic bus client message.

12 months agostdio-bridge: Use bus_log_connect_error()
Daan De Meyer [Thu, 10 Oct 2024 13:54:37 +0000 (15:54 +0200)] 
stdio-bridge: Use bus_log_connect_error()

12 months agobus-util: Move geteuid() check out of bus_connect_system_systemd()
Daan De Meyer [Wed, 9 Oct 2024 10:10:44 +0000 (12:10 +0200)] 
bus-util: Move geteuid() check out of bus_connect_system_systemd()

Let's move this check to bus_connect_transport_systemd() so that
bus_connect_system_systemd() will only ever connect to the manager
private manager bus instance and fail otherwise.

12 months agobus-util: Drop fallback to system/user bus if manager bus doesn't work
Daan De Meyer [Wed, 9 Oct 2024 09:44:34 +0000 (11:44 +0200)] 
bus-util: Drop fallback to system/user bus if manager bus doesn't work

We have various callsites that explicitly need the manager bus and
won't work with the system bus, like daemon-reexec and friends which
can't properly wait until the operation has finished unless using the
manager bus.

If we silently fall back to the system bus for these operations, we
can end up with rather hard to debug issues so let's remove the fallback
as it was added back in 2013 in a6aa89122d2fa5e811a72200773068c13bfffea2
without a clear explanation of why it was needed (I expect as a fallback
if kdbus wasn't available but that's not a thing anymore these days).

12 months agoupdate-utmp: Make reconnect logic more robust
Daan De Meyer [Wed, 9 Oct 2024 14:37:06 +0000 (16:37 +0200)] 
update-utmp: Make reconnect logic more robust

We might also fail to connect to the private manager bus itself if
the daemon-reexec is still ongoing, so let's handle that as well by
retrying on ECONNREFUSED.

12 months agomkosi: Fix up ownership of testuser home directory on first boot
Daan De Meyer [Wed, 9 Oct 2024 12:49:07 +0000 (14:49 +0200)] 
mkosi: Fix up ownership of testuser home directory on first boot

When building unprivileged, the testuser home directory ends up
owned by root:root because mkosi can't chown directories to other
owners when running unprivileged. So let's fix up the testuser
ownership on first boot with tmpfiles instead.

12 months agoMerge pull request #34707 from YHNdnzj/user-manager-reexec
Daan De Meyer [Fri, 11 Oct 2024 09:34:24 +0000 (11:34 +0200)] 
Merge pull request #34707 from YHNdnzj/user-manager-reexec

core: fix STATUS=Ready for user manager; units/user@.service: issue daemon-reexec when notify-reloading

12 months agorpm/systemd-update-helper: Use systemctl reload to reexec/reload user managers 34707/head
Daan De Meyer [Thu, 10 Oct 2024 20:37:39 +0000 (22:37 +0200)] 
rpm/systemd-update-helper: Use systemctl reload to reexec/reload user managers

Let's always use systemctl reload to reexec and reload user managers
now that it always implies a reexec. This moves all the job management
logic to pid 1 instead of bash and reduces the complexity of the logic
as we remove systemd-run, pam and systemd-stdio-bridge from the equation.

12 months agounits/{user,capsule}@.service: issue daemon-reexec when notify-reloading
Mike Yuan [Thu, 10 Oct 2024 19:32:17 +0000 (21:32 +0200)] 
units/{user,capsule}@.service: issue daemon-reexec when notify-reloading

Closes #28367 (but not really in the exact form, see below)

We have the problem of restarting all user manager instances
after upgrade. Current approaches involve systemctl kill
with SIGRTMIN+25, which is async and feels rather ugly [1][2];
or systemctl --machine=user@ --user, which requires entering
each user session. Neither is particularly elegant.
Instead, let's just signal daemon-reexec when user@.service
is reloaded from system manager. Our long goal of dropping
daemon-reload in favor of reexec (see TODO) is unlikely to happen
due to user dbus restrictions, but here the synchronization
is done via READY=1.

[1] https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/blob/main/systemd.install?ref_type=heads#L37
[2] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/systemd.postinst#L24

#28367 would not really work for us now I come to think about it,
because all processes will be reparented to pid1 as soon as
original user manager process exits. This alternative approach
seems good enough for our use case.

12 months agocore/manager-serialize: drop serialization for Manager.ready_sent
Mike Yuan [Thu, 10 Oct 2024 19:06:35 +0000 (21:06 +0200)] 
core/manager-serialize: drop serialization for Manager.ready_sent

This field indicates whether READY=1 has been sent to
the service manager/supervisor. Whenever we reload/reexec/soft-reboot,
manager_send_reloading() always resets it to false first,
so that READY=1 is sent after reloading finishes. Hence
we utterly get "false" at all times. Kill it.

12 months agocore/manager: still send out STATUS=Ready for user manager
Mike Yuan [Thu, 10 Oct 2024 19:16:05 +0000 (21:16 +0200)] 
core/manager: still send out STATUS=Ready for user manager

This effectively reverts 37d15cd132f3a8a0bf42fb252c1604e804171ff2.

The offending commit wrongly assumed that the second READY=1
notification is for system scope only, but it also serves the purpose
of flushing out previous STATUS= containing user unit job status.

12 months agoudev: allow persistent storage rules for ublk devices
Uday Shankar [Thu, 10 Oct 2024 20:29:10 +0000 (14:29 -0600)] 
udev: allow persistent storage rules for ublk devices

Tools such as lsblk which query the udev database instead of probing
devices directly fail when run on ublk devices. For instance, in the
following commands, the partition type is missing, despite the fact that
/dev/ublkb0 was just partitioned with a single Linux filesystem type
partition.

$ lsblk /dev/ublkb0
NAME       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
ublkb0     259:0    0 31.3G  0 disk
└─ublkb0p1 259:1    0 31.2G  0 part
$ lsblk -o pkname,parttype /dev/ublkb0
PKNAME PARTTYPE

ublkb0

This happens because ublk devices are missing from a couple of
whitelists in the udev rules which are responsible for populating the
database with the data lsblk is looking for. Add the ublk devices to
these whitelists.

12 months agodocs/DESKTOP_ENVIRONMENTS: fix formatting
David Rheinsberg [Fri, 11 Oct 2024 07:53:25 +0000 (09:53 +0200)] 
docs/DESKTOP_ENVIRONMENTS: fix formatting

The annotation about omittance is meant to be about the `RANDOM` string.
However, the current formatting makes it look like the entire naming
scheme is optional. Fix this.

12 months agodocs: don't mention split-usr path anymore
Lennart Poettering [Fri, 11 Oct 2024 07:55:07 +0000 (09:55 +0200)] 
docs: don't mention split-usr path anymore

We don't support split /usr/ anymore. Hence fix the paths. This
apparently matters because of PK validating the binary path.

Fixes: #34712
12 months agomkosi: fix sections for settings
Yu Watanabe [Thu, 10 Oct 2024 19:19:03 +0000 (04:19 +0900)] 
mkosi: fix sections for settings

Follow-up for 963157ca78429c51feb3103828d8cc94440956f3.

12 months agoMerge pull request #34699 from yuwata/netlink-cleanups
Yu Watanabe [Thu, 10 Oct 2024 19:30:16 +0000 (04:30 +0900)] 
Merge pull request #34699 from yuwata/netlink-cleanups

sd-netlink: several cleanups

12 months agosd-netlink: introduce two more _get_family() 34699/head
Yu Watanabe [Thu, 10 Oct 2024 05:45:11 +0000 (14:45 +0900)] 
sd-netlink: introduce two more _get_family()

Then, use them in sd_rtnl_message_get_family().

12 months agosd-netlink,network: rename functions and RoutingPolicyRule.type
Yu Watanabe [Thu, 10 Oct 2024 05:36:28 +0000 (14:36 +0900)] 
sd-netlink,network: rename functions and RoutingPolicyRule.type

To make them consistent to the netlink message header.
No functional change, just refactoring.

12 months agosd-netlink: introduce macros to define sd_rtnl_message setters and getters
Yu Watanabe [Thu, 10 Oct 2024 05:24:43 +0000 (14:24 +0900)] 
sd-netlink: introduce macros to define sd_rtnl_message setters and getters

12 months agosd-netlink: make size verifier in sd_netlink_message_read_xyz() stricter
Yu Watanabe [Thu, 10 Oct 2024 03:45:39 +0000 (12:45 +0900)] 
sd-netlink: make size verifier in sd_netlink_message_read_xyz() stricter

Also, fill remaining output buffer with zero, for safety.

12 months agosd-netlink: shorten sd_netlink_message_read_string_strdup() a bit
Yu Watanabe [Thu, 10 Oct 2024 03:43:57 +0000 (12:43 +0900)] 
sd-netlink: shorten sd_netlink_message_read_string_strdup() a bit

12 months agosd-netlink: various cleanups
Yu Watanabe [Thu, 10 Oct 2024 03:30:41 +0000 (12:30 +0900)] 
sd-netlink: various cleanups

- use uint8_t, uint16_t, and so on, rather than unsigned char, unsigned
  short, and so on, respectively,
- rename output parameters to ret or ret_xyz,
- add several missing assertions.

12 months agoman: reword comment a bit regarding ExecStartPre= multiple commands
Lennart Poettering [Mon, 7 Oct 2024 07:37:24 +0000 (09:37 +0200)] 
man: reword comment a bit regarding ExecStartPre= multiple commands

The documentation claimed that ExecStartPre=/ExecStartPost= accepts
multiple command lines, in contrast to ExecStart=. This is half an
untruth, because ExecStart= allows that too – as long as Type=oneshot is
set.

Hence, reword this a bit, and do not emphasize the contrast.

Prompted by: #34570

12 months agoukify: Fix systemd-measure detection in tests
Jörg Behrmann [Thu, 10 Oct 2024 11:52:31 +0000 (13:52 +0200)] 
ukify: Fix systemd-measure detection in tests

Fixes: 206fa93c854e3d5c94e56da9b53e107245f31503
12 months agoMerge pull request #34684 from yuwata/login-scheduled-shutdown
Yu Watanabe [Thu, 10 Oct 2024 10:32:52 +0000 (19:32 +0900)] 
Merge pull request #34684 from yuwata/login-scheduled-shutdown

login: allow to cancel delayed action by CancelScheduledShutdown()

12 months agosd-event: rename output parameters to ret
Yu Watanabe [Thu, 10 Oct 2024 01:01:24 +0000 (10:01 +0900)] 
sd-event: rename output parameters to ret

12 months agomachined: use sd_json_dispatch_uint() when parsing CID
Lennart Poettering [Wed, 9 Oct 2024 20:02:10 +0000 (22:02 +0200)] 
machined: use sd_json_dispatch_uint() when parsing CID

This is preferable, because we will accept CIDs encoded as strings too
now, as we do for all other integers. Also, it's shorter. Yay!

12 months agoukify: fix return value type of resolve_at_path()
Yu Watanabe [Thu, 10 Oct 2024 00:33:47 +0000 (09:33 +0900)] 
ukify: fix return value type of resolve_at_path()

Follow-up for eca003de2f3a708c44946d36af6517cbcf3392ff.

12 months agonetwork/dhcp4: add support for ARPHRD_RAWIP and ARPHRD_NONE network interface types
Darsey Litzenberger [Wed, 9 Oct 2024 19:55:42 +0000 (13:55 -0600)] 
network/dhcp4: add support for ARPHRD_RAWIP and ARPHRD_NONE network interface types

This should fix QMI wwan modems, as noted in
https://github.com/systemd/systemd/issues/27219

12 months agorepart: fix typo
Yu Watanabe [Wed, 9 Oct 2024 20:30:08 +0000 (05:30 +0900)] 
repart: fix typo

Follow-up for d3032e651e2131c47d276e3fbdcbdf9fc51c8ef9.

12 months agocore/mount: fix typo
Yu Watanabe [Wed, 9 Oct 2024 20:29:05 +0000 (05:29 +0900)] 
core/mount: fix typo

Follow-up for 00ad3f02275b507a753495ace5e5f84cb38b604d.

12 months agoMerge pull request #34687 from DaanDeMeyer/mkosi
Yu Watanabe [Wed, 9 Oct 2024 20:26:14 +0000 (05:26 +0900)] 
Merge pull request #34687 from DaanDeMeyer/mkosi

Various fixes

12 months agostub: reindent lines
Yu Watanabe [Wed, 9 Oct 2024 17:29:11 +0000 (02:29 +0900)] 
stub: reindent lines

Follow-up for 2ea0487c1be4203ba3664d249418317846f55c1a.

12 months agomkosi: Fix sections for settings 34687/head
Daan De Meyer [Fri, 4 Oct 2024 12:22:35 +0000 (14:22 +0200)] 
mkosi: Fix sections for settings

Upstream we moved settings around a bit to different sections, let's
adapt to those changes in the systemd repo.

12 months agomkosi: Update to latest
Daan De Meyer [Fri, 4 Oct 2024 12:22:27 +0000 (14:22 +0200)] 
mkosi: Update to latest

12 months agomkosi: Remove particle profile
Daan De Meyer [Fri, 4 Oct 2024 12:09:48 +0000 (14:09 +0200)] 
mkosi: Remove particle profile

We have https://github.com/systemd/particleos for testing the particle
stuff so let's drop it from the systemd repo as it's bit rotting.

12 months agoefi-loader: Add @ to valid characters
Daan De Meyer [Sat, 5 Oct 2024 10:20:50 +0000 (12:20 +0200)] 
efi-loader: Add @ to valid characters

This is now a valid character with the introduction of multi UKI
profiles, so update the function to allow it.

12 months agoboot: Introduce file_size and use it when we're working with file_offset
Daan De Meyer [Fri, 4 Oct 2024 10:40:32 +0000 (12:40 +0200)] 
boot: Introduce file_size and use it when we're working with file_offset

When we're reading a section from disk, use file_size to use the
size on disk instead of the size in memory.

12 months agoboot: Rename pe section size to memory_size
Daan De Meyer [Fri, 4 Oct 2024 08:22:37 +0000 (10:22 +0200)] 
boot: Rename pe section size to memory_size

Let's clearly indicate this is the size in memory and not the size
on disk, these two are not guaranteed to be the same.

12 months agoukify: Read .profile from path starting with @
Daan De Meyer [Sat, 5 Oct 2024 15:01:21 +0000 (17:01 +0200)] 
ukify: Read .profile from path starting with @

12 months agoukify: Introduce resolve_at_path()
Daan De Meyer [Mon, 7 Oct 2024 09:29:40 +0000 (11:29 +0200)] 
ukify: Introduce resolve_at_path()

12 months agoMerge pull request #34665 from poettering/fastopen-fallback
Yu Watanabe [Wed, 9 Oct 2024 18:21:35 +0000 (03:21 +0900)] 
Merge pull request #34665 from poettering/fastopen-fallback

resolved: fix MSG_FASTOPEN fallback logic

12 months agoukify: Fix off by one error
Daan De Meyer [Sat, 5 Oct 2024 10:14:14 +0000 (12:14 +0200)] 
ukify: Fix off by one error

We weren't measuring the profile section itself.

12 months agoMerge pull request #34641 from behrmann/ukifystyle
Yu Watanabe [Wed, 9 Oct 2024 17:21:29 +0000 (02:21 +0900)] 
Merge pull request #34641 from behrmann/ukifystyle

Type annotate and format ukify

12 months agologind: add comment why we save action in execute_shutdown_or_sleep() 34684/head
Yu Watanabe [Wed, 9 Oct 2024 16:50:29 +0000 (01:50 +0900)] 
logind: add comment why we save action in execute_shutdown_or_sleep()

When I first read the code, I was confused about that. Hopefully, this
helps maintain code a bit.

12 months agologin: use event_reset_time_relative() at one more place
Yu Watanabe [Wed, 9 Oct 2024 00:22:07 +0000 (09:22 +0900)] 
login: use event_reset_time_relative() at one more place

12 months agologin: provide delayed action in ScheduledShutdown property
Yu Watanabe [Wed, 9 Oct 2024 01:07:31 +0000 (10:07 +0900)] 
login: provide delayed action in ScheduledShutdown property

Even though we can get the existence of delayed action through
PreparingForShutdownWithMetadata property or friends, for consistency
with CancelScheduledShutdown() method, it is better to also provide the
information through ScheduledShutdown property.

12 months agologin: allow to cancel delayed action by CancelScheduledShutdown()
Yu Watanabe [Wed, 9 Oct 2024 00:42:52 +0000 (09:42 +0900)] 
login: allow to cancel delayed action by CancelScheduledShutdown()

Fixes #34554.

12 months agoMerge pull request #34636 from WilliButz/repart/verity-hash-max-data-size
Yu Watanabe [Wed, 9 Oct 2024 15:51:40 +0000 (00:51 +0900)] 
Merge pull request #34636 from WilliButz/repart/verity-hash-max-data-size

repart: support verity hash partitions sized for custom data size

12 months agoMerge pull request #34691 from poettering/polkit-varlink-field-macro
Yu Watanabe [Wed, 9 Oct 2024 15:44:29 +0000 (00:44 +0900)] 
Merge pull request #34691 from poettering/polkit-varlink-field-macro

polkit: introduce common macro for generating polkit allowInteractive…

12 months agonetwork/sysctl-monitor: change variable type to avoid preverifier denial
Matteo Croce [Sun, 6 Oct 2024 21:26:30 +0000 (23:26 +0200)] 
network/sysctl-monitor: change variable type to avoid preverifier denial

The compiler clones the u32 i variable to another register, and fails to
calculate the range of possible values, so the verification fails.

    libbpf: prog 'sysctl_monitor': BPF program load failed: Permission denied
    libbpf: prog 'sysctl_monitor': -- BEGIN PROG LOAD LOG --
    0: R1=ctx() R10=fp0
    ; int sysctl_monitor(struct bpf_sysctl *ctx) { @ sysctl-monitor.bpf.c:65
    0: (bf) r6 = r1                       ; R1=ctx() R6_w=ctx()
    ; if (bpf_current_task_under_cgroup(&cgroup_map, 0)) @ sysctl-monitor.bpf.c:69
    1: (18) r1 = 0xffff892a0fda9c00       ; R1_w=map_ptr(map=cgroup_map,ks=4,vs=4)
    3: (b7) r2 = 0                        ; R2_w=0
    4: (85) call bpf_current_task_under_cgroup#37         ; R0_w=scalar()
    5: (55) if r0 != 0x0 goto pc+88       ; R0_w=0
    ; if (!ctx->write) @ sysctl-monitor.bpf.c:73
    6: (61) r1 = *(u32 *)(r6 +0)          ; R1_w=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff)) R6_w=ctx()
    7: (15) if r1 == 0x0 goto pc+86       ; R1_w=scalar(smin=umin=umin32=1,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
    8: (b7) r1 = 1                        ; R1_w=1
    ; we.version = 1; @ sysctl-monitor.bpf.c:81
    9: (7b) *(u64 *)(r10 -480) = r1       ; R1_w=1 R10=fp0 fp-480_w=1
    10: (b7) r8 = 0                       ; R8_w=0
    ; we.path[0] = 0; @ sysctl-monitor.bpf.c:83
    11: (73) *(u8 *)(r10 -440) = r8       ; R8_w=0 R10=fp0 fp-440=???????0
    ; we.newvalue[0] = 0; @ sysctl-monitor.bpf.c:86
    12: (73) *(u8 *)(r10 -180) = r8       ; R8_w=0 R10=fp0 fp-184=???0????
    ; we.current[0] = 0; @ sysctl-monitor.bpf.c:85
    13: (73) *(u8 *)(r10 -340) = r8       ; R8_w=0 R10=fp0 fp-344=???0????
    ; we.comm[0] = 0; @ sysctl-monitor.bpf.c:84
    14: (73) *(u8 *)(r10 -456) = r8       ; R8_w=0 R10=fp0 fp-456=???????0
    ; we.pid = bpf_get_current_pid_tgid() >> 32; @ sysctl-monitor.bpf.c:89
    15: (85) call bpf_get_current_pid_tgid#14     ; R0=scalar()
    16: (77) r0 >>= 32                    ; R0_w=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
    17: (63) *(u32 *)(r10 -472) = r0      ; R0_w=scalar(id=1,smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff)) R10=fp0 fp-472=????scalar(id=1,smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
    ; we.cgroup_id = bpf_get_current_cgroup_id(); @ sysctl-monitor.bpf.c:90
    18: (85) call bpf_get_current_cgroup_id#80    ; R0_w=s
    libbpf: prog 'sysctl_monitor': failed to load: -13
    libbpf: failed to load object 'sysctl_monitor_bpf'
    libbpf: failed to load BPF skeleton 'sysctl_monitor_bpf': -13
    Unable to load sysctl monitor BPF program, ignoring: Permission denied.

Change the type to u64 to fix it.

12 months agonamespace: rename drop_unused_mounts() → sort_and_drop_unused_mounts()
Lennart Poettering [Wed, 9 Oct 2024 13:39:30 +0000 (15:39 +0200)] 
namespace: rename drop_unused_mounts() → sort_and_drop_unused_mounts()

The function sorts the listed mounts, and that's kinda key, hence
reflect that in the name.

12 months agoupdate TODO 34691/head
Lennart Poettering [Wed, 9 Oct 2024 13:41:39 +0000 (15:41 +0200)] 
update TODO

12 months agopolkit: introduce common macro for generating polkit allowInteractiveAuth varlink...
Lennart Poettering [Wed, 9 Oct 2024 13:40:13 +0000 (15:40 +0200)] 
polkit: introduce common macro for generating polkit allowInteractiveAuth varlink method call IDL field

We define the same field at many places, let's add a macro with it, that
also contains a suitable description comment.

12 months agostub: Add support for .initrd addon files
Tobias Fleig [Tue, 8 Oct 2024 14:54:43 +0000 (07:54 -0700)] 
stub: Add support for .initrd addon files

Teaches systemd-stub how to load additional initrds from addon files.
This is very similar to the support for .ucode sections in addon files,
but with different ordering. Initrds from addons have a chance to
overwrite files from the base initrd in the UKI.

12 months agotest/repart: add test case for hash size derived from max data size 34636/head
WilliButz [Fri, 4 Oct 2024 17:59:10 +0000 (19:59 +0200)] 
test/repart: add test case for hash size derived from max data size

12 months agorepart: derive hash partition size from SizeMaxBytes= of data sibling
WilliButz [Fri, 4 Oct 2024 17:51:57 +0000 (19:51 +0200)] 
repart: derive hash partition size from SizeMaxBytes= of data sibling

This change makes it possible for repart to create dm-verity hash
partitions for a custom amount of protected data. When the property
`SizeMaxBytes=` is specified for a dm-verity data partition, the size
of the corresponding hash partition is set to accommodate hash data
for this maximum size, rather than the actual contents its data
sibling. However, the contained hash data continues to be generated
from said sibling.

12 months agoukify: Factor out sbat into constants 34641/head
Jörg Behrmann [Wed, 9 Oct 2024 10:06:32 +0000 (12:06 +0200)] 
ukify: Factor out sbat into constants

12 months agoci: Check ukify types and formatting.
Jörg Behrmann [Sat, 5 Oct 2024 10:20:57 +0000 (12:20 +0200)] 
ci: Check ukify types and formatting.

12 months agoukify: Ensure that find_tool always returns a tool or throws an error
Jörg Behrmann [Sat, 5 Oct 2024 10:07:49 +0000 (12:07 +0200)] 
ukify: Ensure that find_tool always returns a tool or throws an error

This also makes the error message configurable, so that find_sbsign and
find_pesign can be inlined again.

12 months agoukify: Move summary option handling out of finalize_options
Jörg Behrmann [Sat, 5 Oct 2024 09:53:35 +0000 (11:53 +0200)] 
ukify: Move summary option handling out of finalize_options

This way finalize_options will not call sys.exit by itself.

12 months agoukify: Type-annotate ukify
Jörg Behrmann [Fri, 4 Oct 2024 22:15:42 +0000 (00:15 +0200)] 
ukify: Type-annotate ukify

12 months agoukify: Make it lint clean
Jörg Behrmann [Fri, 4 Oct 2024 14:38:07 +0000 (16:38 +0200)] 
ukify: Make it lint clean

12 months agoukify: Use OSError insteead of IOError
Jörg Behrmann [Fri, 4 Oct 2024 14:28:33 +0000 (16:28 +0200)] 
ukify: Use OSError insteead of IOError

The latter was deprecated for the former and is only an alias for it.

12 months agoukify: Use non-deprecated import for Sequence
Jörg Behrmann [Fri, 4 Oct 2024 14:26:30 +0000 (16:26 +0200)] 
ukify: Use non-deprecated import for Sequence

12 months agoukify: Sort imports
Jörg Behrmann [Fri, 4 Oct 2024 14:24:39 +0000 (16:24 +0200)] 
ukify: Sort imports

12 months agoukify: Import Path directly
Jörg Behrmann [Fri, 4 Oct 2024 14:21:48 +0000 (16:21 +0200)] 
ukify: Import Path directly

12 months agoukify: Format with ruff
Jörg Behrmann [Fri, 4 Oct 2024 14:20:07 +0000 (16:20 +0200)] 
ukify: Format with ruff

12 months agoMerge pull request #34679 from DaanDeMeyer/bus-log
Daan De Meyer [Wed, 9 Oct 2024 09:42:26 +0000 (11:42 +0200)] 
Merge pull request #34679 from DaanDeMeyer/bus-log

Various logging improvements

12 months agoMerge pull request #34656 from yuwata/private-users
Lennart Poettering [Wed, 9 Oct 2024 08:39:30 +0000 (10:39 +0200)] 
Merge pull request #34656 from yuwata/private-users

core: drop implicit support of PrivateUsers=off

12 months agoMerge pull request #34651 from yuwata/polkit-transient-unit
Lennart Poettering [Wed, 9 Oct 2024 08:35:19 +0000 (10:35 +0200)] 
Merge pull request #34651 from yuwata/polkit-transient-unit

dbus: pass transient unit name metadata to polkit

12 months agohwdb: move key 66/65 handling from specific to generic HP laptop coverage
Lennart Poettering [Wed, 9 Oct 2024 07:14:12 +0000 (09:14 +0200)] 
hwdb: move key 66/65 handling from specific to generic HP laptop coverage

This takes the idea from #18595 and implements it based on our current
hwdb: the original PR suggested the keys 66/65 are a generic HP thing,
and not limited to specific laptops. The current specific laptop entries
do not contradict that claim.

Hence, let's move them from the specific sections matching some HP
laptops to the generic section matching all.

This uses the correct key names, which have long been fixed (which used
to be a problem our CI was tripped off by).

This is not tested, but I think fairly risk-less, and should allow us to
get rid of a really old PR.

Replaces: #18595

12 months agocore: Log in more scenarios about which process initiated an operation 34679/head
Daan De Meyer [Tue, 8 Oct 2024 14:28:25 +0000 (16:28 +0200)] 
core: Log in more scenarios about which process initiated an operation

Exit/Reboot/Poweroff and similar operations are invasive enough that
logging about who initiated them is very useful to debug issues.

12 months agocore: Bump log level of reexecute request to notice
Daan De Meyer [Tue, 8 Oct 2024 14:25:52 +0000 (16:25 +0200)] 
core: Bump log level of reexecute request to notice

A daemon-reload is important enough to deserve logging at notice
level.

12 months agobus-util: Log more information when connecting to a bus socket fails
Daan De Meyer [Tue, 8 Oct 2024 14:22:58 +0000 (16:22 +0200)] 
bus-util: Log more information when connecting to a bus socket fails

Let's log about which bus we're trying to connect to and what transport
we're using to do it.

12 months agoMerge pull request #34593 from Werkov/deprecate-aux-scopes
Lennart Poettering [Wed, 9 Oct 2024 08:25:30 +0000 (10:25 +0200)] 
Merge pull request #34593 from Werkov/deprecate-aux-scopes

core/manager: Deprecate StartAuxiliaryScope() method

12 months agoMerge pull request #34671 from yuwata/memory
Lennart Poettering [Wed, 9 Oct 2024 08:24:10 +0000 (10:24 +0200)] 
Merge pull request #34671 from yuwata/memory

tree-wide: several memory accounting cleanups

12 months agoNEWS: announce the F20/F21/F22/F23 key mangling removal scheduled for v258
Lennart Poettering [Wed, 9 Oct 2024 07:03:29 +0000 (09:03 +0200)] 
NEWS: announce the F20/F21/F22/F23 key mangling removal scheduled for v258

As per: https://github.com/systemd/systemd/pull/34325
And: https://github.com/systemd/systemd/issues/34323

12 months agoupdate TODO
Lennart Poettering [Wed, 9 Oct 2024 06:52:30 +0000 (08:52 +0200)] 
update TODO

12 months agocore: drop implicit support of PrivateTmp=off 34656/head
Yu Watanabe [Tue, 8 Oct 2024 20:49:00 +0000 (05:49 +0900)] 
core: drop implicit support of PrivateTmp=off

Follow-up for 0e551b04efb911d38b586cca1a6a462c87a2cb1b.

Similar to the previous commit, but for PrivateTmp=.

12 months agocore/dbus: pass transient unit name metadata to polkit 34651/head
Renjaya Raga Zenta [Tue, 1 Oct 2024 04:34:51 +0000 (11:34 +0700)] 
core/dbus: pass transient unit name metadata to polkit

Fixes #17224

12 months agocore/dbus: add assertions
Yu Watanabe [Tue, 8 Oct 2024 21:57:06 +0000 (06:57 +0900)] 
core/dbus: add assertions

12 months agocore/dbus: introduce bus_verify_manage_units_async_impl()
Yu Watanabe [Tue, 8 Oct 2024 21:28:06 +0000 (06:28 +0900)] 
core/dbus: introduce bus_verify_manage_units_async_impl()

Then, make bus_verify_manage_units_async() and _full() inline.

Co-authored-by: Renjaya Raga Zenta <ragazenta@gmail.com>
12 months agocore/dbus: move bus_verify_xyz() to dbus-util.c
Yu Watanabe [Tue, 8 Oct 2024 21:08:11 +0000 (06:08 +0900)] 
core/dbus: move bus_verify_xyz() to dbus-util.c

12 months agomount: optimize mountinfo traversal by decoupling device discovery
Chen Guanqiao [Wed, 2 Oct 2024 05:10:21 +0000 (13:10 +0800)] 
mount: optimize mountinfo traversal by decoupling device discovery

In mount_load_proc_self_mountinfo(), device_found_node() is synchronously called
during the traversal of mountinfo entries. When there are a large number of
mount points, and the device types are not significantly different, this results
in excessive time consumption during device discovery, causing a performance
bottleneck. This issue is particularly prominent on servers with a large number
of cores in IDC.

This patch decouples device discovery from the mountinfo traversal process,
avoiding redundant device operations. As a result, it significantly improves
performance, especially in environments with numerous mount points.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
12 months agocore: drop implicit support of PrivateUsers=off
Yu Watanabe [Mon, 7 Oct 2024 04:40:55 +0000 (13:40 +0900)] 
core: drop implicit support of PrivateUsers=off

Follow-up for fa693fdc7e17618958c505af4b2f39ecd1c3363e.

The documentation says the option takes a boolean or one of the "self"
and "identity". But the parser uses private_users_from_string() which
also accepts "off". Let's drop the implicit support of "off".

12 months agooomd: separate entries with comma for readability 34671/head
Yu Watanabe [Tue, 8 Oct 2024 03:27:44 +0000 (12:27 +0900)] 
oomd: separate entries with comma for readability

12 months agooomd: update system context when oomctl is invoked
Yu Watanabe [Tue, 8 Oct 2024 03:26:52 +0000 (12:26 +0900)] 
oomd: update system context when oomctl is invoked

Otherwise, oomctl shows 0 memory and swap usage when swap monitoring
is not enabled.
=======
$ oomctl
Dry Run: no
Swap Used Limit: 90.00%
Default Memory Pressure Limit: 60.00%
Default Memory Pressure Duration: 20s
System Context:
        Memory: Used: 0B Total: 0B
        Swap: Used: 0B Total: 0B
Swap Monitored CGroups:
Memory Pressure Monitored CGroups:
...
======

12 months agooomd: drop unused usec_now
Yu Watanabe [Tue, 8 Oct 2024 03:12:25 +0000 (12:12 +0900)] 
oomd: drop unused usec_now

12 months agosystemctl: separate memory usage with comma
Yu Watanabe [Tue, 8 Oct 2024 02:07:47 +0000 (11:07 +0900)] 
systemctl: separate memory usage with comma

Just for readability.

Before:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
     Memory: 4.7M (peak: 14.3M swap: 1M swap peak: 1.1M)

After:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
     Memory: 4.7M (peak: 14.3M, swap: 1M, swap peak: 1.1M)

12 months agocore: suppress one debugging log
Yu Watanabe [Mon, 7 Oct 2024 21:19:04 +0000 (06:19 +0900)] 
core: suppress one debugging log

Otherwise, the log is shown even when getting properties.
Even though it is in the debug level, that's quite noisy.

[  338.785847] TEST-55-OOMD.sh[1624]: Oct 07 16:35:15 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.786985] TEST-55-OOMD.sh[1624]: Oct 07 16:35:17 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.787412] TEST-55-OOMD.sh[1624]: Oct 07 16:35:20 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.791776] TEST-55-OOMD.sh[1624]: Oct 07 16:35:22 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.792938] TEST-55-OOMD.sh[1624]: Oct 07 16:35:24 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793225] TEST-55-OOMD.sh[1624]: Oct 07 16:35:26 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.793424] TEST-55-OOMD.sh[1624]: Oct 07 16:35:28 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.796448] TEST-55-OOMD.sh[1624]: Oct 07 16:35:31 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.797997] TEST-55-OOMD.sh[1624]: Oct 07 16:35:33 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount
[  338.799206] TEST-55-OOMD.sh[1624]: Oct 07 16:35:35 H systemd[1]: TEST-55-OOMD-testmunch.service: Unit not running in private mount namespace, cannot live mount

12 months agoMerge pull request #34675 from poettering/dupfd-query
Luca Boccassi [Tue, 8 Oct 2024 18:30:57 +0000 (19:30 +0100)] 
Merge pull request #34675 from poettering/dupfd-query

fd-util: use F_DUPFD_QUERY for same_fd()

12 months agoMerge pull request #34674 from yuwata/reallocarray
Luca Boccassi [Tue, 8 Oct 2024 18:27:43 +0000 (19:27 +0100)] 
Merge pull request #34674 from yuwata/reallocarray

tree-wide: replace reallocarray() with GREEDY_REALLOC()

12 months agoMerge pull request #34672 from yuwata/timestamp
Luca Boccassi [Tue, 8 Oct 2024 18:21:28 +0000 (19:21 +0100)] 
Merge pull request #34672 from yuwata/timestamp

analyze: fix timestamp

12 months agocore/manager: Deprecate StartAuxiliaryScope() method 34593/head
Michal Koutný [Mon, 30 Sep 2024 17:27:29 +0000 (19:27 +0200)] 
core/manager: Deprecate StartAuxiliaryScope() method

The method was added with migration of resources in mind (e.g. process's
allocated memory will follow it to the new scope), however, such a
resource migration is not in cgroup semantics. The method may thus have
the intended users and others could be guided to StartTransientUnit().

Since this API was advertised in a regular release, start the removal
with a deprecation message to callers.
Eventually, the goal is to remove the method to clean up DBus API and
simplify code (removal of cgroup_context_copy()).

Part of DBus docs is retained to satisfy build checks.

12 months agoMerge pull request #34678 from kalrish/documentation-fixes
Luca Boccassi [Tue, 8 Oct 2024 14:44:55 +0000 (15:44 +0100)] 
Merge pull request #34678 from kalrish/documentation-fixes

Fix little errors in man pages `machinectl(1)` and `systemd-nspawn(1)`

12 months agoman: `machinectl(1)`: Fix description of subcommand `poweroff` 34678/head
David Joaquín Shourabi Porcel [Tue, 8 Oct 2024 13:20:26 +0000 (15:20 +0200)] 
man: `machinectl(1)`: Fix description of subcommand `poweroff`

12 months agoman: `systemd-nspawn(1)`: Fix some typos
David Joaquín Shourabi Porcel [Fri, 12 Apr 2024 20:14:47 +0000 (22:14 +0200)] 
man: `systemd-nspawn(1)`: Fix some typos

12 months agoMerge pull request #34556 from ryantimwilson/extra-fds
Lennart Poettering [Tue, 8 Oct 2024 11:26:59 +0000 (13:26 +0200)] 
Merge pull request #34556 from ryantimwilson/extra-fds

Add ExtraFileDescriptor property to StartTransientUnit dbus API

12 months agofd-util: use F_DUPFD_QUERY for same_fd() 34675/head
Lennart Poettering [Tue, 8 Oct 2024 08:01:22 +0000 (10:01 +0200)] 
fd-util: use F_DUPFD_QUERY for same_fd()

Catch up with the nice little toys the kernel fs developers have added
for us. Preferably, let's make use of the new F_DUPFD_QUERY fcntl() call
that checks whether two fds are just duplicates of each other
(duplicates as in dup(), not as in open() of the same inode, i.e.
whether they share a single file offset and so on).

This API is much nicer, since it is a core kernel feature, unlike the
kcmp() call we so far used, which is part of the (optional)
checkpoint/restore stuff.

F_DUPFD_QUERY is available since kernel 6.10.