Commit Graph
76713 Commits
Author SHA1 Message Date
Lennart Poettering 373c810e04 Merge pull request #34681 from ikruglov/ikruglov/io-systemd-Machine-post-merge-review
machine: address post-merge review #34623
2024-10-11 12:15:56 +02:00
Lennart Poettering d693c483a2 seccomp: allowlist uretprobe() syscall
This is a new syscall provided by the kernel used to implement faster
uprobes. It's not supposed to be called by userspace, but only by kernel
generated uprobe code.

It should be fine to allow this, as the kernel authenticates the
invocation itself, and we shouldn't break compat with things.

Note that this allowlisting is not sufficient to make ureprobe() work.
libseccomp must be tought the syscall too, but this can happen
independently.

Fixes: #34615
2024-10-11 11:57:40 +02:00
Daan De Meyer 40fadab195 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
2024-10-11 11:34:24 +02:00
Daan De Meyer 2d0af8bc35 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.
2024-10-11 10:36:08 +02:00
Mike Yuan a375e14519 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.
2024-10-11 10:36:08 +02:00
Mike Yuan 155098a702 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.
2024-10-11 10:36:08 +02:00
Mike Yuan da81a10865 core/manager: still send out STATUS=Ready for user manager
This effectively reverts 37d15cd132.

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.
2024-10-11 10:36:05 +02:00
Uday Shankar 225ddc4a72 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.
2024-10-11 10:29:26 +02:00
David Rheinsberg 5697bce82b 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.
2024-10-11 10:28:22 +02:00
Lennart Poettering c28a13b5af 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
2024-10-11 10:27:53 +02:00
Yu Watanabe 727dc1f23a mkosi: fix sections for settings
Follow-up for 963157ca78.
2024-10-11 07:33:42 +09:00
Yu Watanabe b63ffff02b Merge pull request #34699 from yuwata/netlink-cleanups
sd-netlink: several cleanups
2024-10-11 04:30:16 +09:00
Yu Watanabe ba8d48be64 sd-netlink: introduce two more _get_family()
Then, use them in sd_rtnl_message_get_family().
2024-10-11 02:53:00 +09:00
Yu Watanabe 9b8cb789dd sd-netlink,network: rename functions and RoutingPolicyRule.type
To make them consistent to the netlink message header.
No functional change, just refactoring.
2024-10-11 02:52:58 +09:00
Yu Watanabe 2bc1d78345 sd-netlink: introduce macros to define sd_rtnl_message setters and getters 2024-10-11 02:52:26 +09:00
Yu Watanabe 2fcaeaaaf6 sd-netlink: make size verifier in sd_netlink_message_read_xyz() stricter
Also, fill remaining output buffer with zero, for safety.
2024-10-11 02:38:16 +09:00
Yu Watanabe 768237e73a sd-netlink: shorten sd_netlink_message_read_string_strdup() a bit 2024-10-11 02:38:16 +09:00
Yu Watanabe ae298c938b 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.
2024-10-11 02:38:16 +09:00
Lennart Poettering c3069a6bfb 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
2024-10-11 02:18:24 +09:00
Jörg Behrmann e9984357ad ukify: Fix systemd-measure detection in tests
Fixes: 206fa93c85
2024-10-10 15:59:33 +02:00
Ivan Kruglov d8aefe88c8 machine: use sd_json_dispatch_pid() in varlink code 2024-10-10 13:40:45 +02:00
Ivan Kruglov dafd44de4f sd-json: add sd_json_dispatch_pid() 2024-10-10 13:40:45 +02:00
Ivan Kruglov f6cb4d4afb machine: switch to use PidRef when lookup machine by pid in dbus and varlink 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.
2024-10-10 13:40:45 +02:00
Ivan Kruglov 45a20e41df machine: use sd_json_dispatch_signal() in varlink code 2024-10-10 13:40:45 +02:00
Ivan Kruglov 729fbe78df sd-json: add sd_json_dispatch_signal() 2024-10-10 13:40:45 +02:00
Ivan Kruglov 18897460cf machine: remove redundant else if lookup_machine_by_name_or_pid() 2024-10-10 12:34:45 +02:00
Ivan Kruglov 5cdb5c17d3 machine: complete description of io.systemd.Machine.{List, Terminate, Kill, Unregister} methods 2024-10-10 12:34:45 +02:00
Yu Watanabe 70516b026b Merge pull request #34684 from yuwata/login-scheduled-shutdown
login: allow to cancel delayed action by CancelScheduledShutdown()
2024-10-10 19:32:52 +09:00
Yu Watanabe ff5ba2d6fe sd-event: rename output parameters to ret 2024-10-10 19:02:53 +09:00
Lennart Poettering 50ed3b1682 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!
2024-10-10 11:34:47 +02:00
Yu Watanabe 6e27477666 ukify: fix return value type of resolve_at_path()
Follow-up for eca003de2f.
2024-10-10 08:02:13 +02:00
Darsey Litzenberger 4bc7a54d75 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
2024-10-10 09:29:30 +09:00
Yu Watanabe 67226c3cb1 repart: fix typo
Follow-up for d3032e651e.
2024-10-10 05:30:11 +09:00
Yu Watanabe d866b0135f core/mount: fix typo
Follow-up for 00ad3f0227.
2024-10-10 05:29:08 +09:00
Yu Watanabe a029550507 Merge pull request #34687 from DaanDeMeyer/mkosi
Various fixes
2024-10-10 05:26:14 +09:00
Yu Watanabe 2a796b9f52 stub: reindent lines
Follow-up for 2ea0487c1b.
2024-10-10 05:16:36 +09:00
Daan De Meyer 963157ca78 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.
2024-10-09 20:36:57 +02:00
Daan De Meyer 7d9464ceac mkosi: Update to latest 2024-10-09 20:36:57 +02:00
Daan De Meyer d615d4e0de 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.
2024-10-09 20:36:57 +02:00
Daan De Meyer 46536e1d6c 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.
2024-10-09 20:36:57 +02:00
Daan De Meyer 8c5697182a 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.
2024-10-09 20:36:57 +02:00
Daan De Meyer 78f6571505 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.
2024-10-09 20:36:57 +02:00
Daan De Meyer 224aa31f4a ukify: Read .profile from path starting with @ 2024-10-09 20:36:57 +02:00
Daan De Meyer eca003de2f ukify: Introduce resolve_at_path() 2024-10-09 20:36:55 +02:00
Yu Watanabe f16d33f3a7 Merge pull request #34665 from poettering/fastopen-fallback
resolved: fix MSG_FASTOPEN fallback logic
2024-10-10 03:21:35 +09:00
Daan De Meyer be64d42f9f ukify: Fix off by one error
We weren't measuring the profile section itself.
2024-10-09 19:51:08 +02:00
Yu Watanabe e318675398 Merge pull request #34641 from behrmann/ukifystyle
Type annotate and format ukify
2024-10-10 02:21:29 +09:00
Yu Watanabe 0bba543573 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.
2024-10-10 01:59:53 +09:00
Yu Watanabe 70eedbafd9 login: use event_reset_time_relative() at one more place 2024-10-10 01:59:53 +09:00
Yu Watanabe e4b138548f 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.
2024-10-10 01:59:31 +09:00