]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agocore/exec-invoke: raise the log level of missing executable to notice
Mike Yuan [Mon, 19 Feb 2024 12:43:47 +0000 (20:43 +0800)] 
core/exec-invoke: raise the log level of missing executable to notice

Suggested in
https://github.com/systemd/systemd/pull/31351#discussion_r1494450831:

> one above just informational, but also not a warning yet.

7 months agocore/exec-invoke: record correct exit status when failed to locate executable
Mike Yuan [Fri, 16 Feb 2024 12:00:06 +0000 (20:00 +0800)] 
core/exec-invoke: record correct exit status when failed to locate executable

Follow-up for 4d8b0f0f7aeadc401ac02f67576ccb1de8cf79e6

After the mentioned commit, when the ExecCommand executable is missing,
and failure will be ignored by manager, we exit with EXIT_SUCCESS at executor
side too. The behavior however contradicts systemd.service(5), which states:

> If the executable path is prefixed with "-", an exit code of the command
> normally considered a failure (i.e. non-zero exit status or abnormal exit
> due to signal is _recorded_, but has no further effect and is considered
> equivalent to success.

and thus makes debugging unexpected failures harder. Therefore, let's still
exit with EXIT_EXEC, but just skip LOG_ERR level log.

7 months agoci(labeler): add policy for `escape` labeler
Jan Macku [Mon, 19 Feb 2024 15:00:25 +0000 (16:00 +0100)] 
ci(labeler): add policy for `escape` labeler

7 months agoSet SYSTEMD_LOG_LEVEL=info explicitly in test-sysusers
Daan De Meyer [Mon, 19 Feb 2024 13:35:07 +0000 (14:35 +0100)] 
Set SYSTEMD_LOG_LEVEL=info explicitly in test-sysusers

If we're looking for output on stderr, let's make sure it's not
littered with debug logs if SYSTEMD_LOG_LEVEL=debug.

7 months agoMerge pull request #31386 from mrc0mmand/test-tweaks
Frantisek Sumsal [Mon, 19 Feb 2024 13:53:31 +0000 (14:53 +0100)] 
Merge pull request #31386 from mrc0mmand/test-tweaks

Revert "test: use btrfs by default on Arch as well"

7 months agoMerge pull request #30840 from AdrianVovk/homed-bulk-v2
Luca Boccassi [Mon, 19 Feb 2024 13:39:26 +0000 (13:39 +0000)] 
Merge pull request #30840 from AdrianVovk/homed-bulk-v2

Homed bulk directories v2

7 months agoupdate TODO 30840/head
Adrian Vovk [Wed, 17 Jan 2024 02:34:10 +0000 (21:34 -0500)] 
update TODO

7 months agoTEST-46-HOMED: Add tests for blob directories
Adrian Vovk [Thu, 11 Jan 2024 23:23:47 +0000 (18:23 -0500)] 
TEST-46-HOMED: Add tests for blob directories

7 months agohomectl: Add flags to edit blob directories
Adrian Vovk [Wed, 10 Jan 2024 22:25:00 +0000 (17:25 -0500)] 
homectl: Add flags to edit blob directories

This makes it possible to edit blob directories using homectl. The
following syntax is available:

* `--blob-directory=/path/somewhere`: Replaces the entire blob directory
with the contents of /path/somewhere

* `--blob-directory=foobar=/path/somewhere`: Replaces just the file
foobar in the blob directory with the contents of /path/somewhere

* `--blob-directory=foobar=`: Deletes the file foobar from the blob
directory

* `--blob-directory=`: Resets all previous flags

* `--avatar=`, etc: Shortcuts for `--blob-directory=FILENAME=` for the
known files in the blob directory

7 months agohomework: Handle Update & Create w/ blob dir
Adrian Vovk [Wed, 10 Jan 2024 03:06:35 +0000 (22:06 -0500)] 
homework: Handle Update & Create w/ blob dir

Introduces new extended variants of the various incarnations of
Create and Update, which take a map of filenames to FDs. This map is
then used to populate the bulk directory.

FDs are used to prevent the client from abusing homed's blob directory
permissions (everything is made world-readable by homed) to open files
that they normally aren't allowed to open. Passing along an FD ensures
that the client has read access to the file it wants homed to make
world-readable.

Internally, homework uses the map to overwrite the system blob dir.
Later, homework's existing blob dir reconciliation logic will propagate
the new contents from the system blob dir into the embedded blob
dir

7 months agohomework: Reconcile blob directories
Adrian Vovk [Tue, 9 Jan 2024 19:39:38 +0000 (14:39 -0500)] 
homework: Reconcile blob directories

Whenever the host & embedded records are reconciled, the host & embedded
blob directories are now reconciled too in the same direction.
Reconciling the blob directories serves exactly the same purpose as
reconciling the user records, and thus should behave in the same way.

7 months agohomed: Create & advertise blob directory
Adrian Vovk [Mon, 8 Jan 2024 23:37:52 +0000 (18:37 -0500)] 
homed: Create & advertise blob directory

This ensures that a user-specific blob directory exists in
/var/cache/systemd/homed for as long as the user exists, and gets
deleted if the user gets deleted.

It also advertises this blob directory via the user record, so that
clients can find and use it.

7 months agouser-record: Add blobDirectory and blobManifest
Adrian Vovk [Mon, 8 Jan 2024 23:11:43 +0000 (18:11 -0500)] 
user-record: Add blobDirectory and blobManifest

These fields are used to connect a JSON user record to its blob
directory, and to include the directory's contents in the record's
signature

7 months agoDocument blob directory behavior
Adrian Vovk [Mon, 8 Jan 2024 22:21:55 +0000 (17:21 -0500)] 
Document blob directory behavior

We're documenting the behavior of blob directories here. These docs
refer to things that aren't yet implemented at the time of the commit, but will be later in the same PR.

7 months agofd-util: Expose helper to pack fds into 3,4,5,...
Adrian Vovk [Tue, 13 Feb 2024 20:09:54 +0000 (15:09 -0500)] 
fd-util: Expose helper to pack fds into 3,4,5,...

This is useful for situations where an array of FDs is to be passed into
a child process (i.e. by passing it through safe_fork). This function
can be called in the child (before calling exec) to pack the FDs to all
be next to each-other starting from SD_LISTEN_FDS_START (i.e. 3)

7 months agoMerge pull request #31364 from bluca/vpick_ext
Luca Boccassi [Mon, 19 Feb 2024 11:15:54 +0000 (11:15 +0000)] 
Merge pull request #31364 from bluca/vpick_ext

core: add support for vpick for ExtensionImages=/ExtensionDirectories=

7 months agotest: temporarily enable session lingering for the test user 31386/head
Frantisek Sumsal [Mon, 19 Feb 2024 09:37:30 +0000 (10:37 +0100)] 
test: temporarily enable session lingering for the test user

So the user daemon with the long-running service is not killed while we
test the journal:

[  834.077080] testsuite-04.sh[10937]: Running as unit: user-sleep.service; invocation ID: b1f2c9c9a14a40ce836c867139d14dc8
[  834.077687] systemd[10943]: Started user-sleep.service.
[  834.078437] (sd-pam)[10952]: pam_unix(login:session): session closed for user testuser
[  834.078643] systemd[1]: run-u3.service: Deactivated successfully.
[  834.078710] testsuite-04.sh[10930]: + for _ in {0..9}
[  834.078710] testsuite-04.sh[10930]: + journalctl --rotate
...
[  834.081253] systemd[1]: session-7.scope: Deactivated successfully.
...
[  844.602065] testsuite-04.sh[10930]: + journalctl --rotate
[  844.630414] testsuite-04.sh[10930]: + journalctl --sync
[  844.632005] systemd[1]: Stopping user@4711.service...
[  844.634179] systemd[10943]: Activating special unit exit.target...
[  844.635769] systemd[10943]: Stopped target default.target.
[  844.636136] systemd[10943]: Stopped target timers.target.
[  844.636479] systemd[10943]: Stopping user-sleep.service...
[  844.636998] systemd[10943]: Stopped user-sleep.service.
...
[  844.758893] testsuite-04.sh[10930]: + systemctl stop --user -M testuser@ user-sleep.service
[  845.213399] systemctl[11066]: Failed to stop user-sleep.service: Unit user-sleep.service not loaded.

7 months agoRevert "test: use btrfs by default on Arch as well"
Frantisek Sumsal [Mon, 19 Feb 2024 10:23:31 +0000 (11:23 +0100)] 
Revert "test: use btrfs by default on Arch as well"

There's something very wrong going on when using btrfs for the test
images, namely:
  - there's a significant performance hit, i.e. the Arch Linux run is
    ~20% slower, in the coverage run the situation is even worse
  - intermittent boot failures
  - intermittent "No space left on device" errors (even though there's
    enough free space)

Since debugging this might take a while, let's temporarily revert back
to ext4 to make the CI stable again.

This reverts commit 7eb7e3ec4f5dbc13ee729557e1544527f3101187.

7 months agosd-radv: fix potential buffer overflow
Yu Watanabe [Mon, 19 Feb 2024 00:30:17 +0000 (09:30 +0900)] 
sd-radv: fix potential buffer overflow

Fixes a bug in 1925f829ab17cee7d65cc8c350d8281f8f41588e and
6a6d27bc5b08388964118e922f0c1b49b3c6a8ae (v255).

7 months agopam-util: include cache ID of bus connection in the log message
Yu Watanabe [Mon, 19 Feb 2024 03:02:04 +0000 (12:02 +0900)] 
pam-util: include cache ID of bus connection in the log message

To make it easier to debug issues like #31375.

7 months agocore/exec: do not crash with UtmpMode=user without User= setting
Yu Watanabe [Mon, 19 Feb 2024 04:04:28 +0000 (13:04 +0900)] 
core/exec: do not crash with UtmpMode=user without User= setting

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

Replaces #31356.

7 months agovconsole-setup: don't fail if the only found vc is already used by plymouth
Franck Bui [Thu, 1 Feb 2024 08:13:10 +0000 (09:13 +0100)] 
vconsole-setup: don't fail if the only found vc is already used by plymouth

During the boot process, systemd-vconsole-setup can be started when the only
allocated VC is already taken by plymouth.

This case is expected when a boot splash is displayed hence
systemd-vconsole-setup.service should not fail if it happens.

However rather than doing nothing, the sysfs utf8 flag is set before exiting
early.

7 months agotest: make testcase_owneridmap() compatible with coverage runs
Frantisek Sumsal [Sun, 18 Feb 2024 09:25:56 +0000 (10:25 +0100)] 
test: make testcase_owneridmap() compatible with coverage runs

Follow-up for 614d09a.

7 months agoman: fix typo in uid0.xml
Luca Boccassi [Sun, 18 Feb 2024 13:01:21 +0000 (13:01 +0000)] 
man: fix typo in uid0.xml

Follow-up for 72eb3081b21a12252159e24188e25d04f14af83c

7 months agoTODO: fix typo
Yu Watanabe [Sat, 17 Feb 2024 22:14:42 +0000 (07:14 +0900)] 
TODO: fix typo

Follow-up for 10e3f15ac1258dd62bbb01e29375264d33e17deb.

7 months agoMerge pull request #31318 from mrc0mmand/test-switch-to-btrfs
Yu Watanabe [Sat, 17 Feb 2024 19:55:56 +0000 (04:55 +0900)] 
Merge pull request #31318 from mrc0mmand/test-switch-to-btrfs

test: use btrfs by default on Arch as well

7 months agoMerge pull request #31362 from yuwata/network-fix-dhcp-pd-ready
Yu Watanabe [Sat, 17 Feb 2024 19:55:13 +0000 (04:55 +0900)] 
Merge pull request #31362 from yuwata/network-fix-dhcp-pd-ready

network: do not request DHCP addresses configured on checking prefix delegation

7 months agotest: "modernize" TEST-55-OOMD's init 31318/head
Frantisek Sumsal [Fri, 16 Feb 2024 12:53:01 +0000 (13:53 +0100)] 
test: "modernize" TEST-55-OOMD's init

7 months agotest: don't abbreviate log messages when dumping the test journal
Frantisek Sumsal [Fri, 16 Feb 2024 12:49:50 +0000 (13:49 +0100)] 
test: don't abbreviate log messages when dumping the test journal

To make debugging test fails easier.

7 months agotest: use btrfs' mkswapfile on btrfs
Frantisek Sumsal [Wed, 14 Feb 2024 10:48:56 +0000 (11:48 +0100)] 
test: use btrfs' mkswapfile on btrfs

So it's created automagically with proper attributes.

7 months agotest: make TEST-08-INITRD slightly less annoying to debug
Frantisek Sumsal [Wed, 14 Feb 2024 15:45:18 +0000 (16:45 +0100)] 
test: make TEST-08-INITRD slightly less annoying to debug

Forward journal to console, since we won't have any journal from initrd
and shutdown/exit initrd phases. Also, mention
systemd.journald.max_level_console=debug that is very handy for
debugging initrd shenanigans, but don't use it by default since it
sends a _lot_ of stuff to the serial console, which slows down the test
a lot.

7 months agotest: always try to install the ext4 module
Frantisek Sumsal [Wed, 14 Feb 2024 10:24:05 +0000 (11:24 +0100)] 
test: always try to install the ext4 module

So the tests work even if the base image filesystem is not ext4.

7 months agotest: use btrfs by default on Arch as well
Frantisek Sumsal [Wed, 14 Feb 2024 09:36:55 +0000 (10:36 +0100)] 
test: use btrfs by default on Arch as well

7 months agotest-network: add one more test case for DHCP prefix delegation 31362/head
Yu Watanabe [Fri, 16 Feb 2024 20:56:27 +0000 (05:56 +0900)] 
test-network: add one more test case for DHCP prefix delegation

For issue #31349.

7 months agotest-network: split test_dhcp6pd() into small pieces
Yu Watanabe [Fri, 16 Feb 2024 20:47:55 +0000 (05:47 +0900)] 
test-network: split test_dhcp6pd() into small pieces

7 months agonetwork: do not request DHCP addresses configured on checking prefix delegation
Yu Watanabe [Fri, 16 Feb 2024 19:30:34 +0000 (04:30 +0900)] 
network: do not request DHCP addresses configured on checking prefix delegation

This does not change anything for DHCPv4, as a DHCPv4 address is always
requested anyway. However for DHCPv6, the client may not request IA_NA
addresses by UseAddress=no, or even if it is requested, the server may
not provide any IA_NA addresses. Even in such cases, here the check is
for delegated prefixes, hence it is not necessary to check if DHCPv6
IA_NA addresses are configured.

Fixes a bug introduced by 195b83edf852f4e40e0d3a3b630cde97c84d77ba.

Fixes #31349.

7 months agonetwork/dhcp6: deem DHCPv6 configuration to be finished even if no IA_NA is provided
Yu Watanabe [Fri, 16 Feb 2024 20:52:40 +0000 (05:52 +0900)] 
network/dhcp6: deem DHCPv6 configuration to be finished even if no IA_NA is provided

Follow-up for fc4aa64c2d7bf1443bf30b66d334e33addb0d27a.

Otherwise, even if we request no address, Link.dhcp6_configured stuck on
false.

7 months agocore: add support for vpick for ExtensionDirectories= 31364/head
Luca Boccassi [Fri, 16 Feb 2024 22:05:03 +0000 (22:05 +0000)] 
core: add support for vpick for ExtensionDirectories=

7 months agocore: add support for vpick for ExtensionImages=
Luca Boccassi [Fri, 16 Feb 2024 21:45:42 +0000 (21:45 +0000)] 
core: add support for vpick for ExtensionImages=

7 months agoman: create reusable snippet for 'vpick' entries
Luca Boccassi [Fri, 16 Feb 2024 21:45:01 +0000 (21:45 +0000)] 
man: create reusable snippet for 'vpick' entries

7 months agoMerge pull request #31367 from yuwata/cgroup-runtime-fix
Luca Boccassi [Sat, 17 Feb 2024 10:24:06 +0000 (10:24 +0000)] 
Merge pull request #31367 from yuwata/cgroup-runtime-fix

core/cgroup: several follow-up about CGroupRuntime

7 months agoresolve: name field may be NULL
Yu Watanabe [Sat, 17 Feb 2024 08:26:06 +0000 (17:26 +0900)] 
resolve: name field may be NULL

Follow-up for e1634bb8321c5534a8e5d16b474c7e9d43ef3baa.

Fixes #31361.

7 months agocore/unit: fix superficial NULL-pointer dereference 31367/head
Yu Watanabe [Sat, 17 Feb 2024 07:50:42 +0000 (16:50 +0900)] 
core/unit: fix superficial NULL-pointer dereference

Though, when unit_prepare_exec() is called, the unit should always
have the cgroup runtime context 'crt'. So, I think we can insert assert().
But, for consistency with other places that call unit_get_cgroup_runtime(),
here use the simple non-NULL check for 'crt' instead of using assert().

Follow-up for 9cc545447e31ed38d71c00d5957c4dee0b5bce97.

Fixes CID#1534667.

7 months agocore/cgroup: drop duplicated free()s
Yu Watanabe [Sat, 17 Feb 2024 07:46:16 +0000 (16:46 +0900)] 
core/cgroup: drop duplicated free()s

Follow-up for 9cc545447e31ed38d71c00d5957c4dee0b5bce97.

Fixes CID#1534665 and CID#1534666.

7 months agoMerge pull request #31127 from poettering/cgroup-runtime2
Luca Boccassi [Fri, 16 Feb 2024 23:38:53 +0000 (23:38 +0000)] 
Merge pull request #31127 from poettering/cgroup-runtime2

core: split out cgroup specific state fields from Unit → CGroupRuntime

7 months agoMerge pull request #31338 from ssahani/network-bond-missed
Yu Watanabe [Fri, 16 Feb 2024 21:16:42 +0000 (06:16 +0900)] 
Merge pull request #31338 from ssahani/network-bond-missed

network: netdev - bond add support for ARP missed max

7 months agoresolve: provide service resolve over varlink
Vishal Chillara Srinivas [Wed, 15 Nov 2023 07:08:23 +0000 (12:38 +0530)] 
resolve: provide service resolve over varlink

ported the d-bus implementation of service resolve to varlink
extended TEST-75-RESOLVED to cover this use-case

7 months agoMerge pull request #31218 from CodethinkLabs/vmspawn/journal_forwarding
Luca Boccassi [Fri, 16 Feb 2024 12:09:52 +0000 (12:09 +0000)] 
Merge pull request #31218 from CodethinkLabs/vmspawn/journal_forwarding

vmspawn: support journal forwarding

7 months agovarlink: fix varlink_collect_full not resetting state
Tomáš Pecka [Fri, 16 Feb 2024 08:43:18 +0000 (09:43 +0100)] 
varlink: fix varlink_collect_full not resetting state

The varlink_collect_full function did not set varlink client's state
when the reply was an error. The state was stuck in "collecting-reply".

I discovered that while hacking on network varlink interface (adding a
new varlink method). The debug logs shows the process of performing the
first query which replies with an error:

  varlink: Setting state idle-client
  network: Sending message: {"method":"io.systemd.Network.LLDPNeighbors","parameters":{"ifindex":1},"more":true}
  network: Changing state idle-client → collecting
  network: Received message: {"error":"org.varlink.service.MethodNotFound","parameters":{"method":"io.systemd.Network.LLDPNeighbors"}}
  network: Changing state collecting → collecting-reply

Now another varlink_collect call is being made, but

  network: Connection busy.
  Failed to execute varlink call: Device or resource busy

This was not caught by the tests because there were no varlink_collect
calls that resulted in error reply.

7 months agoMerge pull request #31311 from yuwata/journal-user-corruption
Luca Boccassi [Fri, 16 Feb 2024 12:07:50 +0000 (12:07 +0000)] 
Merge pull request #31311 from yuwata/journal-user-corruption

journal: fix user journal corruption on rotation

7 months agohwdb: Remove version check in CH Pro Pedals rule
Colin Geniet [Thu, 15 Feb 2024 19:23:49 +0000 (20:23 +0100)] 
hwdb: Remove version check in CH Pro Pedals rule

CH Pedals are incorrectly reported as an accelerometer [1], because they
have no button.  This is fixed by a rule in 60-input-id.hwdb [2], but
the rule checks id/version="0100", while my pedals report id/version="0111".

So there are several versions of the pedals, presumably all affected
by the bug. Remove the version check in the rule to fix them all.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=81889
[2] commit: 230ed4c4ba (hwdb: CH Pro Pedals not classified correctly due to no buttons, 2022-01-19)
    PR: https://github.com/systemd/systemd/pull/22184

7 months agovmspawn: fix possible NULL dereference in discover_boot_entry
Sam Leonard [Thu, 15 Feb 2024 18:16:17 +0000 (18:16 +0000)] 
vmspawn: fix possible NULL dereference in discover_boot_entry

7 months agoMerge pull request #30263 from msizanoen1/fix-onboot-rotate-2
Lennart Poettering [Fri, 16 Feb 2024 11:02:09 +0000 (12:02 +0100)] 
Merge pull request #30263 from msizanoen1/fix-onboot-rotate-2

journal: Reset runtime seqnum data when flushing to system journal

7 months agotest: properly preserve journal from sd-bsod tests
Frantisek Sumsal [Thu, 15 Feb 2024 20:13:07 +0000 (21:13 +0100)] 
test: properly preserve journal from sd-bsod tests

I (incorrectly) assumed that --relinquish-var does everything --flush
does, including moving already existing stuff from /var/log/journal/ to
/run/log/journal/, but that's not the case. To actually do that we need
to shuffle things manually, so let's do just that.

This should make issues like #31334 easier to debug, since with this
patch we now have a coredump in the test journal as well:

~# make -C test/TEST-04-JOURNAL/ clean setup run TEST_MATCH_SUBTEST=bsod BUILD_DIR=$PWD/build TEST_NO_NSPAWN=1
...
[   12.176089] testsuite-04.sh[712]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-04.bsod.sh failed'
[   12.176089] testsuite-04.sh[712]: Subtest /usr/lib/systemd/tests/testdata/units/testsuite-04.bsod.sh failed
[   12.176089] testsuite-04.sh[712]: + return 1
[   12.177347] systemd[1]: testsuite-04.service: Failed with result 'exit-code'.
[   12.220580] systemd[1]: Failed to start testsuite-04.service.
Spawning getter /home/mrc0mmand/repos/@systemd/systemd/build/journalctl -o export -D /var/tmp/systemd-tests/systemd-test.Qtqmmr/root/var/log/journal...
Finishing after writing 7649 entries
TEST-04-JOURNAL: (failed; see logs)
-rw-r----- 1 root root 16777216 Feb 15 21:13 /var/tmp/systemd-tests/systemd-test.Qtqmmr/system.journal
...

~# coredumpctl --file /var/tmp/systemd-tests/systemd-test.Qtqmmr/system.journal
TIME                        PID UID GID SIG     COREFILE EXE                           SIZE
Thu 2024-02-15 21:13:38 CET 812   0   0 SIGABRT journal  /usr/lib/systemd/systemd-bsod    -

7 months agotest-network: Add test for bond arp_missed_max option 31338/head
Susant Sahani [Thu, 15 Feb 2024 15:44:58 +0000 (21:14 +0530)] 
test-network: Add test for bond arp_missed_max option

7 months agoupdate TODO 31127/head
Lennart Poettering [Tue, 6 Feb 2024 17:33:33 +0000 (18:33 +0100)] 
update TODO

7 months agocore: split out cgroup specific state fields from Unit → CGroupRuntime
Lennart Poettering [Sat, 27 Jan 2024 09:59:15 +0000 (10:59 +0100)] 
core: split out cgroup specific state fields from Unit → CGroupRuntime

This refactors the Unit structure a bit: all cgroup-related state fields
are moved to a new structure CGroupRuntime, which is only allocated as
we realize a cgroup.

This is both a nice cleanup and should make unit structures considerably
smaller that have no cgroup associated, because never realized or
because they belong to a unit type that doesn#t have cgroups anyway.

This makes things nicely symmetric:

        ExecContext → static user configuration about execution
        ExecRuntime → dynamic user state of execution
        CGroupContext → static user configuration about cgroups
        CGroupRuntime → dynamic user state of cgroups

And each time the XyzContext is part of the unit type structures such as
Service or Slice that need it, but the runtime object is only allocated
when a unit is started.

7 months agocgroup: normalize parameter order in format_cgroup_memory_comparison()
Lennart Poettering [Tue, 6 Feb 2024 14:57:35 +0000 (15:57 +0100)] 
cgroup: normalize parameter order in format_cgroup_memory_comparison()

We usually put the return parameter last. Do so here too.

7 months agonetwork: netdev - bond add support for ARP missed max
Susant Sahani [Thu, 15 Feb 2024 10:41:22 +0000 (16:11 +0530)] 
network: netdev - bond add support for ARP missed max

Allows to configure bond arp_missed_max is the maximum number of arp_interval monitor cycle
for missed ARP replies. If this number is exceeded, link is reported as
down.

7 months agopo: Translated using Weblate (Lithuanian)
mooo [Thu, 15 Feb 2024 23:36:05 +0000 (00:36 +0100)] 
po: Translated using Weblate (Lithuanian)

Currently translated at 69.6% (158 of 227 strings)

Co-authored-by: mooo <hazap@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/lt/
Translation: systemd/main

7 months agoMerge pull request #31320 from DaanDeMeyer/versioning
Daan De Meyer [Thu, 15 Feb 2024 19:15:04 +0000 (20:15 +0100)] 
Merge pull request #31320 from DaanDeMeyer/versioning

meson: Start adding devel and rc suffixes to the project version

7 months agotest: add test cases for journal corruption on btrfs 31311/head
Frantisek Sumsal [Sat, 10 Feb 2024 07:24:10 +0000 (16:24 +0900)] 
test: add test cases for journal corruption on btrfs

For issue #24150 and #31222.

7 months agojournal-file-util: use COPY_VERIFY_LINKED
Yu Watanabe [Thu, 15 Feb 2024 13:46:06 +0000 (22:46 +0900)] 
journal-file-util: use COPY_VERIFY_LINKED

As the main thread may call journal_directory_vacuum() ->
unlinkat_deallocate() while another thread is copying the file.

Fixes #24150 and #31222.

7 months agocopy: introduce COPY_VERIFY_LINKED flag
Yu Watanabe [Thu, 15 Feb 2024 10:37:43 +0000 (19:37 +0900)] 
copy: introduce COPY_VERIFY_LINKED flag

If the flag is set, then copy_file() and friends check if the source
file still exists when the copy operation finished.

7 months agosd-journal: use stat_verify_linked()
Yu Watanabe [Thu, 15 Feb 2024 01:08:23 +0000 (10:08 +0900)] 
sd-journal: use stat_verify_linked()

7 months agostat-util: introduce {stat,fd}_verify_linked()
Yu Watanabe [Thu, 15 Feb 2024 10:16:36 +0000 (19:16 +0900)] 
stat-util: introduce {stat,fd}_verify_linked()

7 months agostat-util: rebreak comment
Yu Watanabe [Thu, 15 Feb 2024 10:16:16 +0000 (19:16 +0900)] 
stat-util: rebreak comment

7 months agobsod: fix -c/--continuous support
Yu Watanabe [Thu, 15 Feb 2024 16:05:51 +0000 (01:05 +0900)] 
bsod: fix -c/--continuous support

Fixes a bug introduced by f7f062bf9f194dc14a4ffc6e7fff9d8bfdea2147.

Fixes #31334.

7 months agoMerge pull request #31331 from yuwata/xopenat
Yu Watanabe [Thu, 15 Feb 2024 16:32:21 +0000 (01:32 +0900)] 
Merge pull request #31331 from yuwata/xopenat

tree-wide: several cleanups related to xopenat()

7 months agojournal-file-util: use the file descriptor of journal file on copy 31331/head
Yu Watanabe [Wed, 14 Feb 2024 00:36:45 +0000 (09:36 +0900)] 
journal-file-util: use the file descriptor of journal file on copy

No effective functionality changed, just refactoring.

7 months agotest: add test for copying symlink with copy_tree_at()
Yu Watanabe [Thu, 15 Feb 2024 10:00:54 +0000 (19:00 +0900)] 
test: add test for copying symlink with copy_tree_at()

7 months agocopy: use xopenat() to make 'from' argument optional
Yu Watanabe [Wed, 14 Feb 2024 22:06:21 +0000 (07:06 +0900)] 
copy: use xopenat() to make 'from' argument optional

7 months agofs-util: rename xopenat() -> xopanat_full()
Yu Watanabe [Wed, 14 Feb 2024 23:23:35 +0000 (08:23 +0900)] 
fs-util: rename xopenat() -> xopanat_full()

7 months agoloop-util: fix error handling
Yu Watanabe [Thu, 15 Feb 2024 15:16:00 +0000 (00:16 +0900)] 
loop-util: fix error handling

Follow-up for 972c8db589f1f031d1fbbe01d821ddb1795fe285.

7 months agochattr-util: fix error code
Yu Watanabe [Thu, 15 Feb 2024 11:04:00 +0000 (20:04 +0900)] 
chattr-util: fix error code

Follow-up for cf91b9155c20a57bfc756b2b7e1a8f401f2bf16d.

7 months agochase: do not wrap xopenat() with RET_NERRNO()
Yu Watanabe [Thu, 15 Feb 2024 11:02:51 +0000 (20:02 +0900)] 
chase: do not wrap xopenat() with RET_NERRNO()

Follow-up for 47f0e1b5e04c27572b540ae4a86e522d268ffd3c.

7 months agofs-util: readlinkat() supports an empty string
Yu Watanabe [Wed, 14 Feb 2024 22:01:17 +0000 (07:01 +0900)] 
fs-util: readlinkat() supports an empty string

From readlinkat(2):
Since Linux 2.6.39, pathname can be an empty string, in which case the
call operates on the symbolic link referred to by dirfd (which should
have been obtained using open(2) with the O_PATH and O_NOFOLLOW flags).

7 months agoMerge pull request #30910 from YHNdnzj/logind-followup
Luca Boccassi [Thu, 15 Feb 2024 14:32:48 +0000 (14:32 +0000)] 
Merge pull request #30910 from YHNdnzj/logind-followup

logind-user: switch tracking logic to user-runtime-dir@.service

7 months agosystemctl: drop chain invocation of telinit
Michael Biebl [Thu, 8 Feb 2024 13:06:00 +0000 (14:06 +0100)] 
systemctl: drop chain invocation of telinit

This functionality relied on telinit being available in a different path
then the compat symlink shipped by systemd itself. This is no longer the
case for any known distro, so remove that code.

Fixes: #31220
Replaces: #31249

7 months agoman: enchance sd_bus_set_watch_bind() example to handle one more failure
Luca Boccassi [Wed, 14 Feb 2024 17:14:21 +0000 (17:14 +0000)] 
man: enchance sd_bus_set_watch_bind() example to handle one more failure

In case the D-Bus policy is not set up correctly the example just
loops forever. Check the return of sd_bus_request_name_async() in
a callback and exit if the error is not temporary.

Follow-up for 34bbda18a5f07fa5a52e8d85d20637ce1c00c4ec

7 months agovmspawn: add --forward-journal= 31218/head
Sam Leonard [Tue, 6 Feb 2024 11:27:17 +0000 (11:27 +0000)] 
vmspawn: add --forward-journal=

7 months agojournal-remote: allow AF_VSOCK and AF_UNIX for --listen-raw
Sam Leonard [Mon, 22 Jan 2024 16:12:39 +0000 (16:12 +0000)] 
journal-remote: allow AF_VSOCK and AF_UNIX for --listen-raw

This allows log messages forwarded over an AF_UNIX or AF_VSOCK socket by
journald to be received by systemd-journal-remote.

7 months agojournald: implement socket forwarding
Sam Leonard [Thu, 21 Dec 2023 15:32:15 +0000 (15:32 +0000)] 
journald: implement socket forwarding

This commit adds a new way of forwarding journal messages - forwarding
over a socket.

The socket can be any of AF_INET, AF_INET6, AF_UNIUX or AF_VSOCK.

The address to connect to is retrieved from the "journald.forward_address" credential.

It can also be specified in systemd-journald's unit file with ForwardAddress=

7 months agojournald: Add assertions to config_parse_compress
Sam Leonard [Tue, 13 Feb 2024 08:44:00 +0000 (08:44 +0000)] 
journald: Add assertions to config_parse_compress

7 months agocore/manager: don't propagate manager session env to children 30910/head
Mike Yuan [Tue, 13 Feb 2024 04:47:53 +0000 (12:47 +0800)] 
core/manager: don't propagate manager session env to children

Follow-up for 4cb4e6cf6dce2b66dcb59a8534aa6ca885e2f732

Fixes #31287

7 months agoenv-util: minor modernization
Mike Yuan [Tue, 13 Feb 2024 04:59:00 +0000 (12:59 +0800)] 
env-util: minor modernization

7 months agologind-session: use Requires= for user{,-runtime-dir}@.service
Mike Yuan [Fri, 12 Jan 2024 13:30:49 +0000 (21:30 +0800)] 
logind-session: use Requires= for user{,-runtime-dir}@.service

Since we do require these basic user services, let's make
the dependency stronger. Note that logind should enqueue
start jobs for these already in user_start(), so mostly
just paranoia.

7 months agologind-user: track user started/stopping state through user-runtime-dir@.service
Mike Yuan [Sat, 13 Jan 2024 18:38:11 +0000 (02:38 +0800)] 
logind-user: track user started/stopping state through user-runtime-dir@.service

Before #30884, the user state is tied to user@.service (user service
manager). However, #30884 introduced sessions that need no manager,
and we can no longer rely on that.

