platform/upstream/systemd.git
11 months agohomed: properly handle operation exit statusses
Lennart Poettering [Tue, 28 Nov 2023 14:41:41 +0000 (15:41 +0100)]
homed: properly handle operation exit statusses

11 months agoshared/cryptsetup-util: build problematic code only in developer mode
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2023 16:28:06 +0000 (17:28 +0100)]
shared/cryptsetup-util: build problematic code only in developer mode

This code doesn't link when gcc+lld is used:

$ LDFLAGS=-fuse-ld=lld meson setup build-lld && ninja -C build-lld udevadm
...
ld.lld: error: src/shared/libsystemd-shared-255.a(libsystemd-shared-255.a.p/cryptsetup-util.c.o):
  symbol crypt_token_external_path@@ has undefined version
collect2: error: ld returned 1 exit status

As a work-around, restrict it to developer mode.

Closes https://github.com/systemd/systemd/issues/30218.

11 months agoman: typo, it's DHCP not DCHP in DHCPPrefixDelegation=
Дамјан Георгиевски [Tue, 28 Nov 2023 18:53:57 +0000 (19:53 +0100)]
man: typo, it's DHCP not DCHP in DHCPPrefixDelegation=

11 months agoboot: suffix SecureBoot message with newline
Lennart Poettering [Mon, 27 Nov 2023 11:50:09 +0000 (12:50 +0100)]
boot: suffix SecureBoot message with newline

Output is otherwise so weird, since this is the last log line seen for a
while typically, and if it doesn#t put the cursor back in the first
column it looks like something is incomplete and hanging. Hence do what
we always do: finish log messages with a newline.

11 months agopam-util: fix pam_syslog_pam_error() format string
Lennart Poettering [Tue, 28 Nov 2023 10:05:52 +0000 (11:05 +0100)]
pam-util: fix pam_syslog_pam_error() format string

To cut off a string at some position we must set the "precision" not the
field width in format strings.

This led to some assert()s being hit where they really should not be.

11 months agogpt-auto-generator: enable TPM2 unlocking in gpt-auto-generator
Lennart Poettering [Fri, 24 Nov 2023 13:35:43 +0000 (14:35 +0100)]
gpt-auto-generator: enable TPM2 unlocking in gpt-auto-generator

If we detect a TPM, let's also unlock the disk with it, if it has an
enrollment for that.

Fixes: #30176

11 months agoMerge pull request #30203 from yuwata/resolve-dump-cache
Luca Boccassi [Tue, 28 Nov 2023 15:35:11 +0000 (15:35 +0000)]
Merge pull request #30203 from yuwata/resolve-dump-cache

resolve: fix varlink message verification

11 months agoMerge pull request #30216 from poettering/loginctl-table-tweaks
Luca Boccassi [Tue, 28 Nov 2023 15:33:35 +0000 (15:33 +0000)]
Merge pull request #30216 from poettering/loginctl-table-tweaks

loginctl: minor tweaks to tabular output

11 months agoMerge pull request #30220 from yuwata/journald-vs-soft-reboot
Luca Boccassi [Tue, 28 Nov 2023 15:32:08 +0000 (15:32 +0000)]
Merge pull request #30220 from yuwata/journald-vs-soft-reboot

unit: stop journald before SIGKILL on soft-reboot

11 months agologinctl: show null fields for unset seat/tty fields of sessions
Lennart Poettering [Mon, 27 Nov 2023 14:10:42 +0000 (15:10 +0100)]
loginctl: show null fields for unset seat/tty fields of sessions

11 months agologinctl: set appropriate ersatz strings for all tables
Lennart Poettering [Mon, 27 Nov 2023 14:09:53 +0000 (15:09 +0100)]
loginctl: set appropriate ersatz strings for all tables

11 months agologind: align columns of a table
Lennart Poettering [Mon, 27 Nov 2023 14:00:12 +0000 (15:00 +0100)]
logind: align columns of a table

11 months agoutmp-wtmp: fix wrong suffix assignment on putting dead process
Yu Watanabe [Mon, 27 Nov 2023 23:45:31 +0000 (08:45 +0900)]
utmp-wtmp: fix wrong suffix assignment on putting dead process

Fixes a bug introduced by f1d553e9dfd56f95b7564dd20a0b56e6a0d6492c.

Fixes #30213.

11 months agocore/cgroup: fix compile error
Yu Watanabe [Tue, 28 Nov 2023 04:02:02 +0000 (13:02 +0900)]
core/cgroup: fix compile error

With gcc-13,
```
CFLAGS="-O3 -fno-semantic-interposition" meson setup build
```
triggers the following error:
```
../src/core/cgroup.c: In function ‘cgroup_context_dump’:
../src/core/cgroup.c:633:44: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  633 |                         "%sDeviceAllow: %s %s\n",
      |                                            ^~
cc1: some warnings being treated as errors
```

