]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
18 months agoman: update links to "New Control Group Interfaces"
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2024 10:42:18 +0000 (12:42 +0200)] 
man: update links to "New Control Group Interfaces"

18 months agoman: update links to catalog docs
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2024 10:40:30 +0000 (12:40 +0200)] 
man: update links to catalog docs

18 months agotest: suppress logs generated by journal tests
Yu Watanabe [Tue, 28 May 2024 05:05:15 +0000 (14:05 +0900)] 
test: suppress logs generated by journal tests

Note, journal_file_dump() is only used by tests.

Closes #33035.

18 months agotest: wait for the kernel finishes to attach backing file to loop device
Yu Watanabe [Tue, 28 May 2024 02:51:48 +0000 (11:51 +0900)] 
test: wait for the kernel finishes to attach backing file to loop device

Fixes #32680.

18 months agohwdb: Lenovo IdeaPad Z500 Touchpad Toggle (#33039)
Nicholas Little [Tue, 28 May 2024 00:56:53 +0000 (01:56 +0100)] 
hwdb: Lenovo IdeaPad Z500 Touchpad Toggle (#33039)

Map scancode f3 to KEY_F21.

18 months agocryptsetup: mention correct action in log message
Daniel Winzen [Mon, 27 May 2024 16:05:23 +0000 (18:05 +0200)] 
cryptsetup: mention correct action in log message

18 months agomeson: Run genkey command with --force
Daan De Meyer [Mon, 27 May 2024 14:26:25 +0000 (16:26 +0200)] 
meson: Run genkey command with --force

Sometimes meson decides to rerun the command even if the files already
exist. Let's run with --force so we don't fail if that's the case.

18 months agoMerge pull request #33038 from DaanDeMeyer/mkosi
Daan De Meyer [Mon, 27 May 2024 14:12:24 +0000 (16:12 +0200)] 
Merge pull request #33038 from DaanDeMeyer/mkosi

Various integration test improvents

18 months agotest: fix iscsi TEST-64-UDEV-STORAGE on Debian
Chris Hofstaedtler [Mon, 27 May 2024 02:33:39 +0000 (03:33 +0100)] 
test: fix iscsi TEST-64-UDEV-STORAGE on Debian

18 months agotest: Extend meson + mkosi integration test docs 33038/head
Daan De Meyer [Mon, 27 May 2024 10:00:49 +0000 (12:00 +0200)] 
test: Extend meson + mkosi integration test docs

Let's also put the meson + mkosi docs first to nudge readers towards
it instead of the old fashioned way to run the integration tests.

18 months agoRewrite testsuite README in markdown
Daan De Meyer [Mon, 27 May 2024 09:27:32 +0000 (11:27 +0200)] 
Rewrite testsuite README in markdown

Let's use markdown here like we do for everything else as well.

18 months agoMerge pull request #33028 from yuwata/blockdev-util
Luca Boccassi [Mon, 27 May 2024 10:44:38 +0000 (12:44 +0200)] 
Merge pull request #33028 from yuwata/blockdev-util

blockdev-util: also check loop/partscan sysattr

18 months agomeson: Add genkey target
Daan De Meyer [Mon, 27 May 2024 09:24:43 +0000 (11:24 +0200)] 
meson: Add genkey target

Let's automatically generate keys instead of requiring developers to
do it manually.

18 months agomeson: Look up mkosi once
Daan De Meyer [Mon, 27 May 2024 09:15:02 +0000 (11:15 +0200)] 
meson: Look up mkosi once

18 months agoexecutor: check for all permission related errnos when setting up IPC namespace
Luca Boccassi [Mon, 27 May 2024 00:52:11 +0000 (01:52 +0100)] 
executor: check for all permission related errnos when setting up IPC namespace

Denials from AppArmor are raised as EACCES, so EPERM is not enough. Do
the same check as PrivateNetwork above.

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

Related to 06384eb3c5044f632f50304a0210a402460f1189

18 months agodocs: add note about URL where to find recent Ubuntu CI logs
Luca Boccassi [Thu, 23 May 2024 16:47:25 +0000 (17:47 +0100)] 
docs: add note about URL where to find recent Ubuntu CI logs

18 months agoMerge pull request #33013 from yuwata/journal-flush
Daan De Meyer [Mon, 27 May 2024 06:56:46 +0000 (08:56 +0200)] 
Merge pull request #33013 from yuwata/journal-flush

journal: several fixlets for flushing runtime journal

18 months agoman/run0: remove @ syntax for --machine=
Mike Yuan [Sun, 26 May 2024 19:23:37 +0000 (03:23 +0800)] 
man/run0: remove @ syntax for --machine=

For run0 (as opposed to systemd-run in general), connecting to
the system bus (of localhost or container) as a different user
than root and then trying to elevate privilege from that
makes little sense:
https://github.com/systemd/systemd/issues/32997#issuecomment-2127992973

The @ syntax is mostly useful when connecting to the user bus,
which is not a use case for run0. Hence, let's remove the example.
The syntax will be properly refused in #32999.

18 months agoman/run0: remove -M alias for --machine=
Mike Yuan [Thu, 23 May 2024 18:40:37 +0000 (02:40 +0800)] 
man/run0: remove -M alias for --machine=

run0 doesn't know about the former.

18 months agoMerge pull request #33016 from YHNdnzj/transient-working-dir
Yu Watanabe [Mon, 27 May 2024 00:40:26 +0000 (09:40 +0900)] 
Merge pull request #33016 from YHNdnzj/transient-working-dir

core: several cleanups/fixes for WorkingDirectory= handling

18 months agoblockdev-util: also check loop/partscan sysattr 33028/head
Yu Watanabe [Sun, 26 May 2024 21:01:05 +0000 (06:01 +0900)] 
blockdev-util: also check loop/partscan sysattr

With https://github.com/torvalds/linux/commit/b9684a71fca793213378dd410cd11675d973eaa1 (v5.19),
we cannot check partition scanning is enabled for a loopback block device
without checking the attribute.

18 months agoblockdev-util: also check newer value of GENHD_FL_NO_PART flag
Yu Watanabe [Mon, 27 May 2024 00:21:41 +0000 (09:21 +0900)] 
blockdev-util: also check newer value of GENHD_FL_NO_PART flag

With https://github.com/torvalds/linux/commit/430cc5d3ab4d0ba0bd011cfbb0035e46ba92920c,
the value of GENHD_FL_NO_PART, previously named as GENHD_FL_NO_PART_SCAN,
is changed from 0x0200 to 0x0004. So, we need to check both flags.

18 months agorun: also show a pretty string for main exit status, if any
Mike Yuan [Sun, 26 May 2024 02:33:59 +0000 (10:33 +0800)] 
run: also show a pretty string for main exit status, if any

This brings output on par with unit_log_process_exit().

18 months agoblockdev-util: "partscan" sysattr now directly shows the enabled state
Mike Yuan [Sun, 26 May 2024 07:54:06 +0000 (15:54 +0800)] 
blockdev-util: "partscan" sysattr now directly shows the enabled state

See also: https://lore.kernel.org/r/20240502130033.1958492-3-hch@lst.de

18 months agotest: use SYSLOG_IDENTIFIER= filter instead of "journalctl -u"
Yu Watanabe [Sun, 26 May 2024 01:05:57 +0000 (10:05 +0900)] 
test: use SYSLOG_IDENTIFIER= filter instead of "journalctl -u"

"journalctl -u foo.service" may not work as expected, especially entries
for _TRANSPORT=stdout, for short-living services or when the service manager
generates debugging logs. Instead, SYSLOG_IDENTIFIER= should be reliable for
stdout. Let's use it.

An example case:
```
__CURSOR=s=06278e3bf011458e973c81d370a8f7a5;i=1e4dc;b=1b0258a5c78341609bf462c72d4541c3;m=308de65;t=6194c3895a13f;x=50c7e9af5b8cfc37
__REALTIME_TIMESTAMP=1716665017803071
__MONOTONIC_TIMESTAMP=50912869
_BOOT_ID=1b0258a5c78341609bf462c72d4541c3
SYSLOG_FACILITY=3
_UID=0
_GID=0
_MACHINE_ID=d3490e076ab24968bfa19a6aab26beb3
_HOSTNAME=H
_RUNTIME_SCOPE=system
_TRANSPORT=stdout
PRIORITY=6
_PID=2668
_STREAM_ID=3f9b8855636041988d003a9c63379b8a
SYSLOG_IDENTIFIER=echo
MESSAGE=foo
```
As you can see, there is no unit identifier.

18 months agocore: introduce unit_verify_contexts 33016/head
Mike Yuan [Sat, 25 May 2024 20:43:53 +0000 (04:43 +0800)] 
core: introduce unit_verify_contexts

Refuse WorkingDirectory=~ both in that and exec_invoke()
when dynamic user is used.

18 months agocore/unit: don't set missing_ok if WorkingDirectory=~ is explicitly requested
Mike Yuan [Sat, 25 May 2024 17:43:02 +0000 (01:43 +0800)] 
core/unit: don't set missing_ok if WorkingDirectory=~ is explicitly requested

18 months agocore/exec-invoke: add a comment that acquire_home uses result from get_fixed_user
Mike Yuan [Sat, 25 May 2024 20:16:15 +0000 (04:16 +0800)] 
core/exec-invoke: add a comment that acquire_home uses result from get_fixed_user

Prompted by https://github.com/systemd/systemd/pull/33016#discussion_r1614848067

18 months agocore/exec-invoke: drop unused param for acquire_home, prefix out param with ret_
Mike Yuan [Sat, 25 May 2024 17:36:45 +0000 (01:36 +0800)] 
core/exec-invoke: drop unused param for acquire_home, prefix out param with ret_

18 months agocore/dbus-execute: don't trigger assertion if WorkingDirectory="" or "-"
Mike Yuan [Sat, 25 May 2024 16:53:46 +0000 (00:53 +0800)] 
core/dbus-execute: don't trigger assertion if WorkingDirectory="" or "-"

Follow-up for 14631951cea807de2d482a430841c604c2040718

Before this commit, if WorkingDirectory= is empty or literally "-",
'simplified' is not populated, resulting in the ASSERT_PTR
in unit_write_settingf() below getting triggered.

Also, do not accept "-", so that the parser is consistent
with load-fragment.c

Fixes #33015

18 months agocore/dbus-execute: use correct char for representing WorkingDirectory=home
Mike Yuan [Sat, 25 May 2024 16:49:09 +0000 (00:49 +0800)] 
core/dbus-execute: use correct char for representing WorkingDirectory=home

18 months agocore/load-fragment: also clear missing_ok when WorkingDirectory=""
Mike Yuan [Sat, 25 May 2024 17:16:17 +0000 (01:16 +0800)] 
core/load-fragment: also clear missing_ok when WorkingDirectory=""

18 months agoMerge pull request #33019 from yuwata/tpm2-unseal
Mike Yuan [Sun, 26 May 2024 01:27:31 +0000 (09:27 +0800)] 
Merge pull request #33019 from yuwata/tpm2-unseal

tpm2: several fixlets

18 months agocryptenroll: upgrade log level of critical failure 33019/head
Yu Watanabe [Sat, 25 May 2024 19:45:55 +0000 (04:45 +0900)] 
cryptenroll: upgrade log level of critical failure

18 months agocryptenroll: do not pass an empty pcrlock policy
Yu Watanabe [Sat, 25 May 2024 19:42:16 +0000 (04:42 +0900)] 
cryptenroll: do not pass an empty pcrlock policy

Otherwise, tpm2_uneal() -> tpm2_build_sealing_policy() ->
tpm2_deserialize() will trigger assertion.

Prompted by #33017.

18 months agocryptsetup: use TPM2_FLAGS_USE_PCRLOCK at one more place
Yu Watanabe [Sat, 25 May 2024 19:29:00 +0000 (04:29 +0900)] 
cryptsetup: use TPM2_FLAGS_USE_PCRLOCK at one more place

Follow-up for 404aea7815595c1324947ed7f2a7502b17d3cc01.

18 months agoNEWS: mention backward incompatibility of IP forwarding
Yu Watanabe [Sat, 25 May 2024 18:57:48 +0000 (03:57 +0900)] 
NEWS: mention backward incompatibility of IP forwarding

Closes #33004.

18 months agotest: enable persistent storage for journal in TEST-82-SOFTREBOOT 33013/head
Yu Watanabe [Sat, 25 May 2024 01:11:11 +0000 (10:11 +0900)] 
test: enable persistent storage for journal in TEST-82-SOFTREBOOT

18 months agounit: also stop systemd-journal-flush.service on soft-reboot
Yu Watanabe [Fri, 24 May 2024 21:09:52 +0000 (06:09 +0900)] 
unit: also stop systemd-journal-flush.service on soft-reboot

After soft-reboot, /var/log/journal may be initially read-only,
and becomes writable a bit later. In such case, runtime journal is
initially opened by journald. Hence, we need to flush to /var when it is
ready.

18 months agojournald: always unset flushed flag when the runtime journal is opened
Yu Watanabe [Fri, 24 May 2024 21:02:39 +0000 (06:02 +0900)] 
journald: always unset flushed flag when the runtime journal is opened

If the runtime journal is opened, we will anyway write journal entries
to the runtime journal, even if the persistent journal is writable.
Hence, we need to flush the runtime journal file later.

18 months agojournald: log removal of runtime journal directories
Yu Watanabe [Fri, 24 May 2024 21:01:34 +0000 (06:01 +0900)] 
journald: log removal of runtime journal directories

18 months agojournald: close runtime journal earlier
Yu Watanabe [Fri, 24 May 2024 20:57:03 +0000 (05:57 +0900)] 
journald: close runtime journal earlier

Then, we can use SD_JOURNAL_ASSUME_IMMUTABLE flag, and the performance
of reading runtime journal should be improved.

18 months agotest: applying timezone is asynchronous
Yu Watanabe [Fri, 24 May 2024 16:32:21 +0000 (01:32 +0900)] 
test: applying timezone is asynchronous

So, we need to try to read timezone several times.
Also, on failure, show journal of timedated instead of hostnamed,
as the timezone is handled by timedated.

Hopefully fixes #33007.

18 months agoMerge pull request #33011 from yuwata/machine-id-setup-follow-ups
Luca Boccassi [Fri, 24 May 2024 22:04:11 +0000 (00:04 +0200)] 
Merge pull request #33011 from yuwata/machine-id-setup-follow-ups

machine-id-setup: several follow-ups for #32915

18 months agomachine-id-setup: update comment 33011/head
Yu Watanabe [Fri, 24 May 2024 16:47:23 +0000 (01:47 +0900)] 
machine-id-setup: update comment

If an initrd has an empty or uninitialized /etc/machine-id file,
then PID1 write a valid machine ID. So, the logic is important only on
soft-reboot. Let's mention that explicitly.

Follow-up for 16718dcf78a90faf8c5f53d7bf63e3575bc78be7.

18 months agoman: update machine-id-setup(1)
Yu Watanabe [Fri, 24 May 2024 17:01:53 +0000 (02:01 +0900)] 
man: update machine-id-setup(1)

- mention that /run/machine-id is used if exist.
- mention system.machine_id credential,
- credential, VM uuid, and container uuid are not read when --root=
  is specified or running in a chroot environment.

18 months agomachine-id-setup: use isempty() instead of empty_or_root()
Yu Watanabe [Fri, 24 May 2024 16:45:07 +0000 (01:45 +0900)] 
machine-id-setup: use isempty() instead of empty_or_root()

This effectively reverts ba540e9f1c29b430ac916918410c27171d14ab95.

https://github.com/systemd/systemd/pull/32915#discussion_r1608258136
> In many cases we allow --root=/ as a mechanism for forcing an "offline" mode,
> while still operating on the root dir. if we do the getenv_for_pid() thing
> below I'd claim this is very much an "online" operation, and hence --root=/
> should really disable that.

18 months agoupdate TODO
Lennart Poettering [Fri, 24 May 2024 12:42:27 +0000 (14:42 +0200)] 
update TODO

18 months agoMerge pull request #32994 from keszybz/kernel-install-parsing
Luca Boccassi [Fri, 24 May 2024 09:25:26 +0000 (11:25 +0200)] 
Merge pull request #32994 from keszybz/kernel-install-parsing

Improve parsing of kernel/install.conf

18 months agoman: mention that NFTSet is only available for system services
Luca Boccassi [Thu, 23 May 2024 22:11:18 +0000 (23:11 +0100)] 
man: mention that NFTSet is only available for system services

18 months agoMerge pull request #32993 from poettering/cryptenroll-no-pcr
Lennart Poettering [Thu, 23 May 2024 20:58:30 +0000 (15:58 -0500)] 
Merge pull request #32993 from poettering/cryptenroll-no-pcr

cryptenroll: make sure enrolling signed PCR policy without literal PCR policy works correctly

18 months agoTODO: drop implemented entry
Mike Yuan [Thu, 23 May 2024 17:38:53 +0000 (01:38 +0800)] 
TODO: drop implemented entry

18 months agoshared/conf-parser: do not print "(null)" as section name 32994/head
Zbigniew Jędrzejewski-Szmek [Thu, 23 May 2024 12:47:00 +0000 (14:47 +0200)] 
shared/conf-parser: do not print "(null)" as section name

Before:
/etc/kernel/install.conf:6: Unknown key name 'asdf' in section '(null)', ignoring.
After:
/etc/kernel/install.conf:6: Unknown key 'asdf', ignoring.

Also make the message a bit better.

18 months agokernel-install,bootctl: unify the config parsing procedure
Zbigniew Jędrzejewski-Szmek [Thu, 23 May 2024 12:43:50 +0000 (14:43 +0200)] 
kernel-install,bootctl: unify the config parsing procedure

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

18 months agoupdate TODO 32993/head
Lennart Poettering [Thu, 23 May 2024 12:21:59 +0000 (14:21 +0200)] 
update TODO

18 months agotpm2-util: improve compat with older unlocking tools
Lennart Poettering [Thu, 23 May 2024 11:59:23 +0000 (13:59 +0200)] 
tpm2-util: improve compat with older unlocking tools

Let's only generate the pin and pcrlock booleans if they are enabled, in
order to not unnecessarily confuse older unlocking tools.

18 months agotpm2-util: do not serialize tpm2 bank if none is specified
Lennart Poettering [Thu, 23 May 2024 11:57:07 +0000 (13:57 +0200)] 
tpm2-util: do not serialize tpm2 bank if none is specified

If both literal and signed PCR bindings are not used then we won't
determine a PCR bank to use, and hence we shouldnt attempt to serialize
it either.

Hence, if the bank is zero, skip serialization.

(And while we are at it, also skip serialization of the primary
algorithm if not set, purely to make things systematic).

[This effectively results in little change, as previously we'd then
seralize a json "null", while now we simply won't genreate the field]

18 months agocryptenroll: explicitly pick PCR bank if literal PCR binding is off, but signed PCR...
Lennart Poettering [Thu, 23 May 2024 11:53:22 +0000 (13:53 +0200)] 
cryptenroll: explicitly pick PCR bank if literal PCR binding is off, but signed PCR binding is on

We so far derived the PCR bank to use from the PCR values specified fr
literal PCR binding. However, when that's not used then we left the bank
uninitialized – which will break if signed PCR binds are used (where we
need to pick a bank too after all).

Hence, let's explicitly pick a bank to use if literal PCR values are not
used, to make things just work.

Fixes: #32946
18 months agoNEWS: finalize for v256~rc3 v256-rc3
Luca Boccassi [Wed, 22 May 2024 22:17:03 +0000 (23:17 +0100)] 
NEWS: finalize for v256~rc3

18 months agoMerge pull request #32986 from bluca/chores
Luca Boccassi [Wed, 22 May 2024 22:13:35 +0000 (00:13 +0200)] 
Merge pull request #32986 from bluca/chores

Chores for RC3

18 months agomeson: set version to 256~rc3 32986/head
Luca Boccassi [Wed, 22 May 2024 20:25:35 +0000 (21:25 +0100)] 
meson: set version to 256~rc3

18 months agoUpdate autosuspend hwdb
Luca Boccassi [Wed, 22 May 2024 20:17:24 +0000 (21:17 +0100)] 
Update autosuspend hwdb

ninja -C build update-hwdb-autosuspend

18 months agoUpdate hwdb
Luca Boccassi [Wed, 22 May 2024 20:16:39 +0000 (21:16 +0100)] 
Update hwdb

ninja -C build update-hwdb

18 months agoNEWS: update contributors list
Luca Boccassi [Wed, 22 May 2024 20:14:22 +0000 (21:14 +0100)] 
NEWS: update contributors list

18 months agolibsystemd: link with '-z nodelete'
Michal Sekletar [Wed, 22 May 2024 15:15:07 +0000 (17:15 +0200)] 
libsystemd: link with '-z nodelete'

We want to avoid reinitialization of our global variables with static
storage duration in case we get dlopened multiple times by the same
application. This will avoid potential resource leaks that could have
happened otherwise (e.g. leaking journal socket fd).

18 months agosd-bus: close peer pidfd
Christian Göttsche [Sun, 19 May 2024 13:56:18 +0000 (15:56 +0200)] 
sd-bus: close peer pidfd

Do not leak the pidfd of the peer.

Fixes: 71be64064c9e ("sd-bus: add pidfd to the sd_bus_creds structure")
18 months agovarlinkctl: when operating in --more mode, fail correcly on Varlink method error
Lennart Poettering [Sat, 11 May 2024 11:50:26 +0000 (13:50 +0200)] 
varlinkctl: when operating in --more mode, fail correcly on Varlink method error

In varlink.c we generally do not make failing callback functions fatal,
since that should be up to the app. Hence, in case of varlinkctl (where
we want failures to be fatal), make sure to propagate the error back
explicitly.

Before this change a failing call to "varlinkctl --more call …" would result in
a zero exit code. With this it will correctly exit with a non-zero exit
code.

18 months agosd-ndisc: do not print "(null)" in the log message
Yu Watanabe [Wed, 22 May 2024 15:38:38 +0000 (00:38 +0900)] 
sd-ndisc: do not print "(null)" in the log message

If we received RA with no flags set, or with an invalid preference,
previously "(null)" was printed.

Follow-up for 238ed432c347ddf7dde7825feb2672b089583103.

Fixes https://github.com/systemd/systemd/pull/32308#discussion_r1600940289.

18 months agoMerge pull request #32945 from bluca/lxc_network_test
Luca Boccassi [Wed, 22 May 2024 20:07:31 +0000 (22:07 +0200)] 
Merge pull request #32945 from bluca/lxc_network_test

Fix tests and services with PrivateNetwork=yes running under LXC with AppArmor

18 months agoMerge pull request #32975 from yuwata/revert-soft-reboot-reordering
Luca Boccassi [Wed, 22 May 2024 20:03:46 +0000 (22:03 +0200)] 
Merge pull request #32975 from yuwata/revert-soft-reboot-reordering

Revert soft-reboot unit reordering

18 months agotest: do not fail network namespace test with permission issues 32945/head
Luca Boccassi [Tue, 21 May 2024 00:43:24 +0000 (01:43 +0100)] 
test: do not fail network namespace test with permission issues

When running in LXC with AppArmor we'll most likely get an error when creating
a network namespace due to a kernel regression in < v6.2 affecting AppArmor,
resulting in denials. Like other tests, avoid failing in case of permission
issues and handle it gracefully.

18 months agounits: stop systemd-journald before systemd-soft-reboot.service 32975/head
Yu Watanabe [Wed, 22 May 2024 15:03:42 +0000 (00:03 +0900)] 
units: stop systemd-journald before systemd-soft-reboot.service

Typically, soft-reboot.target is never reached. So, without this change,
systemd-journald may be killed by PID1 on soft-reboot, and may cause
journal corruption.

18 months agoman: swap the order of soft-reboot.service and .target
Yu Watanabe [Wed, 22 May 2024 14:59:32 +0000 (23:59 +0900)] 
man: swap the order of soft-reboot.service and .target

Follow-up for the previous revert commit.

18 months agoRevert "units: do not soft-reboot before soft-reboot.target reached"
Yu Watanabe [Wed, 22 May 2024 14:53:13 +0000 (23:53 +0900)] 
Revert "units: do not soft-reboot before soft-reboot.target reached"

This reverts commit 4263d7617f0e6ea741e227db223ac6085479165f.

Still I think this is the way to go. But the change was merged after -rc2,
and still discussion is continued. So, at least now let's revert it,
and do that after v256-final is released if approved.

18 months agolock-util: do not expect EACCES when it cannot happen
Luca Boccassi [Tue, 21 May 2024 23:17:10 +0000 (00:17 +0100)] 
lock-util: do not expect EACCES when it cannot happen

As per the documentation, EACCES is only returned when F_SETLK is
used, and only on some platforms, which doesn't seem to include
Linux:

https://github.com/torvalds/linux/blob/master/fs/locks.c

F_OFD_SETLK is documented to only return EAGAIN, and F_SETLKW/F_OFD_SETLKW
are blocking operations so this logic doesn't apply to them in the
first place.

Hence, only automatically convert EACCES into EAGAIN for F_SETLK
operations, and propagate the original error in the other cases.

This is important because in some cases we catch permission errors
and gracefully fallback, which is not possible if the original error
is lost.

This is an issue in practice because, due to a kernel bug present
before v6.2, AppArmor denies locking on file descriptors to LXC
containers. We support all currently maintained LTS kernels,
including v6.1, where despite a lot of effort and attempts over almost
a year, the bugfix still hasn't been backported, as it is complex and
requires large changes to AppArmor.
On affected kernels, all services running with PrivateNetwork=yes
fail and do not recover, instead of the normal behaviour of gracefully
downgrading to PrivateNetwork=no.

The integration tests in the Debian CI fail due to this issue:

https://ci.debian.net/packages/s/systemd/testing/arm64/46828037/

18 months agotest: also flush and rotate journal before read
Yu Watanabe [Wed, 22 May 2024 00:20:00 +0000 (09:20 +0900)] 
test: also flush and rotate journal before read

Follow-up for a610ba00d923f148702e68b1661166e887759509.

Fixes #32890.

18 months agotest: replace journal checkers with journalctl --follow + grep -m
Yu Watanabe [Wed, 22 May 2024 03:26:58 +0000 (12:26 +0900)] 
test: replace journal checkers with journalctl --follow + grep -m

Recently, for slow test environments, journalctl --sync was added to the
loop in the timeout. However, journalctl --sync may be slow in such systems,
and timeout easily triggered during syncing.
Hopefully, reading journal with --follow and grep the output with an expected
line should be efficient.

Hopefully fixes #32712.

18 months agoMerge pull request #32963 from yuwata/test-64-btrfs
Yu Watanabe [Tue, 21 May 2024 23:06:46 +0000 (08:06 +0900)] 
Merge pull request #32963 from yuwata/test-64-btrfs

test: lock device during running cryptsetup

18 months agotest: lock device during running cryptsetup 32963/head
Yu Watanabe [Tue, 21 May 2024 20:24:05 +0000 (05:24 +0900)] 
test: lock device during running cryptsetup

On running cryptsetup, udevd detects two inotify events for the
underlying device. Running the test on enough fast host, the expected
symlinks based on UUID and disk label are created by the second event.

During processing a uevent for a device, udevd disables the inotify
watch for the device. If the test runs on slow system, the second
inotify event may comes during a udev worker processing the synthesized
uevent triggered by the first inotify event. Hence, no synthesized
uevent for the second inotify event will be generated, and the expected
symlinks will be never created.

To prevent the issue, we need to lock the device during cryptsetup
command is running.

Fixes #32913.

18 months agoRevert "test: wipe filesystem before moving to the next test case"
Yu Watanabe [Tue, 21 May 2024 20:35:55 +0000 (05:35 +0900)] 
Revert "test: wipe filesystem before moving to the next test case"

This reverts commit 301d7ee6112c6f766ee63d1daed3cd9535a65053.

This does not solve issue #32913.

18 months agobtrfs-util: add assert to fix Coverity warning
Luca Boccassi [Tue, 21 May 2024 12:32:48 +0000 (13:32 +0100)] 
btrfs-util: add assert to fix Coverity warning

Coverity gets confused since the iterator change, so add an
assert to indicate that this is allocated if n_old_groups is > 0

CID#1545922

Follow-up for 125cca1b51e19d9209a229fca4fb9d94d34c3e78

18 months agoMerge pull request #32962 from bluca/suse_mod
Yu Watanabe [Tue, 21 May 2024 19:39:08 +0000 (04:39 +0900)] 
Merge pull request #32962 from bluca/suse_mod

pkg/opensuse: switch to SHA1 fork

18 months agoMerge pull request #32944 from yuwata/test-74
Luca Boccassi [Tue, 21 May 2024 18:44:13 +0000 (20:44 +0200)] 
Merge pull request #32944 from yuwata/test-74

test: several changes for TEST-74-AUX-UTILS

18 months agoMerge pull request #32954 from YHNdnzj/run-forwarder-exit
Luca Boccassi [Tue, 21 May 2024 18:37:17 +0000 (20:37 +0200)] 
Merge pull request #32954 from YHNdnzj/run-forwarder-exit

run: when disconnected from PTY forwarder, exit event loop if not --wait

18 months agomkosi: explicitly install g++ in opensuse 32962/head
Luca Boccassi [Tue, 21 May 2024 18:07:39 +0000 (19:07 +0100)] 
mkosi: explicitly install g++ in opensuse

Not pulled in by default at build time

18 months agopkg/opensuse: switch to SHA1 fork
Luca Boccassi [Tue, 21 May 2024 17:19:04 +0000 (18:19 +0100)] 
pkg/opensuse: switch to SHA1 fork

src.opensuse.org switched to SHA256, which means it can no longer be
used as a submodule in a SHA1 repository. Switch to a fork on Pagure
that gets synced across and is still SHA1:

https://code.opensuse.org/package/systemd.git

18 months agoMerge pull request #32957 from mrc0mmand/fix-coverage-builds
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2024 16:42:08 +0000 (18:42 +0200)] 
Merge pull request #32957 from mrc0mmand/fix-coverage-builds

test: make TEST-65-ANALYZE happy when built with gcov

18 months agotest: wait a bit before stopping/killing service
Yu Watanabe [Tue, 21 May 2024 08:57:59 +0000 (17:57 +0900)] 
test: wait a bit before stopping/killing service

Otherwise, when stopping the service, the last command may not be
started yet, and the service manager may not send SIGTERM signal to the
last command, but send SIGKILL on timeout.

===
May 21 08:23:24 test19-exit-cgroup.sh[437]: + disown
May 21 08:23:24 test19-exit-cgroup.sh[438]: + sleep infinity
May 21 08:23:24 test19-exit-cgroup.sh[437]: + systemd-notify --ready
May 21 08:23:24 test19-exit-cgroup.sh[437]: + sleep infinity
May 21 08:23:24 test19-exit-cgroup.sh[441]: + systemctl stop one
May 21 08:23:24 test19-exit-cgroup.sh[443]: + sleep infinity
(snip)
May 21 08:23:24 systemd[1]: one.service: Changed running -> stop-sigterm
May 21 08:23:24 systemd[1]: Stopping one.service - /tmp/test19-exit-cgroup.sh "systemctl stop one"...
May 21 08:23:24 systemd[1]: Received SIGCHLD from PID 441 (systemctl).
May 21 08:23:24 systemd[1]: Child 437 (bash) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 437 belongs to one.service.
May 21 08:23:24 systemd[1]: one.service: Main process exited, code=killed, status=15/TERM (success)
May 21 08:23:24 systemd[1]: Child 439 (bash) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 439 belongs to one.service.
May 21 08:23:24 systemd[1]: Child 441 (systemctl) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 441 belongs to one.service.
May 21 08:23:24 systemd[1]: Child 442 (bash) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 442 belongs to one.service.
(snip)
May 21 08:24:54 systemd[1]: one.service: State 'stop-sigterm' timed out. Killing.
May 21 08:24:54 systemd[1]: one.service: Killing process 443 (sleep) with signal SIGKILL.
May 21 08:24:54 systemd[1]: one.service: Changed stop-sigterm -> stop-sigkill
May 21 08:24:54 systemd[1]: Received SIGCHLD from PID 443 (sleep).
May 21 08:24:54 systemd[1]: Child 443 (sleep) died (code=killed, status=9/KILL)
May 21 08:24:54 systemd[1]: one.service: Child 443 belongs to one.service.
May 21 08:24:54 systemd[1]: one.service: Control group is empty.
May 21 08:24:54 systemd[1]: one.service: Failed with result 'timeout'.
May 21 08:24:54 systemd[1]: one.service: Service restart not allowed.
May 21 08:24:54 systemd[1]: one.service: Changed stop-sigkill -> failed
May 21 08:24:54 systemd[1]: one.service: Job 738 one.service/stop finished, result=done
May 21 08:24:54 systemd[1]: Stopped one.service - /tmp/test19-exit-cgroup.sh "systemctl stop one".
May 21 08:24:54 systemd[1]: one.service: Unit entered failed state.
May 21 08:24:54 systemd[1]: one.service: Releasing resources...
===

Fixes #32947.

18 months agologind: use SD_BUS_ERROR_ACCESS_DENIED
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2024 11:27:53 +0000 (13:27 +0200)] 
logind: use SD_BUS_ERROR_ACCESS_DENIED

As requested in post-merge review
https://github.com/systemd/systemd/pull/32869#pullrequestreview-2068161094:
> NotInControl error is really about session controllers, but this here really
> is different.

18 months agotest: collect information about loopback device on failure 32944/head
Yu Watanabe [Mon, 20 May 2024 20:35:50 +0000 (05:35 +0900)] 
test: collect information about loopback device on failure

18 months agotest: wait for loop/backing_file attribute being removed
Yu Watanabe [Tue, 21 May 2024 10:10:49 +0000 (19:10 +0900)] 
test: wait for loop/backing_file attribute being removed

Hopefully fixes issue like
https://github.com/systemd/systemd/issues/32680#issuecomment-2120959238
https://github.com/systemd/systemd/issues/32680#issuecomment-2122074805

18 months agotest: wait for unit generated from /proc/self/mountinfo to be unloaded
Yu Watanabe [Mon, 20 May 2024 19:48:42 +0000 (04:48 +0900)] 
test: wait for unit generated from /proc/self/mountinfo to be unloaded

Fixes https://github.com/systemd/systemd/issues/32680#issuecomment-2120974685.
===
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2475]: + mountpoint /tmp/tmp.eaRV7lSbX2/mnt
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2476]: /tmp/tmp.eaRV7lSbX2/mnt is not a mountpoint
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2449]: + systemd-mount /dev/loop0 /tmp/tmp.eaRV7lSbX2/mnt
May 21 02:45:08 systemd-mount[2477]: Failed to start transient mount unit: Unit tmp-tmp.eaRV7lSbX2-mnt.mount was already loaded or has a fragment file.
===

