]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
13 months agobusctl: show information of passed file descriptor 34747/head
Yu Watanabe [Sun, 13 Oct 2024 04:17:26 +0000 (13:17 +0900)] 
busctl: show information of passed file descriptor

13 months agosd-json: introduce json_variant_new_fd_info()
Yu Watanabe [Sun, 13 Oct 2024 03:56:10 +0000 (12:56 +0900)] 
sd-json: introduce json_variant_new_fd_info()

Currently this is not used, but will be used later.

13 months agosd-json: introduce json_variant_new_devnum() and friends
Yu Watanabe [Tue, 15 Oct 2024 00:15:19 +0000 (09:15 +0900)] 
sd-json: introduce json_variant_new_devnum() and friends

13 months agofs-util: make readlink_malloc() inline
Yu Watanabe [Sun, 13 Oct 2024 03:07:25 +0000 (12:07 +0900)] 
fs-util: make readlink_malloc() inline

13 months agobusctl: minor coding style cleanups
Yu Watanabe [Sun, 13 Oct 2024 04:21:36 +0000 (13:21 +0900)] 
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.

13 months agoMerge pull request #34723 from poettering/machined-pidref-more
Lennart Poettering [Tue, 15 Oct 2024 09:37:39 +0000 (11:37 +0200)] 
Merge pull request #34723 from poettering/machined-pidref-more

machined: switch remaining Varlink overs over to use json_dispatch_pidref() and friends

13 months agoMerge pull request #34769 from yuwata/machine-by-name-or-pid
Yu Watanabe [Tue, 15 Oct 2024 08:56:48 +0000 (17:56 +0900)] 
Merge pull request #34769 from yuwata/machine-by-name-or-pid

machine: lookup_machine_by_name_or_pid() may return 1 on error and it is already replied

13 months agoman: update documents of "_outbound" addresses
Yu Watanabe [Tue, 15 Oct 2024 05:15:31 +0000 (14:15 +0900)] 
man: update documents of "_outbound" addresses

Follow-up for 4adf2653e2a68d4d593b46734fd9e24721a8d449.
Addresses https://github.com/systemd/systemd/issues/34739#issuecomment-2412904739.

13 months agoTEST-13-NSPAWN: several cleanups 34769/head
Yu Watanabe [Tue, 15 Oct 2024 05:03:02 +0000 (14:03 +0900)] 
TEST-13-NSPAWN: several cleanups

- suppress unnecessary error messages, especially in loop and at_exit(),
- ensure the container service is stopped before restarting,
- do not send KILL signal, as garbages will remain, and disturb the next
  invocation,
- drop unnecessary workaround of trying machine twice.

13 months agomachine: trivial coding style cleanups
Yu Watanabe [Tue, 15 Oct 2024 04:17:29 +0000 (13:17 +0900)] 
machine: trivial coding style cleanups

13 months agomachine: fix memleak in vl_method_list_images()
Yu Watanabe [Tue, 15 Oct 2024 04:14:15 +0000 (13:14 +0900)] 
machine: fix memleak in vl_method_list_images()

Fixes an issue in fb0ea6a6a36b5fa97e6c57d608bb9f7acb63c8b2.

13 months agomachine: lookup_machine_by_name_or_pid() may return 1 on error and it is already...
Yu Watanabe [Tue, 15 Oct 2024 02:20:13 +0000 (11:20 +0900)] 
machine: lookup_machine_by_name_or_pid() may return 1 on error and it is already replied

Follow-ups for 1bd979dddbb6ed3ffe410d78a7ff80cbb1c42a64 and later
commits.

Fixes #34764.

13 months agoMerge pull request #34752 from yuwata/udev-remove-database-on-remove
Yu Watanabe [Tue, 15 Oct 2024 04:06:00 +0000 (13:06 +0900)] 
Merge pull request #34752 from yuwata/udev-remove-database-on-remove

udev: remove database file on remove event

13 months agoMerge pull request #34736 from yuwata/network-mtu
Yu Watanabe [Tue, 15 Oct 2024 01:54:58 +0000 (10:54 +0900)] 
Merge pull request #34736 from yuwata/network-mtu