Fixes #30223.

11 months agotest: check journal files are not corrupted after soft-reboot
Yu Watanabe [Sun, 26 Nov 2023 00:25:22 +0000 (09:25 +0900)]
test: check journal files are not corrupted after soft-reboot

11 months agounit: make journald stopped on soft-reboot before broadcasting SIGKILL
Yu Watanabe [Mon, 27 Nov 2023 23:32:22 +0000 (08:32 +0900)]
unit: make journald stopped on soft-reboot before broadcasting SIGKILL

Workaround for #30195.

11 months agoman: also SIGKILL is sent on soft-reboot
Yu Watanabe [Sat, 25 Nov 2023 20:43:46 +0000 (05:43 +0900)]
man: also SIGKILL is sent on soft-reboot

11 months agovarlinkctl: add short comment
Yu Watanabe [Sat, 25 Nov 2023 20:34:10 +0000 (05:34 +0900)]
varlinkctl: add short comment

11 months agocapability-util: avoid false-positive use-of-uninitialized-value error
Yu Watanabe [Mon, 27 Nov 2023 23:25:06 +0000 (08:25 +0900)]
capability-util: avoid false-positive use-of-uninitialized-value error

fuzzers randomly fail with the following:
```
==172==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f41169cb39b in update_argv /work/build/../../src/systemd/src/basic/argv-util.c:96:13
    #1 0x7f41169cb39b in rename_process /work/build/../../src/systemd/src/basic/argv-util.c:210:16
    #2 0x7f4116b6824e in safe_fork_full /work/build/../../src/systemd/src/basic/process-util.c:1516:21
    #3 0x7f4116bffa36 in safe_fork /work/build/../../src/systemd/src/basic/process-util.h:191:16
    #4 0x7f4116bffa36 in parse_timestamp /work/build/../../src/systemd/src/basic/time-util.c:1047:13
    #5 0x4a61e6 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-time-util.c:16:16
    #6 0x4c4a13 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #7 0x4c41fa in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #8 0x4c58c9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #9 0x4c6595 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #10 0x4b58ff in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #11 0x4def52 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #12 0x7f4115ea3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: e678fe54a5d2c2092f8e47eb0b33105e380f7340)
    #13 0x41f5ad in _start (build-out/fuzz-time-util+0x41f5ad)

DEDUP_TOKEN: update_argv--rename_process--safe_fork_full
  Uninitialized value was created by an allocation of 'fv' in the stack frame of function 'have_effective_cap'
    #0 0x7f41169d3540 in have_effective_cap /work/build/../../src/systemd/src/basic/capability-util.c:21
```

11 months agotest: verify json format passed through varlink
Yu Watanabe [Sun, 26 Nov 2023 21:26:07 +0000 (06:26 +0900)]
test: verify json format passed through varlink

This drops logs of failed unit tests in TEST-02-UNITTESTS from the journal,
as the expected logs from test-varlink-idl makes the post script fail.
Saving logs in journal is simply noisy, and we will output anyway after
qemu or nspawn finished by check_result_{qemu,nspawn}_unittests().

11 months agotest: show saved journal files after TEST-02-UNITTESTS
Yu Watanabe [Mon, 27 Nov 2023 00:42:15 +0000 (09:42 +0900)]
test: show saved journal files after TEST-02-UNITTESTS

11 months agotest: drop remaining console output
Yu Watanabe [Sun, 26 Nov 2023 20:59:56 +0000 (05:59 +0900)]
test: drop remaining console output

Follow-up for fa6f37c04391d0103c95e24813ad345c2d5c4b67.

Partially reverts d5ab23aa54229e9e89427e7d20883bd8c93fd976 and
3540ce8587cbd21ce9c2dbec72ea7fa3d1b38a5f.

11 months agotest: add simple coverity test for 'resolvectl show-cache'
Yu Watanabe [Sun, 26 Nov 2023 04:12:19 +0000 (13:12 +0900)]
test: add simple coverity test for 'resolvectl show-cache'

11 months agovarlink: fix key name in reply of org.varlink.service.GetInterfaceDescription
Yu Watanabe [Sun, 26 Nov 2023 20:41:22 +0000 (05:41 +0900)]
varlink: fix key name in reply of org.varlink.service.GetInterfaceDescription

Fixes https://github.com/systemd/systemd/pull/30203#issuecomment-1826746111.

11 months agoresolve: fix varink message verification
Yu Watanabe [Sun, 26 Nov 2023 04:10:15 +0000 (13:10 +0900)]
resolve: fix varink message verification

Fixes #30199.