Consider the following situation:

1. A 'background-light' session '1' is created (i.e. no user service manager
   is needed)
2. Session '1' scope unit pulls in user-runtime-dir@.service
3. Session '1' exits. A stop job is enqueued for user-runtime-dir@.service
   due to StopWhenUnneeded=yes
4. At the same time, another session '2' which requires user manager is started.
   However, session scope units have JobMode=fail, therefore the start job
   for user-runtime-dir@.service that was pulled in by session '2' scope job
   is deleted as it conflicts with the stop job.

We want session scope units to continue using JobMode=fail, but we still need
the dependencies to be started correctly, i.e. explicitly requested by logind
beforehand. Therefore, let's stop using StopWhenUnneeded=yes for
user-runtime-dir@.service, and track users' `started` and `stopping` state
based on that when user@.service is not needed. Then, for every invocation
of user_start(), we'll recheck if we need the service manager and start it
if so.

Also, the dependency type on user-runtime-dir@.service from user@.service
is upgraded to `BindsTo=`, in order to ensure that when logind stops the
former, the latter is stopped as well.

7 months agologin/logind-session-dbus: some follow-ups for 'user-incomplete' (#30226)
Mike Yuan [Wed, 14 Feb 2024 16:43:14 +0000 (00:43 +0800)] 
login/logind-session-dbus: some follow-ups for 'user-incomplete' (#30226)

We don't usually say ", refusing" in bus error messages.
Also, make use of unref_and_replace_full.

7 months agokeyring-util: Use reported key size to resize buf
Adrian Vovk [Thu, 1 Feb 2024 22:53:01 +0000 (17:53 -0500)] 
keyring-util: Use reported key size to resize buf

According to keyctl(2), the return value for KEYCTL_READ is:

    The amount of data that is available in the key,
    irrespective of the provided buffer size

So, we could pass in a NULL buffer to query the size, then allocate the
exact right amount of space, then call keyctl again to get the key data.
However, we must still keep the for loop to avoid TOCTOU issues: the key
might have been replaced with something bigger while we're busy
allocating the buffer to store it.

Thus, we can actually save a syscall by picking some reasonable default
buffer size and skipping the NULL call to keyctl. If our default is big
enough, we're done and have saved a syscall! If not, then the first call
behaves essentially the same as the NULL call, and we use the size it
returns to reallocate the buffer appropriately.

7 months agonspawn: add support for owneridmap bind option
Benjamin Franzke [Fri, 17 Nov 2023 07:03:57 +0000 (08:03 +0100)] 
nspawn: add support for owneridmap bind option

owneridmap bind option will map the target directory owner from inside the
container to the owner of the directory bound from the host filesystem.
This will ensure files and directories created in the container will be owned
by the directory owner of the host filesystem. All other users will remain
unmapped. Files to be written as other users in the container will not be
allowed.

Resolves: #27037

7 months agolog: reorder arguments of internal macro
Yu Watanabe [Thu, 15 Feb 2024 01:49:49 +0000 (10:49 +0900)] 
log: reorder arguments of internal macro

To make the order matches with log_internal().

No functional change. Hopefully silence coverity issues like
CID#1534478, CID#1534479, CID#1534480, CID#1534482.

7 months agotest: fix cleanup function
Yu Watanabe [Thu, 15 Feb 2024 03:11:06 +0000 (12:11 +0900)] 
test: fix cleanup function

Follow-up for 8349bbdfd829c80fc5eabaca6c9d0afed28d1b3f.

7 months agohomed: Pass in username and uid as Polkit details
Adrian Vovk [Fri, 2 Feb 2024 19:53:01 +0000 (14:53 -0500)] 
homed: Pass in username and uid as Polkit details

This lets the Javascript polkit policies to decide whether to
allow/deny/authenticate based on the user that's being operated on.

7 months agovmspawn: fix alignment of merged initrd
Yu Watanabe [Thu, 15 Feb 2024 01:44:21 +0000 (10:44 +0900)] 
vmspawn: fix alignment of merged initrd

Follow-up for 811ad9e6b2b243428165c239aeb4791bc65b93dd.

Fixes CID#1534481.

7 months agoMerge pull request #31330 from yuwata/sd-journal-trivial-cleanups
Daan De Meyer [Thu, 15 Feb 2024 07:56:56 +0000 (08:56 +0100)] 
Merge pull request #31330 from yuwata/sd-journal-trivial-cleanups

sd-journal: trivial cleanups

7 months agocopy: rebreak comment and fix typo
Yu Watanabe [Thu, 15 Feb 2024 01:19:02 +0000 (10:19 +0900)] 
copy: rebreak comment and fix typo

7 months agosd-journal: fix potential memory leak 31330/head
Yu Watanabe [Wed, 14 Feb 2024 00:21:13 +0000 (09:21 +0900)] 
sd-journal: fix potential memory leak

Though, hopefully, the memory leak is hypothetical, as we always close
journal file with the timer by journal_file_offline_close().

7 months agojournal-file-util: drop unused template argument for journal_file_open_reliably()
Yu Watanabe [Fri, 9 Feb 2024 11:21:25 +0000 (20:21 +0900)] 
journal-file-util: drop unused template argument for journal_file_open_reliably()

I understand that the original motivation to introduce the template
argument here is to make journal_file_open() and _reliabrly() take the
same arguments. But, yeah, that's completely unused, not necessary to
complicate the code even the difference is not big.

7 months agosd-journal: use -EBADF for journal_file_open()
Yu Watanabe [Wed, 14 Feb 2024 21:06:20 +0000 (06:06 +0900)] 
sd-journal: use -EBADF for journal_file_open()