network: wait for IPv6 MTU being synced to link MTU

13 months agoMerge pull request #34744 from yuwata/oom-cleanups
Yu Watanabe [Tue, 15 Oct 2024 01:51:50 +0000 (10:51 +0900)] 
Merge pull request #34744 from yuwata/oom-cleanups

oom: sort output of oomctl by cgroup path

13 months agoTEST-17-UDEV: check if udev database file is removed on remove event 34752/head
Yu Watanabe [Sun, 13 Oct 2024 16:28:23 +0000 (01:28 +0900)] 
TEST-17-UDEV: check if udev database file is removed on remove event

13 months agoudev: do not try to lock whole block device on remove event
Yu Watanabe [Mon, 14 Oct 2024 21:22:24 +0000 (06:22 +0900)] 
udev: do not try to lock whole block device on remove event

As another device may be created with the same device node while udevd
is processing the remove event of the previous owner of the device node.

This also adds comment why we skip watching device node on remove.

13 months agoMerge pull request #34755 from YHNdnzj/soft-reboot-generator-cmdline
Yu Watanabe [Tue, 15 Oct 2024 01:48:31 +0000 (10:48 +0900)] 
Merge pull request #34755 from YHNdnzj/soft-reboot-generator-cmdline

core/manager: pass soft-reboot count to generators

13 months agohibernate-resume-generator: don't initiate resume if soft-rebooted 34755/head
Mike Yuan [Mon, 14 Oct 2024 16:31:14 +0000 (18:31 +0200)] 
hibernate-resume-generator: don't initiate resume if soft-rebooted

This is just paranoia, to ensure that we don't accidentally
initiate resume if the initrd is entered through soft-reboot
rather than the initial one for booting up.

13 months agogpt-auto: use RET_GATHER at one more place
Mike Yuan [Mon, 30 Sep 2024 19:21:53 +0000 (21:21 +0200)] 
gpt-auto: use RET_GATHER at one more place

13 months agocore/manager: pass soft-reboot count to generators
Mike Yuan [Sat, 28 Sep 2024 13:54:42 +0000 (15:54 +0200)] 
core/manager: pass soft-reboot count to generators

soft-reboot allows switching into a different root/installation,
i.e. potentially invalidate settings from kernel cmdline and such.
Let's hence inform generators about soft-reboots.

13 months agocore/manager: minor cleanup for generator_path_any() and friends
Mike Yuan [Fri, 11 Oct 2024 15:57:06 +0000 (17:57 +0200)] 
core/manager: minor cleanup for generator_path_any() and friends

13 months agoshared/exec-util: modernize execute_strv() and friends a bit
Mike Yuan [Mon, 14 Oct 2024 16:13:35 +0000 (18:13 +0200)] 
shared/exec-util: modernize execute_strv() and friends a bit

do_spawn() is also called during execute_strv(), so rename
"direxec" to "exec-inner".

13 months agoshared/exec-util: minor rearrangement, drop unused EXEC_DIR_NONE
Mike Yuan [Fri, 11 Oct 2024 15:53:34 +0000 (17:53 +0200)] 
shared/exec-util: minor rearrangement, drop unused EXEC_DIR_NONE

13 months agobasic/stat-util: use xopenat() where appropriate
Mike Yuan [Fri, 11 Oct 2024 16:04:17 +0000 (18:04 +0200)] 
basic/stat-util: use xopenat() where appropriate

13 months agonetwork: wait for IPv6 MTU being synced to link MTU 34736/head
Yu Watanabe [Sat, 12 Oct 2024 07:43:15 +0000 (16:43 +0900)] 
network: wait for IPv6 MTU being synced to link MTU

The kernel resets the IPv6 MTU of an interface when its link MTU is changed.
But it seems the operation is asynchronous, and even when we detect that
the link MTU is changed, the IPv6 MTU may not be reset yet.
====
[ 2257.067613] systemd-networkd[447122]: veth99: MTU is changed: 1500 →1600 (min: 68, max: 65535)
[ 2257.067641] systemd-networkd[447122]: Setting '/proc/sys/net/ipv6/conf/veth99/mtu' to '1410'
[ 2257.067711] systemd-networkd[447122]: No change in value '1410', suppressing write
====
As you can see, even if the link MTU is changed to 1600, the IPv6 MTU is
unchanged (in this case, still 1410).