11 months agotest-time-util: suppress timestamp conversion failures for Africa/Khartoum timezone
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2023 19:58:43 +0000 (20:58 +0100)]
test-time-util: suppress timestamp conversion failures for Africa/Khartoum timezone

Our timestamp conversion roundtrip test was failing. But I think that this
is not our bug:

$ TZ='Africa/Khartoum' date --date='@1509482094'
Tue Oct 31 23:34:54 EAT 2017
$ TZ='Africa/Khartoum' date --date='Tue Oct 31 23:34:54 EAT 2017' +%s
1509485694
$ TZ='Africa/Khartoum' date --date='@1509485694'
Tue Oct 31 23:34:54 CAT 2017
$ echo $[1509485694 - 1509482094]
3600

This is essentially the same as what happens in our test. After a round-trip, we
end up one hour ahead.

> For 1509482094632752, from the change log of tzdata:
>
> Release 2017c - 2017-10-20 14:49:34 -0700
>
>  Changes to future timestamps
>    Sudan will switch from +03 to +02 on 2017-11-01.

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

11 months agoMerge pull request #30170 from bluca/exec_bpf_fd
Luca Boccassi [Mon, 27 Nov 2023 15:44:50 +0000 (15:44 +0000)]
Merge pull request #30170 from bluca/exec_bpf_fd

core: pass bpf_outer_map_fd to sd-executor only if RestrictFileSystems was set

11 months agohwdb: ieee1394-unit-function: add Sony DVMC-DA1
Adam Goldman [Sun, 26 Nov 2023 10:45:25 +0000 (02:45 -0800)]
hwdb: ieee1394-unit-function: add Sony DVMC-DA1

This commit adds a hwdb entry for the Sony DVMC-DA1. This media converter
works with video capture software such as dvgrab, but it doesn't support
the AV/C command set and doesn't match the general entry.

11 months agoMerge pull request #30200 from mrc0mmand/test-tweaks
Yu Watanabe [Sun, 26 Nov 2023 00:10:09 +0000 (09:10 +0900)]
Merge pull request #30200 from mrc0mmand/test-tweaks

A couple of assorted fixes

11 months agotest: drop 'noearly' from crypttab
Frantisek Sumsal [Sat, 25 Nov 2023 21:30:01 +0000 (22:30 +0100)]
test: drop 'noearly' from crypttab

It's a Debian thing, we don't support it.

[   30.639971] testsuite-64.sh[475]: + systemctl restart cryptsetup.target
[   30.697667] systemd-cryptsetup[3389]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700529] systemd-cryptsetup[3390]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.700594] systemd-cryptsetup[3391]: Encountered unknown /etc/crypttab option 'noearly', ignoring.
[   30.704638] systemd-cryptsetup[3392]: Encountered unknown /etc/crypttab option 'noearly', ignoring

11 months agotest: drop invalid LogTarget= assignment
Frantisek Sumsal [Sat, 25 Nov 2023 20:59:57 +0000 (21:59 +0100)]
test: drop invalid LogTarget= assignment

It's been there since the test was introduced and I'm not really sure
what was the original intention behind it, but it makes systemd sad:

[    4.909056] systemd[1]: /usr/lib/systemd/tests/testdata/units/testsuite-44.service:13: Unknown key name 'LogTarget' in section 'Service', ignoring.

11 months agosystemctl: include unit ID in the property map
Frantisek Sumsal [Sat, 25 Nov 2023 20:36:10 +0000 (21:36 +0100)]
systemctl: include unit ID in the property map

Otherwise we get a not very nice message when trying to display a
non-existent man page:

~# systemctl cat test.service
[Unit]
Description=Hello
[Service]
ExecStart=true
~# systemctl help test.service
Documentation for (null) not known.

11 months agoimport: append % to X_IMPORT_PROGRESS=
Frantisek Sumsal [Sat, 25 Nov 2023 19:42:13 +0000 (20:42 +0100)]
import: append % to X_IMPORT_PROGRESS=

Since we parse it on the other side via parse_percent() which requires
that, otherwise we get an error:

[    8.133131] testsuite-13.sh[649]: + machinectl import-raw /tmp/container.raw container-raw
[    8.175035] machinectl[1143]: Enqueued transfer job 1. Press C-c to continue download in background.
[    8.182130] machinectl[1143]: Importing '/tmp/container.raw', saving as 'container-raw'.
[    8.182377] systemd-importd[1144]: Got invalid percent value '0', ignoring.
[    8.182451] machinectl[1143]: Imported 0%.
[    8.282669] systemd-importd[1144]: Got invalid percent value '40', ignoring.
[    8.282746] machinectl[1143]: Imported 40%.
[    8.366448] machinectl[1143]: Wrote 64.0M.
[    8.366519] machinectl[1143]: Operation completed successfully.
[    8.366617] machinectl[1143]: Exiting.

