| Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
We don't support split /usr/ anymore. Hence fix the paths. This
apparently matters because of PK validating the binary path.
Fixes: #34712
|
|
Follow-up for 963157ca78429c51feb3103828d8cc94440956f3.
|
|
Then, use them in sd_rtnl_message_get_family().
|
|
To make them consistent to the netlink message header.
No functional change, just refactoring.
|
|
|
|
Also, fill remaining output buffer with zero, for safety.
|
|
|
|
- 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.
|
|
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
|
|
Fixes: 206fa93c854e3d5c94e56da9b53e107245f31503
|
|
|
|
|
|
interfaces
This commit includes adding introduce manager_get_machine_by_pidref() as a replacement for manager_get_machine_by_pid()
and moving surrounding code to utilise PidRef.
|
|
|
|
|
|
|
|
Unregister} methods
|
|
|
|
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!
|
|
Follow-up for eca003de2f3a708c44946d36af6517cbcf3392ff.
|
|
interface types
This should fix QMI wwan modems, as noted in
https://github.com/systemd/systemd/issues/27219
|
|
Follow-up for d3032e651e2131c47d276e3fbdcbdf9fc51c8ef9.
|
|
Follow-up for 00ad3f02275b507a753495ace5e5f84cb38b604d.
|
|
Follow-up for 2ea0487c1be4203ba3664d249418317846f55c1a.
|
|
Upstream we moved settings around a bit to different sections, let's
adapt to those changes in the systemd repo.
|
|
|
|
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.
|
|
This is now a valid character with the introduction of multi UKI
profiles, so update the function to allow it.
|
|
When we're reading a section from disk, use file_size to use the
size on disk instead of the size in memory.
|
|
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.
|
|
|
|
|
|
We weren't measuring the profile section itself.
|
|
When I first read the code, I was confused about that. Hopefully, this
helps maintain code a bit.
|
|
|
|
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.
|
|
Fixes #34554.
|
|
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.
|
|
The function sorts the listed mounts, and that's kinda key, hence
reflect that in the name.
|
|
|
|
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.
|
|
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.
|
|
|
|
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.
|