13 months agonetwork/sysctl: make link_set_ipv6_mtu() log failures
Yu Watanabe [Sat, 12 Oct 2024 07:45:05 +0000 (16:45 +0900)] 
network/sysctl: make link_set_ipv6_mtu() log failures

No functional change, just refactoring.

13 months agonetwork/route: use sysctl_read_ip_property_int() for reading route/max_size
Yu Watanabe [Mon, 14 Oct 2024 21:52:19 +0000 (06:52 +0900)] 
network/route: use sysctl_read_ip_property_int() for reading route/max_size

13 months agosysctl-util: introduce sysctl_read_ip_property_int() and _uint32()
Yu Watanabe [Sat, 12 Oct 2024 07:40:19 +0000 (16:40 +0900)] 
sysctl-util: introduce sysctl_read_ip_property_int() and _uint32()

Currently not used, but will be used later.

13 months agoudev: do not re-create database on remove event
Yu Watanabe [Sun, 13 Oct 2024 15:55:43 +0000 (00:55 +0900)] 
udev: do not re-create database on remove event

Fixes a bug introduced by f6bda694f908cc227b002570b893029aa4c9e173 (v256).

With the offending commit, on remove event, database file for a device is once
removed in event_execute_rules_on_remove(), but later re-created here.
This fixes the issue, and makes the database file not re-created on remove event.

13 months agooomd-util: use FOREACH_ARRAY() more 34744/head
Yu Watanabe [Sat, 12 Oct 2024 01:59:12 +0000 (10:59 +0900)] 
oomd-util: use FOREACH_ARRAY() more

13 months agosd-radv: drop sd_radv_prefix and friends, and use sd_ndisc_option to manage NDisc...
Yu Watanabe [Tue, 23 Apr 2024 04:15:49 +0000 (13:15 +0900)] 
sd-radv: drop sd_radv_prefix and friends, and use sd_ndisc_option to manage NDisc options

No effective functional change, just refactoring.

13 months agoMerge pull request #34738 from behrmann/ukifyoption
Yu Watanabe [Mon, 14 Oct 2024 20:58:49 +0000 (05:58 +0900)] 
Merge pull request #34738 from behrmann/ukifyoption

ukify: Add a config object

13 months agoTEST-13-NSPAWN: add test for 'machinectl terminate'
Yu Watanabe [Sat, 12 Oct 2024 20:15:18 +0000 (05:15 +0900)] 
TEST-13-NSPAWN: add test for 'machinectl terminate'

This also fixes the test for io.systemd.Machine.Terminate.

When systemd-nspawn@.service receives stop signal, then systemd-nspawn
sends SIGRTMIN+3 to the container, which was previously ignored by the
custom init script used by the container.
Let's introduce another trap for the signal, and correctly handle it.

Follow-up for 164af66f9abdfd8935098d9f10c746ff29dea7df.

13 months agoMerge pull request #34743 from yuwata/bus-message-dump-fd
Yu Watanabe [Mon, 14 Oct 2024 20:58:03 +0000 (05:58 +0900)] 
Merge pull request #34743 from yuwata/bus-message-dump-fd

bus-message-util: introduce bus_message_dump_fd() and _string()

13 months agoMerge pull request #34745 from yuwata/local-outbounds-prefsrc
Yu Watanabe [Mon, 14 Oct 2024 20:57:34 +0000 (05:57 +0900)] 
Merge pull request #34745 from yuwata/local-outbounds-prefsrc

local-addresses: honor RTA_PREFSRC field of gateway

13 months agodocs: add a missing : character
Gaël PORTAY [Mon, 14 Oct 2024 17:16:07 +0000 (19:16 +0200)] 
docs: add a missing : character

This adds the missing colon character to the section systemd-sysusers.

13 months agoFix some typos in socket-util.h
Michiel [Mon, 14 Oct 2024 13:50:36 +0000 (15:50 +0200)] 
Fix some typos in socket-util.h