11 months agotest: remove the reboot counter just before spawning container/VM
Frantisek Sumsal [Sat, 25 Nov 2023 19:22:24 +0000 (20:22 +0100)]
test: remove the reboot counter just before spawning container/VM

Doing that in test_run() is not enough, since it's called only once and
spawns all QEMU/nspawn jobs.

11 months agoMerge pull request #30196 from YHNdnzj/fchmodat2-no-symlink
Yu Watanabe [Sat, 25 Nov 2023 18:30:58 +0000 (03:30 +0900)]
Merge pull request #30196 from YHNdnzj/fchmodat2-no-symlink

Revert "nspawn-patch-uid: try fchmodat2() to restore mode of symlink"

11 months agoMerge pull request #30197 from keszybz/vconsole-restart-no-limit
Yu Watanabe [Sat, 25 Nov 2023 17:28:06 +0000 (02:28 +0900)]
Merge pull request #30197 from keszybz/vconsole-restart-no-limit

Drop restart limit for systemd-vconsole-setup.service and some man page tweaks

11 months agounits: disable start rate limit for systemd-vconsole-setup.service
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2023 12:27:17 +0000 (13:27 +0100)]
units: disable start rate limit for systemd-vconsole-setup.service

The unit will be started or restarted a few times during boot, but but it has
StartLimitBurst = DefaultStartLimitBurst = 5, which means that the fifth
restart will already fail. On my laptop, I have exactly 4 restarts, so I don't
hit the limit, but on a slightly different system we will easily hit the limit.
In https://bugzilla.redhat.com/show_bug.cgi?id=2251394, there are five reloads
and we hit the limit.

Since 6ef512c0bb7aeb2000588d7d05e23b4681da8657 we propagate the start counter
over switch-root and daemon reloads, so it's easier to hit the limit during
boot.

In principle there might be systems with lots of vtcon devices, so let's just
allow the unit to be restarted without a limit.

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

11 months agoman/systemd-vconsole-setup: improve markup
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2023 12:15:31 +0000 (13:15 +0100)]
man/systemd-vconsole-setup: improve markup

11 months agonspawn-patch-uid: clarify that changing mode of symlink is unsupported
Mike Yuan [Sat, 25 Nov 2023 11:10:50 +0000 (19:10 +0800)]
nspawn-patch-uid: clarify that changing mode of symlink is unsupported

11 months agoRevert "nspawn-patch-uid: try fchmodat2() to restore mode of symlink"
Mike Yuan [Sat, 25 Nov 2023 10:57:53 +0000 (18:57 +0800)]
Revert "nspawn-patch-uid: try fchmodat2() to restore mode of symlink"

This reverts commit 30462563b19b92d8c6ed196d30d3cf7de90e8131.

fchmodat2(), while accepting AT_SYMLINK_NOFOLLOW as a valid flag,
always returns EOPNOTSUPP when operating on a symlink. The Linux kernel
simply doesn't support changing the mode of a symlink.

Fixes #30157

11 months agoMerge pull request #30119 from mrc0mmand/test-console
Yu Watanabe [Sat, 25 Nov 2023 03:54:11 +0000 (12:54 +0900)]
Merge pull request #30119 from mrc0mmand/test-console

test: don't redirect stdout/stderr to console

11 months agoukify: be more explicit about where to find ukify
Paymon MARANDI [Wed, 22 Nov 2023 16:44:25 +0000 (11:44 -0500)]
ukify: be more explicit about where to find ukify

when KERNEL_INSTALL_UKIFY is not supplied we set ukify to $PWD/ukify

that will fail (perhaps only for manual installations):
FileNotFoundError: [Errno 2] No such file or directory: '/usr/src/linux-6.7-rc1/ukify'

this will make sure we have a sane default for UKIFY

Signed-off-by: Paymon MARANDI <paymon@utubeipod.xyz>
11 months agoudevadm: exiting udevadm monitor normally under SIGTERM or SIGINT
huyubiao [Fri, 24 Nov 2023 06:43:43 +0000 (14:43 +0800)]
udevadm: exiting udevadm monitor normally under SIGTERM or SIGINT

Under SIGTERM or SIGINT, exit event and release resources, and exit udevadm monitor normally.

11 months agoanalyze: return earlier when there is no path to be prepended
Yu Watanabe [Fri, 24 Nov 2023 14:42:04 +0000 (23:42 +0900)]
analyze: return earlier when there is no path to be prepended

Follow-up for 2f6181ad4d6c126e3ebf6880ba30b3b0059c6fc8.

Addresses the post-merge comment:
https://github.com/systemd/systemd/pull/30172#discussion_r1404209035

