]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agosd-ndisc: make sd_ndisc return time values in usec 29254/head
Yu Watanabe [Thu, 21 Sep 2023 17:18:06 +0000 (02:18 +0900)] 
sd-ndisc: make sd_ndisc return time values in usec

This also introduces sd_ndisc_router_get_lifetime_timestamp() and
friends that return timestamp rather than timespan.

2 years agosd-ndisc: rename function arguments for storing results
Yu Watanabe [Thu, 21 Sep 2023 17:16:49 +0000 (02:16 +0900)] 
sd-ndisc: rename function arguments for storing results

2 years agomeson: relax ukify requirements
Luca Boccassi [Wed, 20 Sep 2023 19:58:47 +0000 (20:58 +0100)] 
meson: relax ukify requirements

Installing ukify.py doesn't require a working UEFI architecture, but
only that the bootloader option is enabled (and python3). On Debian
Arch: all packages (like python scripts) can theorethically be built
on any builder with any architecture, so there's no guarantee that
it will actually be an EFI-enabled architecture to do that package build.

Relax the requirement to check only for the ukify config option.

2 years agosystemctl: link to all non-man-page files in help
Zbigniew Jędrzejewski-Szmek [Fri, 8 Sep 2023 15:02:57 +0000 (17:02 +0200)] 
systemctl: link to all non-man-page files in help

For file:// links, we urlify the link so that the user can click and either
open the file in a editor or some viewer. The detection is chosen via some
mechanism implemented by the terminal emulator. This seems too DTRT for text
files and PDFs, which should cover the majority of realistic cases. If the file
is not viable, the terminal emulator will say
  "Could not open file://…. No application is registered to view this file type."
or similar.

For all other links, which are primarily http:// and https://, we just show the
link, letting the terminal handle the hyperlinking. The user can then ctrl-click
and open the file it their browser. If we tried to open the files automatically,
we'd would need to open many pages, and we'd need to figure out what browser to
use, etc. When the user picks whether to open the file, this leads to a nicer
user experience.

Man pages are separated by an empty line from preceding in and following output.
In my testing, this makes the output easier to read. A bit of explicit flushing
is needed to make sure that various outputs are not interleaved.

Fixes https://github.com/systemd/systemd/issues/29061.