13 months agoman: document preference for secure_getenv() in coding style
Lennart Poettering [Mon, 14 Oct 2024 09:55:59 +0000 (11:55 +0200)] 
man: document preference for secure_getenv() in coding style

13 months agoMerge pull request #34749 from yuwata/network-address-parse-broadcast
Luca Boccassi [Mon, 14 Oct 2024 11:31:03 +0000 (12:31 +0100)] 
Merge pull request #34749 from yuwata/network-address-parse-broadcast

network/address: fix parser for Broadcast=

13 months agoupdatectl: remove unimplemented option
Antonio Alvarez Feijoo [Mon, 14 Oct 2024 10:02:04 +0000 (12:02 +0200)] 
updatectl: remove unimplemented option

13 months agoMerge pull request #34623 from ikruglov/ikruglov/io-systemd-Machine-Image
Lennart Poettering [Mon, 14 Oct 2024 11:27:46 +0000 (13:27 +0200)] 
Merge pull request #34623 from ikruglov/ikruglov/io-systemd-Machine-Image

machine: implement varlink interfaces io.systemd.MachineImage.{List, Update}

13 months agosd-json: drop sd_json_dispatch_pid() again, as we prefer json_dispatch_pidref() now 34723/head
Lennart Poettering [Fri, 11 Oct 2024 12:03:05 +0000 (14:03 +0200)] 
sd-json: drop sd_json_dispatch_pid() again, as we prefer json_dispatch_pidref() now

The calls are now unused, and we generally prefer if people send a PID
triplet rather than a single PID, hence stop supporting a high-level
dispacher for pid_t.

13 months agomachined: port all varlink APIs over to new PidRef serialization
Lennart Poettering [Fri, 11 Oct 2024 11:51:25 +0000 (13:51 +0200)] 
machined: port all varlink APIs over to new PidRef serialization

13 months agopidref: hookup PID_AUTOMATIC special pid_t value with PidRef
Lennart Poettering [Mon, 14 Oct 2024 10:31:57 +0000 (12:31 +0200)] 
pidref: hookup PID_AUTOMATIC special pid_t value with PidRef

The PID_AUTOMATIC value is now properly recognized by the PidRef logic
too. This needed some massaging of header includes, to ensure pidref.h
can access process-util.h's definitions and vice versa.

13 months agoMerge pull request #34716 from dvdhrm/pr/derand
Lennart Poettering [Mon, 14 Oct 2024 09:51:43 +0000 (11:51 +0200)] 
Merge pull request #34716 from dvdhrm/pr/derand

Clarify nameing-scheme in DESKTOP_ENVIRONMENT documentation

13 months agomachine: tests for varlink interfaces 34623/head
Ivan Kruglov [Tue, 8 Oct 2024 15:00:27 +0000 (17:00 +0200)] 
machine: tests for varlink interfaces

- io.systemd.MachineImage.List
- io.systemd.MachineImage.Update

13 months agomachine: listen on io.systemd.MachineImage socket
Ivan Kruglov [Fri, 11 Oct 2024 12:38:58 +0000 (14:38 +0200)] 
machine: listen on io.systemd.MachineImage socket

13 months agomachine: introduce io.systemd.MachineImage.Update varlink method
Ivan Kruglov [Tue, 8 Oct 2024 15:00:11 +0000 (17:00 +0200)] 
machine: introduce io.systemd.MachineImage.Update varlink method

io.systemd.MachineImage.Update implements the following dbus org.freedesktop.machine1.Manager interfaces:

- RenameImage
- MarkImageReadOnly
- SetImageLimit

13 months agomachine: introduce io.systemd.MachineImage.List varlink method
Ivan Kruglov [Tue, 8 Oct 2024 14:58:22 +0000 (16:58 +0200)] 
machine: introduce io.systemd.MachineImage.List varlink method

io.systemd.MachineImage.List implements the following dbus org.freedesktop.machine1.Manager interfaces:

- GetImage
- ListImages
- GetImageHostname
- GetImageMachineID
- GetImageMachineInfo
- GetImageOSRelease

13 months agomachine: generalize rename_image_and_update_cache() logic
Ivan Kruglov [Tue, 8 Oct 2024 09:30:10 +0000 (11:30 +0200)] 
machine: generalize rename_image_and_update_cache() logic