11 months agoMerge pull request #30188 from YHNdnzj/memory-accounting-followup
Yu Watanabe [Sat, 25 Nov 2023 03:52:48 +0000 (12:52 +0900)]
Merge pull request #30188 from YHNdnzj/memory-accounting-followup

core: a few fixes and improvements for memory accounting

11 months agorun: escape command for description
Yu Watanabe [Fri, 24 Nov 2023 16:05:41 +0000 (01:05 +0900)]
run: escape command for description

The command arguments may contain spurious characters, e.g. line-break.
When we use command arguments as a description of a unit, we should
escape them.

Fixes #30187.

11 months agorules: don't condition usb-gadget.target target on 'add' action
Lennart Poettering [Fri, 24 Nov 2023 17:05:47 +0000 (18:05 +0100)]
rules: don't condition usb-gadget.target target on 'add' action

The dependency should exist continously, like all our similar deps do.
Hence drop the "add" conditionalization.

11 months agotest: don't redirect stdout/stderr to console
Frantisek Sumsal [Tue, 21 Nov 2023 08:37:21 +0000 (09:37 +0100)]
test: don't redirect stdout/stderr to console

Turns out that redirecting a lot of output to the console can have some
funny effects, like random kernel soft lockups. I spotted this in
various CIs, but it remained almost entirely hidden thanks to
`softlockup_panic=1`, until 1a36d2672f which introduced a couple of
tests that log quite a lot in a short amount of time. This, in
combination with newer kernel version, which, for some reason, seem to
be more susceptible to such soft lockups, made the Arch Linux jobs soft
lockup quite a lot, see [0].

While debugging this I also noticed that runs which don't redirect
stdout/stderr to the console are noticeably faster, e.g.:

    # TEST-71 nspawn + QEMU (KVM), StandardOutput=journal+console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:24.64
    # TEST-71 nspawn + QEMU (KVM), StandardOutput=journal
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:17.95

    # TEST-71 nspawn + QEMU, StandardOutput=journal+console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 2:04.70
    # TEST-71 nspawn + QEMU, StandardOutput=journal
    Elapsed (wall clock) time (h:mm:ss or m:ss): 1:44.48

    # TEST-04 QEMU, StandardOutput=journal+console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 4:22.70
    # TEST-04 QEMU, StandardOutput=console
    Elapsed (wall clock) time (h:mm:ss or m:ss): 5:04.67

Given all this, let's effectively revert ba7abf79a5, and dump the
testsuite-related journal messages only after the test finishes, so they
don't go through the slow console.

Resolves: systemd/systemd-centos-ci#660

[0] https://github.com/systemd/systemd-centos-ci/issues/660

11 months agotest: add a couple of tests for RestrictFileSystems=
Frantisek Sumsal [Fri, 24 Nov 2023 15:00:15 +0000 (16:00 +0100)]
test: add a couple of tests for RestrictFileSystems=

11 months agocore/cgroup: use the cached memory accounting value when cgroup is gone
Mike Yuan [Fri, 24 Nov 2023 15:20:41 +0000 (23:20 +0800)]
core/cgroup: use the cached memory accounting value when cgroup is gone

Follow-up for 9824ab1f009e99b0b9d273ace4c98cc687a4c1d7

Fixes https://github.com/systemd/systemd/issues/28542#issuecomment-1825413237

11 months agobus-print-properties: prettify more unset properties
Mike Yuan [Fri, 24 Nov 2023 15:31:55 +0000 (23:31 +0800)]
bus-print-properties: prettify more unset properties

11 months agobus-print-properties: ignore CGROUP_LIMIT_MAX for Memory*{Current,Peak}
Mike Yuan [Fri, 24 Nov 2023 11:15:40 +0000 (19:15 +0800)]
bus-print-properties: ignore CGROUP_LIMIT_MAX for Memory*{Current,Peak}

MemoryCurrent and MemoryAvailable are shown as "[not set]" when UINT64_MAX
(unset). Let's do the same for the newly-added Memory*{Current,Peak} properties.

11 months agocore/dbus-unit: don't log cgroup v1 property name
Mike Yuan [Fri, 24 Nov 2023 11:12:06 +0000 (19:12 +0800)]
core/dbus-unit: don't log cgroup v1 property name

11 months agoman: reword the list of PE sections in systemd-stub
Zbigniew Jędrzejewski-Szmek [Fri, 24 Nov 2023 14:19:50 +0000 (15:19 +0100)]
man: reword the list of PE sections in systemd-stub

Let's put the section name at the beginning of each sentence. This way we
can avoid awkward constructs like "kernel is looked for in the .linux section".
Also, since the paragraph above says that this is a list of "PE sections", we
can just say "section". In other places, it is often useful to say "PE section"
to avoid ambiguity.

Also fix the off-by-one in the count of sections.