18 months agotest: also run some basic test cases on nspawn
Yu Watanabe [Mon, 20 May 2024 22:20:57 +0000 (07:20 +0900)] 
test: also run some basic test cases on nspawn

18 months agotest: stop container when it is not necessary anymore
Yu Watanabe [Mon, 20 May 2024 17:54:06 +0000 (02:54 +0900)] 
test: stop container when it is not necessary anymore

18 months agoman/systemd-run: beef up info regarding interaction between --pty, --pipe, and -... 32954/head
Mike Yuan [Tue, 21 May 2024 13:39:02 +0000 (21:39 +0800)] 
man/systemd-run: beef up info regarding interaction between --pty, --pipe, and --wait

18 months agorun: when disconnected from PTY forwarder, exit event loop if not --wait
Mike Yuan [Tue, 21 May 2024 12:10:24 +0000 (20:10 +0800)] 
run: when disconnected from PTY forwarder, exit event loop if not --wait

Follow-up for ade0789fabbf01b95bf54d32f8cab1217a753f03

The change in behavior was partly intentional, as I think
if both --wait and --pty are used, manually disconnecting
from PTY forwarder should not result in systemd-run exiting
with "Finished with ..." log. But we should check for
--wait here.

Closes #32953

18 months agoptyfwd: add missing assertions for pty_forward_new
Mike Yuan [Tue, 21 May 2024 12:07:01 +0000 (20:07 +0800)] 
ptyfwd: add missing assertions for pty_forward_new

18 months agopo: Translated using Weblate (Indonesian)
Andika Triwidada [Tue, 21 May 2024 11:35:59 +0000 (13:35 +0200)] 
po: Translated using Weblate (Indonesian)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/id/
Translation: systemd/main

18 months agoshared/mountpoint-util: for old kernels, assume "norecovery" is supported by btrfs
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2024 08:39:39 +0000 (10:39 +0200)] 
shared/mountpoint-util: for old kernels, assume "norecovery" is supported by btrfs

Fixup for e3828d7103a99a15a1e947ba3063294ead590631, as requested in
https://github.com/systemd/systemd/pull/32892#issuecomment-2117903328.

18 months agotest: add a brief comment for the chattr check 32957/head
Frantisek Sumsal [Tue, 21 May 2024 13:08:07 +0000 (15:08 +0200)] 
test: add a brief comment for the chattr check

Addresses: https://github.com/systemd/systemd/pull/32907#discussion_r1605919598