This is a prep step to reuse the function in varlink interface

13 months agomachine: move manager_acquire_image to src/machine/machined-core.c
Ivan Kruglov [Wed, 2 Oct 2024 11:21:46 +0000 (13:21 +0200)] 
machine: move manager_acquire_image to src/machine/machined-core.c

This is a prep step to reuse the function in varlink interface.

13 months agomachine: fix misnamed params in src/shared/discover-image.h
Ivan Kruglov [Tue, 1 Oct 2024 08:04:08 +0000 (10:04 +0200)] 
machine: fix misnamed params in src/shared/discover-image.h

13 months agobash-completion/busctl: support wait command
Yu Watanabe [Mon, 14 Oct 2024 01:42:25 +0000 (10:42 +0900)] 
bash-completion/busctl: support wait command

Follow-up for 30465af656a10c124e7fa9fb33f7ad8454e9af2e.

13 months agoukify: Add more mypy options 34738/head
Jörg Behrmann [Sun, 13 Oct 2024 13:20:44 +0000 (15:20 +0200)] 
ukify: Add more mypy options

This achieves parity with the mypy config used in mkosi.

The import of builtins is needed because otherwise type is attempted to be
resolved to the variable in the scope.

13 months agoukify: Add UkifyConfig
Jörg Behrmann [Mon, 14 Oct 2024 07:58:05 +0000 (09:58 +0200)] 
ukify: Add UkifyConfig

Using a dataclass instead of an argparse namespace to pass around the parsed
options allows to track the types properly.

13 months agoukify: Add a unified interface for signing tools
Jörg Behrmann [Thu, 10 Oct 2024 09:57:12 +0000 (11:57 +0200)] 
ukify: Add a unified interface for signing tools

13 months agoukify: Fix type of UKI.executable
Jörg Behrmann [Sat, 12 Oct 2024 13:50:57 +0000 (15:50 +0200)] 
ukify: Fix type of UKI.executable

13 months agoMerge pull request #34730 from yuwata/boot-efi-follow-ups
Lennart Poettering [Mon, 14 Oct 2024 07:56:47 +0000 (09:56 +0200)] 
Merge pull request #34730 from yuwata/boot-efi-follow-ups

boot/efi: several follow-ups for recent change

13 months agonetwork/address: use config_parse_in_addr_non_null() at one more place 34749/head
Yu Watanabe [Sun, 13 Oct 2024 06:17:07 +0000 (15:17 +0900)] 
network/address: use config_parse_in_addr_non_null() at one more place

No functional change, just refactoring.

13 months agonetwork/address: do not set family in config_parse_broadcast()
Yu Watanabe [Sun, 13 Oct 2024 06:08:04 +0000 (15:08 +0900)] 
network/address: do not set family in config_parse_broadcast()

The family will be checked later in
address_section_verify() -> address_section_adjust_broadcast(),
hence it is not necessary to set here.

Follow-up for 5d15c7b19cae6d3332d4e213c380e0fcc1317a2c.

Fixes oss-fuzz#372994449.
Fixes #34748.

13 months agoMerge pull request #34555 from rpigott/busctl-wait
Yu Watanabe [Sun, 13 Oct 2024 09:50:48 +0000 (18:50 +0900)] 
Merge pull request #34555 from rpigott/busctl-wait

busctl: add wait verb to wait for signals

13 months agobusctl: add a test for busctl wait 34555/head
Ronan Pigott [Wed, 2 Oct 2024 18:57:24 +0000 (11:57 -0700)] 
busctl: add a test for busctl wait

13 months agoMerge pull request #34520 from vcaputo/mmap-cache-unused-min
Yu Watanabe [Sun, 13 Oct 2024 05:48:35 +0000 (14:48 +0900)] 
Merge pull request #34520 from vcaputo/mmap-cache-unused-min

mmap-cache: enforce an unused windows minimum

13 months agobusctl: add wait verb to wait for signals
Ronan Pigott [Thu, 26 Sep 2024 01:42:59 +0000 (18:42 -0700)] 
busctl: add wait verb to wait for signals