11 months agoupdate TODO
Lennart Poettering [Fri, 24 Nov 2023 12:24:57 +0000 (13:24 +0100)]
update TODO

11 months agotest: don't make the final vacuum multiple of 8M
Frantisek Sumsal [Tue, 21 Nov 2023 10:31:36 +0000 (11:31 +0100)]
test: don't make the final vacuum multiple of 8M

As this would usually mean we'd nuke everything, since there are two
open journals - system and user - both being 8M in size.

11 months agotest: clean up the save_journal() stuff a bit
Frantisek Sumsal [Mon, 20 Nov 2023 22:34:09 +0000 (23:34 +0100)]
test: clean up the save_journal() stuff a bit

Let's save all journals from the test machine instead of calling export
on each journal file separately, which makes the code less complicated
(and probably faster).

11 months agoMerge pull request #30172 from yuwata/analyze-verify-unit-path
Luca Boccassi [Fri, 24 Nov 2023 10:35:28 +0000 (10:35 +0000)]
Merge pull request #30172 from yuwata/analyze-verify-unit-path

analyze: do not prepend CWD to SYSTEMD_UNIT_PATH needlessly

11 months agopcrextend: fix minor memory leak
Lennart Poettering [Thu, 23 Nov 2023 21:23:23 +0000 (22:23 +0100)]
pcrextend: fix minor memory leak

Also, simplify the code a bit by using json_dispatch_unbase64_iovec().

11 months agologin: do not clear wall message before shutting down
Yu Watanabe [Thu, 23 Nov 2023 21:42:22 +0000 (06:42 +0900)]
login: do not clear wall message before shutting down

This fixes a regression caused by 5ed73478e1b1560274038ef30ec6f89022b4d8f6
and aa6123e85e0baea21b6daad175da43ffea30629f.

With these commits, when Reboot dbus method or friends is called,
reset_scheduled_shutdown() is called before shutting down the system,
so the wall message was cleared.

As the wall message itself is unrelated to the scheduling of shutting
down systems, let's keep the message.

Fixes #30167.

11 months agoanalyze: do not prepend the current working directory to SYSTEMD_UNIT_PATH needlessly
Yu Watanabe [Thu, 23 Nov 2023 20:22:33 +0000 (05:22 +0900)]
analyze: do not prepend the current working directory to SYSTEMD_UNIT_PATH needlessly

If the requested unit is not in the current working directory, it is not
necessary to include the current working directory in SYSTEMD_UNIT_PATH.

Follow-up for 45519d13a4f2a3c3585e672595762ca621abe65e.

Fixes #30166.

11 months agoanalyze: set SYSTEMD_UNIT_PATH in verify_generate_path()
Yu Watanabe [Thu, 23 Nov 2023 20:20:07 +0000 (05:20 +0900)]
analyze: set SYSTEMD_UNIT_PATH in verify_generate_path()

Then, rename verify_generate_path() -> verify_set_unit_path().

11 months agoanalyze: shorten code a bit
Yu Watanabe [Thu, 23 Nov 2023 20:19:10 +0000 (05:19 +0900)]
analyze: shorten code a bit

No functional change, just refactoring.

11 months agoanalyze: drop duplicated :
Yu Watanabe [Thu, 23 Nov 2023 19:44:33 +0000 (04:44 +0900)]
analyze: drop duplicated :

Before, this returns e.g. "/current_dir::",
After, this returns e.g. "/current_dir:".

11 months agocore: remove redundant check when serializing FDs
Luca Boccassi [Thu, 23 Nov 2023 19:14:45 +0000 (19:14 +0000)]
core: remove redundant check when serializing FDs

The helpers already skip if the FD is < 0

11 months agocore: pass bpf_outer_map_fd to sd-executor only if RestrictFileSystems was set
Luca Boccassi [Thu, 23 Nov 2023 19:08:22 +0000 (19:08 +0000)]
core: pass bpf_outer_map_fd to sd-executor only if RestrictFileSystems was set

It causes SELinux denials to be raised, so restrict it only where needed

Follow-up for beb4ae87558cae

11 months agohibernate-resume: actually set HibernateInfo.offset
Mike Yuan [Thu, 23 Nov 2023 14:20:34 +0000 (22:20 +0800)]
hibernate-resume: actually set HibernateInfo.offset

Follow-up for a628d933cc67cc8b183dc809ba1451aa5b2996e5

11 months agoMerge pull request #30165 from YHNdnzj/executor-open-fix
Luca Boccassi [Thu, 23 Nov 2023 18:15:22 +0000 (18:15 +0000)]
Merge pull request #30165 from YHNdnzj/executor-open-fix

core,analyze: several fixlets