2 years agohwdb: Bush tablet rotation support (#29268)
Tomasz Świątek [Thu, 21 Sep 2023 15:13:00 +0000 (17:13 +0200)] 
hwdb: Bush tablet rotation support (#29268)

2 years agomeson: do not explicitly specify ownership of /var/log/journal/
Zbigniew Jędrzejewski-Szmek [Thu, 21 Sep 2023 08:47:36 +0000 (10:47 +0200)] 
meson: do not explicitly specify ownership of /var/log/journal/

In 9289e093ae6fd5484f9119e1ee07d1dffe37cd10 we started using install_emptydir().

When running unprivileged, 'DESTDIR=… meson install -C build --quiet --no-rebuild'
would emit two warnings:
  '…/var/log/journal': Unable to set owner 'root' and group 'root': Operation not permitted, ignoring...
  '…/var/log/journal/remote': Unable to set owner 'root' and group 'root': Operation not permitted, ignoring...

Those were the only two install_emptydir()s that specified ownership.
Let's drop the user/group specification to get rid of the warning.

When installing as root, we will create a root-owned directory anyway.
When not running as root, we cannot create a root-owned directory.
So this specification only makes a difference if we are running as root,
and the directory already existed, and was not owned by root. In that case,
I think it's actually better to leave the existing modification in place.
(E.g. maybe the admin chgrp'ed the ownership for whatever reason. We might
just as well leave that in place.)

2 years agoMerge pull request #29253 from yuwata/sd-radv-use-usec_t
Luca Boccassi [Thu, 21 Sep 2023 13:06:28 +0000 (14:06 +0100)] 
Merge pull request #29253 from yuwata/sd-radv-use-usec_t

sd-radv: use usec_t

2 years agonetwork: split out link_get_address_states()
Yu Watanabe [Wed, 20 Sep 2023 06:01:53 +0000 (15:01 +0900)] 
network: split out link_get_address_states()

No functional change, just refactoring and preparation for later
commits.

2 years agoMerge pull request #29252 from yuwata/sd-dhcp6-client-use-usec_t
Luca Boccassi [Thu, 21 Sep 2023 10:30:02 +0000 (11:30 +0100)] 
Merge pull request #29252 from yuwata/sd-dhcp6-client-use-usec_t

sd-dhcp6-client: use usec t

2 years agosd-event: drop unnecessary call of sd_event_now() when requested relative time is...
Yu Watanabe [Wed, 20 Sep 2023 02:32:27 +0000 (11:32 +0900)] 
sd-event: drop unnecessary call of sd_event_now() when requested relative time is zero

2 years agosd-dhcp-client: use unaligned_be32_sec_to_usec()
Yu Watanabe [Wed, 6 Sep 2023 19:33:05 +0000 (04:33 +0900)] 
sd-dhcp-client: use unaligned_be32_sec_to_usec()

Note, previously, we set 1 second if the time value is zero.
But the adjustment is dropped now, as for the lifetime we have explicit
check that the message has non-zero lifetime, and for T1 and T2 we have
better adjustment in client_set_lease_timeouts().

2 years agokeyboard-model-map: correct sk-qwerty entry
Adam Williamson [Wed, 20 Sep 2023 22:14:31 +0000 (15:14 -0700)] 
keyboard-model-map: correct sk-qwerty entry

qwerty here is a variant, not an option.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2 years agosd-device: include missing alloc-util.h
Yu Watanabe [Wed, 20 Sep 2023 04:06:16 +0000 (13:06 +0900)] 
sd-device: include missing alloc-util.h

unref_and_replace_full() is defined in alloc-util.h.

2 years agoMerge pull request #29235 from yuwata/sd-journal-reset-saved-direction-on-seek
Luca Boccassi [Wed, 20 Sep 2023 21:06:01 +0000 (22:06 +0100)] 
Merge pull request #29235 from yuwata/sd-journal-reset-saved-direction-on-seek

sd-journal: reset saved direction on seek

2 years agotest-ndisc-ra: add tests for recently added functions 29253/head
Yu Watanabe [Tue, 5 Sep 2023 13:12:09 +0000 (22:12 +0900)] 
test-ndisc-ra: add tests for recently added functions

2 years agosd-radv: make sd_radv always take timespan in usec
Yu Watanabe [Tue, 5 Sep 2023 07:51:39 +0000 (16:51 +0900)] 
sd-radv: make sd_radv always take timespan in usec

2 years agosd-dhcp6-client: introduce sd_dhcp6_lease_get_t1() and friends 29252/head
Yu Watanabe [Tue, 5 Sep 2023 06:50:50 +0000 (15:50 +0900)] 
sd-dhcp6-client: introduce sd_dhcp6_lease_get_t1() and friends

2 years agosd-dhcp6-client: use be32_sec_to_usec() at more places
Yu Watanabe [Tue, 5 Sep 2023 06:50:23 +0000 (15:50 +0900)] 
sd-dhcp6-client: use be32_sec_to_usec() at more places

2 years agosd-dhcp6-client: rework IA_NA or IA_PD getters
Yu Watanabe [Mon, 4 Sep 2023 18:12:46 +0000 (03:12 +0900)] 
sd-dhcp6-client: rework IA_NA or IA_PD getters

This splits sd_dhcp6_lease_get_address() into small pieces,
and introduce FOREACH_DHCP6_ADDRESS() macro.
Also, the lifetimes provided by _get_address_lifetime() are now in usec,
and _get_address_lifetime_timestamp() provides timestamp.

The same change is also applied for IA_PD.

2 years agosd-dhcp6-client: introduce sd_dhcp6_lease_has_pd_prefix() and friend
Yu Watanabe [Mon, 4 Sep 2023 18:11:53 +0000 (03:11 +0900)] 
sd-dhcp6-client: introduce sd_dhcp6_lease_has_pd_prefix() and friend

No functional change, just refactoring.

2 years agosd-journal: also clear saved direction on seek 29235/head
Yu Watanabe [Tue, 19 Sep 2023 21:36:50 +0000 (06:36 +0900)] 
sd-journal: also clear saved direction on seek

Otherwise, sd_journal_previous() -> real_journal_next(DIRECTION_UP) ->
next_beyond_location() wrongly handles that previously we hit EOF of
the file, and returns 0 without finding a matching entry.

Fixes #29216.

2 years agotest: add more testcases for seeking journal entries
Yu Watanabe [Tue, 19 Sep 2023 20:37:39 +0000 (05:37 +0900)] 
test: add more testcases for seeking journal entries

This is mostly for issue #29216.

2 years agotest: check return value of sd_journal_next() and friends
Yu Watanabe [Tue, 19 Sep 2023 20:36:41 +0000 (05:36 +0900)] 
test: check return value of sd_journal_next() and friends

2 years agotreewide: split commandline into command line
Joerg Behrmann [Tue, 19 Sep 2023 15:45:44 +0000 (17:45 +0200)] 
treewide: split commandline into command line

2 years agoMerge pull request #29239 from poettering/clock-nanosleep
Lennart Poettering [Wed, 20 Sep 2023 14:14:53 +0000 (16:14 +0200)] 
Merge pull request #29239 from poettering/clock-nanosleep

use clock_nanosleep() rather than nanosleep()

2 years agodocs: excorcise NIS from nsswitch.conf
Lennart Poettering [Wed, 20 Sep 2023 09:50:20 +0000 (11:50 +0200)] 
docs: excorcise NIS from nsswitch.conf

Let's replace the "compat" module in our proposed nsswitch.conf
configuration with "files", since it is not 1995 anymore.

Fedora and other distros have deprecated and removed NIS support a while
back. While others still retain some support I am not sure we should
advertise it in our examples. Downstream can of course still use
"compat" instead of "files" if they want to, but let's not confuse
people who don't care about NIS anymore with this.

Also, bring the nsswitch.conf snippet in README in line with what our
man pages say.

Also see: https://fedoraproject.org/wiki/Changes/retire_NIS_user_space_utils

2 years agoscsi_serial: convert from nanosleep() to usleep_safe() 29239/head
Lennart Poettering [Wed, 20 Sep 2023 09:18:59 +0000 (11:18 +0200)] 
scsi_serial: convert from nanosleep() to usleep_safe()

2 years agoMerge pull request #29092 from yuwata/sd-dhcp-server-use-usec
Zbigniew Jędrzejewski-Szmek [Wed, 20 Sep 2023 09:43:26 +0000 (11:43 +0200)] 
Merge pull request #29092 from yuwata/sd-dhcp-server-use-usec

sd-dhcp-server: store lifetime and friends in usec_t

2 years agoMerge pull request #29179 from YHNdnzj/resume-offset-btrfs
Mike Yuan [Wed, 20 Sep 2023 09:40:54 +0000 (17:40 +0800)] 
Merge pull request #29179 from YHNdnzj/resume-offset-btrfs

btrfs-util: introduce btrfs_get_file_physical_offset_fd

2 years agoservice: use empty_to_na() where appropriate
Lennart Poettering [Wed, 20 Sep 2023 07:39:12 +0000 (09:39 +0200)] 
service: use empty_to_na() where appropriate

2 years agoman/kernel-install: document missing $KERNEL_INSTALL_IMAGE_TYPE
Antonio Alvarez Feijoo [Wed, 20 Sep 2023 07:35:37 +0000 (09:35 +0200)] 
man/kernel-install: document missing $KERNEL_INSTALL_IMAGE_TYPE

Available since https://github.com/systemd/systemd/commit/3d5f0bfe

2 years agotime-util: use clock_nanosleep() rather than nanosleep()
Lennart Poettering [Wed, 20 Sep 2023 09:18:02 +0000 (11:18 +0200)] 
time-util: use clock_nanosleep() rather than nanosleep()

nanosleep() is kinda broken since it sleeps in the CLOCK_REALTIME clock,
i.e. is subject to time changes.

Let's use clock_nanosleep() instead with CLOCK_MONOTONIC, which is
really the only thing that makes sense.

2 years agodissect: Accept signature for usr+usr-verity+usr-verity-sig images
Valentin David [Tue, 19 Sep 2023 18:31:04 +0000 (20:31 +0200)] 
dissect: Accept signature for usr+usr-verity+usr-verity-sig images

An image with usr+usr-verity+usr-verity-sig without sidecar files would not be
detected as signed because it would looke for root-verity-sig instead. Because
dissect was not able to detect it, it also made /usr sysexts using an usr
partition to not be mounted with verity.

2 years agoMerge pull request #28919 from fbuihuu/custom-config-file-install-path
Zbigniew Jędrzejewski-Szmek [Wed, 20 Sep 2023 08:43:16 +0000 (10:43 +0200)] 
Merge pull request #28919 from fbuihuu/custom-config-file-install-path

Custom config file install path

2 years agodocs: various updates to the fdstore docs
Lennart Poettering [Tue, 19 Sep 2023 20:22:49 +0000 (22:22 +0200)] 
docs: various updates to the fdstore docs

ispell made some suggestions which I applied.

Addresses: https://github.com/systemd/systemd/pull/29209#pullrequestreview-1632623460

Also adds a brief paragraph about initrd transitions. (Plymouth really
should start using the fdstore for pinning DRM objects, and stop trying
to survive the initrd→host transition)

2 years agoMerge pull request #29231 from poettering/cgroup-utils-tweaklets
Mike Yuan [Wed, 20 Sep 2023 05:06:16 +0000 (13:06 +0800)] 
Merge pull request #29231 from poettering/cgroup-utils-tweaklets

minor tweaks/modernizations in cgroup-util.[ch]

2 years agopidref: add pidref_equal() helper
Lennart Poettering [Tue, 19 Sep 2023 14:09:26 +0000 (16:09 +0200)] 
pidref: add pidref_equal() helper

This compares two PidRef structures via the pid_t field. Ideally we'd do
a stricter comparison here, that is safe towards PID reuse, but so far
the pidfd API lacks suitable mechanisms for that, hence do the best we
can do.

2 years agoscope: slightly simplify scope_enter_running() error handling
Lennart Poettering [Tue, 19 Sep 2023 20:01:29 +0000 (22:01 +0200)] 
scope: slightly simplify scope_enter_running() error handling

2 years agoMerge pull request #29230 from poettering/scope-tweaks
Mike Yuan [Wed, 20 Sep 2023 05:00:56 +0000 (13:00 +0800)] 
Merge pull request #29230 from poettering/scope-tweaks

pid1: minor scope tweaks

2 years agoboot: skip loading DTBs in type 1 when secure boot is enabled
Luca Boccassi [Sat, 16 Sep 2023 23:23:37 +0000 (00:23 +0100)] 
boot: skip loading DTBs in type 1 when secure boot is enabled

The kernel loads the DTB from EFI before ExitBootServices():

https://github.com/torvalds/linux/blob/v6.5/drivers/firmware/efi/libstub/fdt.c#L245

DTBs can map and assign arbitrary memory ranges. The kernel refuses
to load one from the dtb= kernel command line parameter when secure
boot is enabled, as it's not safe. Let's do the same for type 1
entries, as they are unverified.

This only affects arm64 and riscv64, firmwares do not support DTB
on x86.

2 years agocgroup-util: tighten range check before casting to pid_t 29231/head
Lennart Poettering [Tue, 19 Sep 2023 14:04:34 +0000 (16:04 +0200)] 
cgroup-util: tighten range check before casting to pid_t

2 years agocgroup-util: initialize return param on all success returns
Lennart Poettering [Tue, 19 Sep 2023 14:03:56 +0000 (16:03 +0200)] 
cgroup-util: initialize return param on all success returns

As per coding style.

2 years agocgroup-util: rename return param to 'ret', as per coding style
Lennart Poettering [Tue, 19 Sep 2023 14:03:27 +0000 (16:03 +0200)] 
cgroup-util: rename return param to 'ret', as per coding style

2 years agoscope: only stop watching processes when we go down 29230/head
Lennart Poettering [Tue, 19 Sep 2023 14:24:32 +0000 (16:24 +0200)] 
scope: only stop watching processes when we go down

Let's not stop watching processes on every scope state change. This
corrects behaviour when a scope is being enqueued and hasn't started
yet, but has processes associated to it already. previously, if we'd doa
full PID 1 reload we'd stop watching those pids. With this change we'll
continue watching them in that case, and only stop watching them when
the scope unit really shuts down after first being up.

2 years agoscope: add trailing comma to array initialization
Lennart Poettering [Tue, 19 Sep 2023 14:24:23 +0000 (16:24 +0200)] 
scope: add trailing comma to array initialization

2 years agosd-dhcp-server: store lifetime and friends in usec_t 29092/head
Yu Watanabe [Mon, 4 Sep 2023 14:40:14 +0000 (23:40 +0900)] 
sd-dhcp-server: store lifetime and friends in usec_t

2 years agolibsystemd-network: introduce several helper functions to handle time values
Yu Watanabe [Wed, 6 Sep 2023 18:13:39 +0000 (03:13 +0900)] 
libsystemd-network: introduce several helper functions to handle time values

These will be used in later commits.

2 years agomkfs-util: Only unshare mount namespace if needed
Daan De Meyer [Tue, 19 Sep 2023 09:44:54 +0000 (11:44 +0200)] 
mkfs-util: Only unshare mount namespace if needed

We only need a separate mount namespace if we're operating on a
btrfs block device so let's make sure we only unshare the mount
namespace if that's the case.

Replaces #29214

2 years agohwdb: add mic mute key mappings for Acer Predator Triton 300 SE
IllusionMan1212 [Tue, 19 Sep 2023 16:25:23 +0000 (18:25 +0200)] 
hwdb: add mic mute key mappings for Acer Predator Triton 300 SE

2 years agopo: Translated using Weblate (Czech)
Daniel Rusek [Tue, 19 Sep 2023 14:35:58 +0000 (16:35 +0200)] 
po: Translated using Weblate (Czech)

Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Daniel Rusek <mail@asciiwolf.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/cs/
Translation: systemd/main

2 years agoReflect the fact that main config files can be installed in /usr 28919/head
Franck Bui [Mon, 21 Aug 2023 14:48:42 +0000 (16:48 +0200)] 
Reflect the fact that main config files can be installed in /usr

2 years agoconfig files: more recommendations of `systemd-analyze cat-config`
Franck Bui [Mon, 21 Aug 2023 10:51:58 +0000 (12:51 +0200)] 
config files: more recommendations of `systemd-analyze cat-config`

Follow-up for 3b0754b16c5.

2 years agoMerge pull request #29150 from abderrahim/version-info-dbus
Luca Boccassi [Tue, 19 Sep 2023 15:04:41 +0000 (16:04 +0100)] 
Merge pull request #29150 from abderrahim/version-info-dbus

man: add version information for dbus interfaces

2 years agoMerge pull request #29122 from yuwata/network-allow-multiple-ipv6-null-addresses
Zbigniew Jędrzejewski-Szmek [Tue, 19 Sep 2023 14:13:42 +0000 (16:13 +0200)] 
Merge pull request #29122 from yuwata/network-allow-multiple-ipv6-null-addresses

network: allow multiple IPv6 null addresses

2 years agoMerge pull request #29215 from AdamWill/kmm-layoutorder-variant
Zbigniew Jędrzejewski-Szmek [Tue, 19 Sep 2023 14:05:46 +0000 (16:05 +0200)] 
Merge pull request #29215 from AdamWill/kmm-layoutorder-variant

Some fixes for xkb -> console keyboard layout conversion

2 years agoboot: use separate SBAT project names for stub and boot
Luca Boccassi [Sat, 16 Sep 2023 23:55:55 +0000 (00:55 +0100)] 
boot: use separate SBAT project names for stub and boot

The implementations are not 100% overlapping, so use different identifiers, so
that revocations can be done independently. e.g.: a bug that affects only
sd-boot won't necessarily cause old UKIs to be revoked.

2 years agotest: introduce TEST-83-BTRFS 29179/head
Mike Yuan [Mon, 18 Sep 2023 12:31:59 +0000 (20:31 +0800)] 
test: introduce TEST-83-BTRFS

The Ubuntu CIs are deny-listed because the shipped
btrfs-progs is too old, i.e. doesn't support the
recently-added 'filesystem mkswapfile' command.

2 years agobtrfs-util: introduce btrfs_get_file_physical_offset_fd
Mike Yuan [Wed, 13 Sep 2023 05:52:55 +0000 (13:52 +0800)] 
btrfs-util: introduce btrfs_get_file_physical_offset_fd

This calculates the physical offset of a file on btrfs,
similar to what FIEMAP does on other filesystems.

The implementation should generally be kept in sync with
btrfs-progs' inspect-internal map-swapfile command:
https://github.com/kdave/btrfs-progs/blob/92d04d4780886a9850716e5529f1dace97779931/cmds/inspect.c#L1516

Preparation for #25130

2 years agotree-wide: explicitly compare return value of fd_is_fs_type with 0
Mike Yuan [Wed, 13 Sep 2023 04:48:44 +0000 (12:48 +0800)] 
tree-wide: explicitly compare return value of fd_is_fs_type with 0

According to our coding style.

2 years agoupdate-dbus-docs: don't consider mentions in the History 29150/head
Abderrahim Kitouni [Sun, 10 Sep 2023 22:41:35 +0000 (23:41 +0100)] 
update-dbus-docs: don't consider mentions in the History

Being mentioned in the History section as added in a specific version isn't
enough to consider a member documented.

2 years agoman: add version information for dbus interfaces
Abderrahim Kitouni [Sun, 10 Sep 2023 13:40:03 +0000 (14:40 +0100)] 
man: add version information for dbus interfaces

These only go back to version 250 which is the first version to provide the
export-dbus-interfaces build target.

2 years agoMerge pull request #29221 from keszybz/fedora-cloud-latest
Daan De Meyer [Tue, 19 Sep 2023 13:32:57 +0000 (15:32 +0200)] 
Merge pull request #29221 from keszybz/fedora-cloud-latest

man: update Fedora release information

2 years agoman: update Fedora release information 29221/head
Zbigniew Jędrzejewski-Szmek [Tue, 19 Sep 2023 11:13:02 +0000 (13:13 +0200)] 
man: update Fedora release information

2 years agoMerge pull request #29218 from DaanDeMeyer/kernel-modules
Daan De Meyer [Tue, 19 Sep 2023 10:22:16 +0000 (12:22 +0200)] 
Merge pull request #29218 from DaanDeMeyer/kernel-modules

mkosi: Stop installing kernel-modules on Fedora

2 years agoman: condense version information for functions
Abderrahim Kitouni [Mon, 18 Sep 2023 16:44:26 +0000 (17:44 +0100)] 
man: condense version information for functions

Use a more compact form like 'a, b, and c were added in version x'

2 years agomkosi: Stop installing kernel-modules on Fedora 29218/head
Daan De Meyer [Tue, 19 Sep 2023 08:53:24 +0000 (10:53 +0200)] 
mkosi: Stop installing kernel-modules on Fedora

squashfs has been moved to kernel-modules-core so no need to install
kernel-modules anymore on Fedora.

2 years agomkosi: Bump Fedora CI to Fedora 39
Daan De Meyer [Tue, 19 Sep 2023 09:47:41 +0000 (11:47 +0200)] 
mkosi: Bump Fedora CI to Fedora 39

2 years agoMerge pull request #29217 from behrmann/typofixes
Luca Boccassi [Tue, 19 Sep 2023 09:46:45 +0000 (10:46 +0100)] 
Merge pull request #29217 from behrmann/typofixes

Various typo fixes

2 years agoman: remove quotes around default values 29217/head
Joerg Behrmann [Tue, 19 Sep 2023 08:05:06 +0000 (10:05 +0200)] 
man: remove quotes around default values

2 years agotreewide: fix typos
Joerg Behrmann [Tue, 19 Sep 2023 08:02:05 +0000 (10:02 +0200)] 
treewide: fix typos

- mostly: usecase -> use case
- continously -> continuously
- single typos in docs/FILE_DESCRIPTOR_STORE.md

2 years agoupdate TODO
Lennart Poettering [Tue, 19 Sep 2023 07:47:29 +0000 (09:47 +0200)] 
update TODO

2 years agoMerge pull request #29159 from poettering/socket-pause
Lennart Poettering [Tue, 19 Sep 2023 07:40:27 +0000 (09:40 +0200)] 
Merge pull request #29159 from poettering/socket-pause

core: add new "PollLimit" settings to .socket units

2 years agoMerge pull request #29152 from poettering/pidref-more
Luca Boccassi [Tue, 19 Sep 2023 00:12:09 +0000 (01:12 +0100)] 
Merge pull request #29152 from poettering/pidref-more

pid1: port more code over to PidRef (i.e. pidfd based operation)

2 years agofind_legacy_keymap: try matching with layout order reversed 29215/head
Adam Williamson [Fri, 15 Sep 2023 23:02:29 +0000 (16:02 -0700)] 
find_legacy_keymap: try matching with layout order reversed

The lines in kbd-model-map date back to ye olde times (RH's old
system-config-keyboard), and I think predate this bug:

https://bugzilla.redhat.com/show_bug.cgi?id=1039185

where we got strong feedback that, for 'switched' layout setups
like Russian, US English should be the *first* layout and the
native layout the *second* one. This is how anaconda and, as of
recently, gnome-initial-setup configure such cases - but that
means, if we try to use localed to convert these configurations
using kbd-model-map, we get the wrong result (we get "us" as the
console layout). See also:

https://bugzilla.redhat.com/show_bug.cgi?id=1912609

where we first noticed this wasn't working right, but sadly, we
'fixed' it with a not-really-correct bodge in anaconda instead
of doing it properly.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2 years agofind_legacy_keymap: fix empty variant matching
Adam Williamson [Fri, 15 Sep 2023 22:35:36 +0000 (15:35 -0700)] 
find_legacy_keymap: fix empty variant matching

We should give a match bonus if the X context variant is empty
and the xvariant column in kbd-model-map is "-" (which means
none). Currently, we don't, which means that if you call this
on a context with layouts bg,us and no variant, you get the
console layout bg_pho-utf8 instead of bg_bds-utf8 (because both
score the same, and the bg_pho-utf8 row comes first). You should
get bg_bds-utf8 in this case.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2 years agorepart: Fix a check for CopyBlocks on data partition
Valentin David [Mon, 18 Sep 2023 19:01:52 +0000 (21:01 +0200)] 
repart: Fix a check for CopyBlocks on data partition

The check was verifying that the verity partition had CopyBlocks set instead of
the associated data partition.

2 years agosystemd.time.7: rewrite Parsing Timestamps section
наб [Fri, 8 Sep 2023 16:00:12 +0000 (18:00 +0200)] 
systemd.time.7: rewrite Parsing Timestamps section

2 years agotest: only load tpm_ibmvtpm kernel module on PowerPC hw
Dan Streetman [Mon, 18 Sep 2023 18:31:54 +0000 (14:31 -0400)] 
test: only load tpm_ibmvtpm kernel module on PowerPC hw

This module is only available on PPC hw, so avoid trying to load it elsewhere, as it generates a misleading error message in the logs:

modprobe: FATAL: Module tpm_ibmvtpm not found in directory /lib/modules/5.15.0-83-generic

2 years agoman: update version information
Abderrahim Kitouni [Mon, 18 Sep 2023 15:03:38 +0000 (16:03 +0100)] 
man: update version information

As I noticed a lot of missing information when trying to implement checking
for missing info. I reimplemented the version information script to be more
robust, and here is the result.

Follow up to ec07c3c80b2b1bfa6788500202006ff85f5ae4f4

2 years agopath: make arg_pager_flags static
Lennart Poettering [Mon, 18 Sep 2023 15:25:12 +0000 (17:25 +0200)] 
path: make arg_pager_flags static

Follow-up for: e441d1d46e8cd640ffac9d9231e5b16852fd9c28

2 years agoMerge pull request #29186 from keszybz/man-notifications-and-fd-store
Luca Boccassi [Mon, 18 Sep 2023 23:36:24 +0000 (00:36 +0100)] 
Merge pull request #29186 from keszybz/man-notifications-and-fd-store

man: notifications and fd store

2 years agocore: port unit_fork_helper_process() and unit_fork_and_watch_rm_rf() to PidRef 29152/head
Lennart Poettering [Sun, 10 Sep 2023 14:41:43 +0000 (16:41 +0200)] 
core: port unit_fork_helper_process() and unit_fork_and_watch_rm_rf() to PidRef

2 years agocore: port unit_main_pid() + unit_control_pid() to PidRef and drop unit_kill_common()
Lennart Poettering [Sun, 10 Sep 2023 14:25:02 +0000 (16:25 +0200)] 
core: port unit_main_pid() + unit_control_pid() to PidRef and drop unit_kill_common()

This ports over unit_main_pid() + unit_control_pid() to return PidRef*
pointers (which also means the underlying UnitVTable function pointers
are changed accordingly).

This then uses te functions to simplify the unit_kill() call, by
avoiding the kill() vtable indirection and instead just suing
unit_main_pid() and unit_control_pid() directly.

2 years agopidref: add sigqueue() helper
Lennart Poettering [Sun, 10 Sep 2023 14:17:35 +0000 (16:17 +0200)] 
pidref: add sigqueue() helper

2 years agocore: port over unit_kill_context() to PidRef
Lennart Poettering [Sun, 10 Sep 2023 13:12:59 +0000 (15:12 +0200)] 
core: port over unit_kill_context() to PidRef

2 years agocore: port service_set_main_pid() to PidRef
Lennart Poettering [Sun, 10 Sep 2023 12:49:16 +0000 (14:49 +0200)] 
core: port service_set_main_pid() to PidRef

2 years agoci: add test for poll limit 29159/head
Lennart Poettering [Mon, 18 Sep 2023 16:05:27 +0000 (18:05 +0200)] 
ci: add test for poll limit

2 years agoman: document the new PollLimitIntervalSec=/PollLimitBurst= settings
Lennart Poettering [Mon, 18 Sep 2023 15:51:49 +0000 (17:51 +0200)] 
man: document the new PollLimitIntervalSec=/PollLimitBurst= settings

2 years agocore: add new "PollLimit" settings to .socket units
Lennart Poettering [Sat, 9 Sep 2023 12:46:32 +0000 (14:46 +0200)] 
core: add new "PollLimit" settings to .socket units

This adds a new "PollLimit" pair of settings to .socket units, very
similar to existing "TriggerLimit" logic. The differences are:

* PollLimit focusses on the polling on the sockets, and pauses that
  temporarily if a ratelimit on that is reached. TriggerLimit otoh
  focusses on the triggering effect of socket units, and stops
  triggering once the ratelimit is hit.

* While the trigger limit being hit is an action that causes the socket
  unit to fail the polling limit being reached will just temporarily
  disable polling on the socket fd, and it is resumed once the ratelimit
  interval is over.

* When a socket unit operates on multiple socket fds (e,g, ListenStream=
  on both some ipv6 and an ipv4 address or so). Then the PollLimit will
  be specific to each fd, while the trigger limit is specific to the
  whole unit.

Implementation-wise this is mostly a wrapper around sd-event's
sd_event_source_set_ratelimit(), which exposes the desired behaviour
directly.

Usecase for all of this: socket services which when overloaded with
connections should just slow down reception of it, but not fail
persistently.

2 years agoMerge pull request #29206 from mrc0mmand/lsan-followup
Mike Yuan [Mon, 18 Sep 2023 15:00:04 +0000 (23:00 +0800)] 
Merge pull request #29206 from mrc0mmand/lsan-followup

core: limit the LSan shenanigans to PID 1

2 years agoupdate TODO
Lennart Poettering [Mon, 18 Sep 2023 14:20:44 +0000 (16:20 +0200)] 
update TODO

2 years agoman: Mention that JSON user record files should have the .user extension
Daan De Meyer [Mon, 18 Sep 2023 11:23:58 +0000 (13:23 +0200)] 
man: Mention that JSON user record files should have the .user extension

2 years agologind: slightly tweak error message about not enough swap for hibernation
Lennart Poettering [Mon, 18 Sep 2023 08:41:50 +0000 (10:41 +0200)] 
logind: slightly tweak error message about not enough swap for hibernation

Let's tweak the message if not enough swap is around slightly: systems
might have plenty swap backed by incompatible storage (specifically:
swap files on btrfs), but we (currently) do not support hibernating to
that.

Hence let's say *suitable* swap space and talk about *compatibility* of
backing storage.

Hopefully this will make things a bit clearer to users.

Prompted by: #29189

2 years agodoc: add a markdown doc giving an overview over the fdstore
Lennart Poettering [Mon, 18 Sep 2023 11:33:06 +0000 (13:33 +0200)] 
doc: add a markdown doc giving an overview over the fdstore

And link it up everywhere.

2 years agoman/daemon: s/init system/service manager/ 29186/head
Zbigniew Jędrzejewski-Szmek [Mon, 18 Sep 2023 12:44:32 +0000 (14:44 +0200)] 
man/daemon: s/init system/service manager/

As pointed out in the review, all this applies to the user services too, so are
not managed by the "init system", but by the more generic "service manager".

Also:
- use oxford comma
- change "employ" to "use" in various places
- change "the init system forwards messages to syslog" to "are forwarded to
  syslog". This is done by systemd-journald, so really there is no forwarding,
  because systemd-journald just writes them to a file in the common setup,
  so let's use the passive form to avoid specifying who does this.

2 years agomeson: restore tools/meson-vcs-tag.sh
Zbigniew Jędrzejewski-Szmek [Mon, 11 Sep 2023 14:46:04 +0000 (16:46 +0200)] 
meson: restore tools/meson-vcs-tag.sh

This conceptually reverts e95acdfe1d3a790e18617bb992a712b34f41800d,
but the actual contents of the script are taken from the command invocation
in meson with all the updates that happened in the meantime.

One small change is that I replaced () by {}: this avoids one subprocess spawn.
People were worried about the cost of vcs_tag(), and this microoptimization may
help a bit. I measured the speed on machine, and noop rebuilds are still about
100–120 ms.

The logic is entirely moved to the script. This makes the meson config simpler
and also makes it easier to use it externally.

The script is needed for in-place rpm builds, see README.build-in-place.md [1],
where it is invoked from the spec file to determine the project version.

[1] https://src.fedoraproject.org/rpms/systemd/blob/rawhide/f/README.build-in-place.md

2 years agomeson: fix TODO regarding next meson version
Luca Boccassi [Mon, 18 Sep 2023 11:30:53 +0000 (12:30 +0100)] 
meson: fix TODO regarding next meson version

2 years agovimrc: explicitly set shiftwidth for the C file type 29206/head
Frantisek Sumsal [Mon, 18 Sep 2023 10:36:11 +0000 (12:36 +0200)] 
vimrc: explicitly set shiftwidth for the C file type

If you start editing a shell script and then open a buffer with a C
file, the shiftwidth set by the previous autocommand for the sh file
type would not be reset to the original (global) 8ch. Let's fix this by
explicitly setting the shiftwidth in the C file type autocommand as
well.

2 years agocore: limit the LSan shenanigans to PID 1
Frantisek Sumsal [Mon, 18 Sep 2023 10:34:42 +0000 (12:34 +0200)] 
core: limit the LSan shenanigans to PID 1

Addresses https://github.com/systemd/systemd/pull/29194#pullrequestreview-1630530753.
Follow-up to ae5ce7e.

2 years agoMerge pull request #29204 from poettering/pe-section-fix
Luca Boccassi [Mon, 18 Sep 2023 10:47:29 +0000 (11:47 +0100)] 
Merge pull request #29204 from poettering/pe-section-fix

man: systemd-stub fixes