It's like busctl call, but it waits for a signal rather than a reply to
a method call.

13 months agopo: Translated using Weblate (Chinese (Simplified) (zh_CN))
lumingzh [Sun, 13 Oct 2024 00:38:42 +0000 (02:38 +0200)] 
po: Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 100.0% (253 of 253 strings)

Co-authored-by: lumingzh <lumingzh@qq.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main

13 months agotest: add test for local outbounds with preferred source address 34745/head
Yu Watanabe [Sat, 12 Oct 2024 22:24:08 +0000 (07:24 +0900)] 
test: add test for local outbounds with preferred source address

13 months agolocal-addresses: honor RTA_PREFSRC field of gateway
Yu Watanabe [Sat, 12 Oct 2024 21:56:38 +0000 (06:56 +0900)] 
local-addresses: honor RTA_PREFSRC field of gateway

Fixes #34739.

13 months agolocal-addresses: use FOREACH_ARRAY() macro
Yu Watanabe [Sat, 12 Oct 2024 21:30:58 +0000 (06:30 +0900)] 
local-addresses: use FOREACH_ARRAY() macro

13 months agosha256: use memory-util-fundamental.h 34730/head
Yu Watanabe [Sat, 12 Oct 2024 20:56:25 +0000 (05:56 +0900)] 
sha256: use memory-util-fundamental.h

Prompted by https://github.com/systemd/systemd/pull/34722#discussion_r1797352922.

13 months agoboot/efi/log: always include filename, line, and function in log message
Yu Watanabe [Fri, 11 Oct 2024 19:01:28 +0000 (04:01 +0900)] 
boot/efi/log: always include filename, line, and function in log message

Then, drop unused log_trace().

13 months agoboot/efi/smbios: initialize output parameters if entries not found
Yu Watanabe [Fri, 11 Oct 2024 18:53:37 +0000 (03:53 +0900)] 
boot/efi/smbios: initialize output parameters if entries not found

13 months agoboot/efi: trivial coding style cleanups
Yu Watanabe [Fri, 11 Oct 2024 18:52:10 +0000 (03:52 +0900)] 
boot/efi: trivial coding style cleanups

Follow-ups for #34717 and #34718.

13 months agooomctl: sort contexts with cgroup path
Yu Watanabe [Sat, 12 Oct 2024 01:36:02 +0000 (10:36 +0900)] 
oomctl: sort contexts with cgroup path

13 months agobus-message-util: introduce bus_message_dump_fd() and _string() 34743/head
Yu Watanabe [Sat, 12 Oct 2024 00:49:23 +0000 (09:49 +0900)] 
bus-message-util: introduce bus_message_dump_fd() and _string()

Then, use them in analyze and oomctl.

13 months agoanalyze: fall back to simple method from dump_patterns() and friends
Yu Watanabe [Sat, 12 Oct 2024 00:46:50 +0000 (09:46 +0900)] 
analyze: fall back to simple method from dump_patterns() and friends

No functional change, just refactoring.

13 months agoAdd integration test for ExtraFileDescriptors after daemon-reexec
Ryan Wilson [Fri, 11 Oct 2024 20:38:58 +0000 (13:38 -0700)] 
Add integration test for ExtraFileDescriptors after daemon-reexec

This commit adds a corresponding integration test for ExtraFileDescriptors
after systemctl daemon-reexec. This ensures systemd keeps the file
descriptors while the service manager is restarting and we don't lose
ability to restart the service correctly.

13 months agoukify: Require both key and cert be set in generate_keys
Jörg Behrmann [Fri, 11 Oct 2024 12:34:15 +0000 (14:34 +0200)] 
ukify: Require both key and cert be set in generate_keys

If either is None the write in this branch of the code will fail.

13 months agoukify: Add missing typing for iterator
Jörg Behrmann [Thu, 10 Oct 2024 16:23:35 +0000 (18:23 +0200)] 
ukify: Add missing typing for iterator

13 months agoMerge pull request #34591 from teknoraver/timer
Yu Watanabe [Fri, 11 Oct 2024 23:12:38 +0000 (08:12 +0900)] 
Merge pull request #34591 from teknoraver/timer

timer: introduce DeferReactivation setting