11 months agoMerge pull request #30163 from keszybz/some-docs-updates
Luca Boccassi [Thu, 23 Nov 2023 13:17:15 +0000 (13:17 +0000)]
Merge pull request #30163 from keszybz/some-docs-updates

Some docs updates

11 months agoanalyze: don't open systemd-executor needlessly
Mike Yuan [Thu, 23 Nov 2023 12:53:50 +0000 (20:53 +0800)]
analyze: don't open systemd-executor needlessly

Fixes #30162

11 months agoanalyze: use FOREACH_ARRAY more
Mike Yuan [Thu, 23 Nov 2023 12:52:16 +0000 (20:52 +0800)]
analyze: use FOREACH_ARRAY more

11 months agocore/manager: open our parent dir with O_PATH
Mike Yuan [Thu, 23 Nov 2023 12:44:32 +0000 (20:44 +0800)]
core/manager: open our parent dir with O_PATH

11 months agocore/manager: correct and simplify errno handling
Mike Yuan [Thu, 23 Nov 2023 12:38:29 +0000 (20:38 +0800)]
core/manager: correct and simplify errno handling

open_parent() is our own function that returns negative errno.

11 months agocore/manager: rename result parameter to ret
Mike Yuan [Thu, 23 Nov 2023 12:42:11 +0000 (20:42 +0800)]
core/manager: rename result parameter to ret

11 months agoman: drop recommendation to use absolute paths in ExecStart*=
Zbigniew Jędrzejewski-Szmek [Thu, 23 Nov 2023 12:18:54 +0000 (13:18 +0100)]
man: drop recommendation to use absolute paths in ExecStart*=

The only reason to recommend this would be if people had multiple commands
with the same name in the search path. This probably was never the best idea,
and it happens rarely anyway. Since the patch that dropped requirement for full
paths was introduced, we have dropped support for unmerged-usr and we're planning
to drop support for split-bin at some point too. Many people effectively have just
one directory in the search path, so there is even less reason to use an absolute
path. So let's recommend just using the command name, which makes the unit file
shorter and nicer to read.

11 months agoman/sd_bus_process: fix confusion about "synchronous"
Zbigniew Jędrzejewski-Szmek [Thu, 16 Nov 2023 10:12:00 +0000 (11:12 +0100)]
man/sd_bus_process: fix confusion about "synchronous"

An event loop is not "synchronous". So we shouldn't say that the client must
"synchrounusly poll" if we recommend an event loop. Let's just say it should
poll, and say that "sd_bus_wait()" is blocking, which is clearer and more
correct than "synchronous".

11 months agoexec-util: don't say sd-executor to avoid ambiguity
Mike Yuan [Thu, 23 Nov 2023 10:09:27 +0000 (18:09 +0800)]
exec-util: don't say sd-executor to avoid ambiguity

We have a systemd-executor binary now.

11 months agomeson: always install network example files
Zbigniew Jędrzejewski-Szmek [Wed, 22 Nov 2023 23:06:29 +0000 (00:06 +0100)]
meson: always install network example files

I started working on integrating this in the Fedora package and realized that
the example files should be installed regardless of the renamed files when
default-network=true is used. This is because the renamed files become part of
a different package, and we want to have the other files which are used as
documentation in the main package anyway.

11 months agoFinalize NEWS for v255-rc3
Luca Boccassi [Wed, 22 Nov 2023 20:41:04 +0000 (20:41 +0000)]
Finalize NEWS for v255-rc3

11 months agoio-util: actually retry on failure
Yu Watanabe [Wed, 22 Nov 2023 18:54:31 +0000 (03:54 +0900)]
io-util: actually retry on failure

Follow-up for e22c60a9d5dfc5f0b260c7906f3546aef2925998.

Fixes #30152.

11 months agoMerge pull request #30153 from bluca/news
Luca Boccassi [Wed, 22 Nov 2023 20:24:22 +0000 (20:24 +0000)]
Merge pull request #30153 from bluca/news

Update NEWS and hwdb

11 months agoNEWS: note about reexec on update, for sd-executor
Luca Boccassi [Wed, 22 Nov 2023 18:04:08 +0000 (18:04 +0000)]
NEWS: note about reexec on update, for sd-executor

11 months agoNEWS: update contributors list
Luca Boccassi [Wed, 22 Nov 2023 17:55:04 +0000 (17:55 +0000)]
NEWS: update contributors list

11 months agohwdb: update
Luca Boccassi [Wed, 22 Nov 2023 17:58:17 +0000 (17:58 +0000)]
hwdb: update

11 months agosystemctl: distinguish reload and reexec
Christian Hesse [Wed, 22 Nov 2023 13:19:12 +0000 (14:19 +0100)]
systemctl: distinguish reload and reexec

This used to log about reload, for reload and reexecution. Let's
distinguish the two cases.

11 months agoconf-parser: only read the first found main config file
Mike Yuan [Wed, 22 Nov 2023 11:04:29 +0000 (19:04 +0800)]
conf-parser: only read the first found main config file

Follow-up for 93f1da45566d064f4f053b37bbac2813631f58b1
and 8ea288db018c7dfe0016d51d4538539bab4ab6de

Before the offending commits, we only read the first found
main config file. If the main config file is symlinked to/as
a drop-in, we should break instead of continuing, for it to
be read later.

11 months agorecurse-dir: correct comment
Lennart Poettering [Wed, 22 Nov 2023 09:56:16 +0000 (10:56 +0100)]
recurse-dir: correct comment

The RECURSE_DIR_ENSURE_TYPE flag is actually interpreted by
readdir_all() already, hence rearrange comments to say so.

11 months agoMerge pull request #30145 from poettering/reset-terminal-line-editing
Luca Boccassi [Wed, 22 Nov 2023 17:43:51 +0000 (17:43 +0000)]
Merge pull request #30145 from poettering/reset-terminal-line-editing

make terminal line editing work with systemd-firstboot

11 months agoMerge pull request #30149 from yuwata/setlocale
Luca Boccassi [Wed, 22 Nov 2023 17:43:39 +0000 (17:43 +0000)]
Merge pull request #30149 from yuwata/setlocale

locale-util: do not call setlocale() when multi-threaded

11 months agoMerge pull request #30143 from poettering/machine-credential-fixes
Luca Boccassi [Wed, 22 Nov 2023 17:43:14 +0000 (17:43 +0000)]
Merge pull request #30143 from poettering/machine-credential-fixes

machine credential fixes

11 months agoMerge pull request #30024 from keszybz/one-doc-thingy
Luca Boccassi [Wed, 22 Nov 2023 17:42:51 +0000 (17:42 +0000)]
Merge pull request #30024 from keszybz/one-doc-thingy

Serialize units ratelimits and document StartLimitIntervalSec=infinity

11 months agofs-util: add comment explaining what xopenat() is for
Lennart Poettering [Wed, 22 Nov 2023 09:53:32 +0000 (10:53 +0100)]
fs-util: add comment explaining what xopenat() is for

11 months agolocale-util: drop unused init_gettext()
Yu Watanabe [Wed, 22 Nov 2023 15:34:44 +0000 (00:34 +0900)]
locale-util: drop unused init_gettext()

The function has not been used since 96d9117ad2db7d8c13f7898127eee8939e88daf1.

11 months agolocale-util: do not call setlocale() when multi-threaded
Yu Watanabe [Wed, 22 Nov 2023 15:32:48 +0000 (00:32 +0900)]
locale-util: do not call setlocale() when multi-threaded

Fixes #30141.

11 months agomachine-credential: tweak --load-credential= use a bit
Lennart Poettering [Wed, 22 Nov 2023 11:02:07 +0000 (12:02 +0100)]
machine-credential: tweak --load-credential= use a bit

Let's try to recognize paths (i.e. those with a "/") as source for
credentials to load, and then read them from the file system. Also, only read
credentials from an inbound credentials directory if the source
qualifies as valid credential name.

Otherwise print a nice error.

11 months agomachine-credential: simplify code a bit
Lennart Poettering [Wed, 22 Nov 2023 10:55:46 +0000 (11:55 +0100)]
machine-credential: simplify code a bit

11 months agomachine-credential: use word 'Credential' rather than 'MachineCredential'
Lennart Poettering [Wed, 22 Nov 2023 10:55:24 +0000 (11:55 +0100)]
machine-credential: use word 'Credential' rather than 'MachineCredential'

Probably some search/replace mistake.

11 months agomachine-credential: fix GREEDY_REALLOC error handling
Lennart Poettering [Wed, 22 Nov 2023 10:53:45 +0000 (11:53 +0100)]
machine-credential: fix GREEDY_REALLOC error handling

We must check the return value of GREEDY_REALLOC for OOM, and the
pointer are updated already on success, hence it's a bad idea to make a
copy of the pointer beforehand.

11 months agomachine-credential: fix error logging
Lennart Poettering [Wed, 22 Nov 2023 10:52:39 +0000 (11:52 +0100)]
machine-credential: fix error logging

Remove duplicate logging: let exclusively
machine_credential_load()/machine_credential_set() log, and not the
caller again.

11 months agojournal: sync immediately on shutting down journald
Yu Watanabe [Fri, 17 Nov 2023 17:58:50 +0000 (02:58 +0900)]
journal: sync immediately on shutting down journald

Otherwise, sd_event_add_time_relative() or sd_event_source_set_time_relative()
below will trigger assert_return().

Prompted by #30029.