13 months agoMerge pull request #34698 from yuwata/udev-node-lock-file
Yu Watanabe [Fri, 11 Oct 2024 23:12:10 +0000 (08:12 +0900)] 
Merge pull request #34698 from yuwata/udev-node-lock-file

udev-node: remove stack directories and their lock files by workers, rather than manager

13 months agoMerge pull request #34722 from anonymix007/fundamental-sha1
Yu Watanabe [Fri, 11 Oct 2024 23:11:35 +0000 (08:11 +0900)] 
Merge pull request #34722 from anonymix007/fundamental-sha1

fundamental: Add SHA1

13 months agotimer: add unit tests for DeferReactivation 34591/head
Matteo Croce [Fri, 4 Oct 2024 23:39:37 +0000 (01:39 +0200)] 
timer: add unit tests for DeferReactivation

Create a unit test for systemd timer DeferReactivation config option.
The test works by creating a timer which fires every 5 seconds and
starts an unit which runs for 5 seconds.
With DeferReactivation=true, the timer must fire every 5+5 seconds,
instead of the 5 it fires normally.

As we need at least two timer runs to check if the delta is correct,
the test duration on success will be at least 20 seconds.
To be safe, the test script waits 35 seconds: this is enough to get
at least three runs but low enough to avoid clogging the CI.

13 months agotimer: introduce DeferReactivation setting
Arthur Shau [Thu, 14 Mar 2024 19:43:13 +0000 (12:43 -0700)] 
timer: introduce DeferReactivation setting

By default, in instances where timers are running on a realtime schedule,
if a service takes longer to run than the interval of a timer, the
service will immediately start again when the previous invocation finishes.
This is caused by the fact that the next elapse is calculated based on
the last trigger time, which, combined with the fact that the interval
is shorter than the runtime of the service, causes that elapse to be in
the past, which in turn means the timer will trigger as soon as the
service finishes running.

This behavior can be changed by enabling the new DeferReactivation setting,
which will cause the next calendar elapse to be calculated based on when
the trigger unit enters inactivity, rather than the last trigger time.

Thus, if a timer is on an realtime interval, the trigger will always
adhere to that specified interval.
E.g. if you have a timer that runs on a minutely interval, the setting
guarantees that triggers will happen at *:*:00 times, whereas by default
this may skew depending on how long the service runs.

Co-authored-by: Matteo Croce <teknoraver@meta.com>
13 months agoTEST-17-UDEV: also check if /run/udev/links.lock/ is empty on settle 34698/head
Yu Watanabe [Thu, 10 Oct 2024 18:37:01 +0000 (03:37 +0900)] 
TEST-17-UDEV: also check if /run/udev/links.lock/ is empty on settle

13 months agoudev-node: drop unnecessary manager side cleaning up logic for stack directory
Yu Watanabe [Thu, 10 Oct 2024 01:42:24 +0000 (10:42 +0900)] 
udev-node: drop unnecessary manager side cleaning up logic for stack directory

Unnecessary stack directories and their lock files are removed by
workers. Hence, the logic is not necessary anymore.

13 months agoudev-node: drop workaround for by-diskseq symlinks
Yu Watanabe [Thu, 10 Oct 2024 01:36:46 +0000 (10:36 +0900)] 
udev-node: drop workaround for by-diskseq symlinks

This effectively reverts 09373c1a50297079e6b0447ea97af4e9a60f77fa,
as stack directories and lock files are removed by udev workers on
unlocking.

13 months agoudev-node: remove lockfile and stack directory when not necessary if possible
Yu Watanabe [Thu, 10 Oct 2024 01:33:22 +0000 (10:33 +0900)] 
udev-node: remove lockfile and stack directory when not necessary if possible

Replaces 09373c1a50297079e6b0447ea97af4e9a60f77fa.

Let's remove stack directories and their lock files by workers if
possible.

Now, lock files must be created before creating stack directories, hence
lock files are moved to /run/udev/links.lock/ , e.g.,
Before:
  /run/udev/links/disk\x2fby-diskseq\x2f1/.lock
After:
  /run/udev/links.lock/disk\x2fby-diskseq\x2f1

Fixes ##34637.

13 months agoMerge pull request #34700 from yuwata/network-conf-parser
Yu Watanabe [Fri, 11 Oct 2024 20:22:11 +0000 (05:22 +0900)] 
Merge pull request #34700 from yuwata/network-conf-parser

network: several cleanups for conf parsers

13 months agotest: Add tests for SHA1 34722/head
anonymix007 [Fri, 11 Oct 2024 13:30:43 +0000 (16:30 +0300)] 
test: Add tests for SHA1

13 months agofundamental: Import SHA1 implementation from libxcrypt
anonymix007 [Tue, 10 Sep 2024 13:58:20 +0000 (16:58 +0300)] 
fundamental: Import SHA1 implementation from libxcrypt

13 months agomacro: Add DISABLE_WARNING_STRINGOP_OVERREAD
anonymix007 [Fri, 11 Oct 2024 13:44:54 +0000 (16:44 +0300)] 
macro: Add DISABLE_WARNING_STRINGOP_OVERREAD

While at it, also add -Wunknown-warning-option to basic_disabled_warnings to fix compilation with clang

13 months agoreport bpf_current_task_under_cgroup() errors to userspace
Matteo Croce [Fri, 11 Oct 2024 16:26:58 +0000 (18:26 +0200)] 
report bpf_current_task_under_cgroup() errors to userspace

bpf_current_task_under_cgroup() returns 1 if the task is under the
specified cgroup, 0 if not, negative if an error happens.

Differentiate the 1 and -1 cases, and report to userspace when we got
and error.
An error like this is mostly unlikely, the only common one is that the
userspace doesn't populate the map, and the call returns -EAGAIN.

Tested by mocking the return value of bpf_current_task_under_cgroup():
    Enumeration completed
    enp1s0f0np0: Configuring with /etc/systemd/network/20-test.network.
    Sysctl monitor BPF returned error: Link number out of range
    Sysctl monitor BPF returned error: No CSI structure available
    Sysctl monitor BPF returned error: Invalid exchange
    Sysctl monitor BPF returned error: Exchange full
    Sysctl monitor BPF returned error: Invalid request code
    Sysctl monitor BPF returned error: Unknown error 58
    Sysctl monitor BPF returned error: Device not a stream
    Sysctl monitor BPF returned error: Timer expired
    Sysctl monitor BPF returned error: Machine is not on the network
    Sysctl monitor BPF returned error: Object is remote
    Sysctl monitor BPF returned error: Advertise error

13 months agoMerge pull request #34720 from YHNdnzj/extra-fds-followup
Yu Watanabe [Fri, 11 Oct 2024 19:46:51 +0000 (04:46 +0900)] 
Merge pull request #34720 from YHNdnzj/extra-fds-followup

core: several follow-ups for ExtraFileDescriptors

13 months agosystemd-update-helper: Show executed commands if debug logging is enabled
Daan De Meyer [Fri, 11 Oct 2024 14:51:04 +0000 (16:51 +0200)] 
systemd-update-helper: Show executed commands if debug logging is enabled

13 months agonetwork/route: use log_section_warning() more 34700/head
Yu Watanabe [Sun, 22 Sep 2024 21:34:02 +0000 (06:34 +0900)] 
network/route: use log_section_warning() more

13 months agonetwork/route: use generic [Route] section parser more
Yu Watanabe [Sun, 22 Sep 2024 21:20:05 +0000 (06:20 +0900)] 
network/route: use generic [Route] section parser more

13 months agonetwork/route: use log_syntax_parse_error() more
Yu Watanabe [Sun, 22 Sep 2024 20:51:37 +0000 (05:51 +0900)] 
network/route: use log_syntax_parse_error() more

13 months agonetwork/route-nexthop: use generic [Route] section parser more
Yu Watanabe [Sun, 22 Sep 2024 20:43:22 +0000 (05:43 +0900)] 
network/route-nexthop: use generic [Route] section parser more

13 months agonetwork/route-nexthop: use log_syntax_parse_error()
Yu Watanabe [Sun, 22 Sep 2024 20:40:55 +0000 (05:40 +0900)] 
network/route-nexthop: use log_syntax_parse_error()