]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoloopback: use ERRNO_IS_PRIVILEGE() where appropriate 24495/head
Lennart Poettering [Mon, 29 Aug 2022 13:11:09 +0000 (15:11 +0200)] 
loopback: use ERRNO_IS_PRIVILEGE() where appropriate

3 years agoloop: make 'Failed to configure loopback device' log message clearer
Lennart Poettering [Mon, 29 Aug 2022 13:10:16 +0000 (15:10 +0200)] 
loop: make 'Failed to configure loopback device' log message clearer

We print the very same log message for loopback block devices and for
loopback network devices. Let's better be clear what kind it is.

3 years agodocs: use Title Case for section titles
Lennart Poettering [Fri, 26 Aug 2022 13:59:07 +0000 (15:59 +0200)] 
docs: use Title Case for section titles

as per:

https://titlecase.com/

3 years agoscsi_id: retry inquiry ioctl if host_byte is DID_TRANSPORT_DISRUPTED
Wenchao Hao [Sun, 28 Aug 2022 08:44:56 +0000 (16:44 +0800)] 
scsi_id: retry inquiry ioctl if host_byte is DID_TRANSPORT_DISRUPTED

The inquiry is issued to kernel via ioctl, kernelspace would set
this inquiry command's retry count to 0 which means the command
would not be retried in kernel space even if the LLDs returned
a status which need to be retried. So we should take the retry
in user space.

3 years agocondition: fix device-tree firmware path
Daniel Braunwarth [Sun, 28 Aug 2022 18:02:50 +0000 (20:02 +0200)] 
condition: fix device-tree firmware path

The path /sys/firmware/device-tree doesn't exist. This should be either
/proc/device-tree or /sys/firmware/devicetree.

The first path is only a link. So lets use the second path.

See https://github.com/torvalds/linux/blob/v4.14/drivers/of/base.c#L218.

3 years agoman: Minor punctuation and word tweak
adrian5 [Mon, 29 Aug 2022 02:24:56 +0000 (04:24 +0200)] 
man: Minor punctuation and word tweak

3 years agoudev-util: minor cleanups for on_ac_power()
Yu Watanabe [Sat, 27 Aug 2022 06:44:17 +0000 (15:44 +0900)] 
udev-util: minor cleanups for on_ac_power()

Follow-ups for #24420.

3 years agoMerge pull request #24475 from yuwata/devpath
Luca Boccassi [Sun, 28 Aug 2022 20:09:10 +0000 (21:09 +0100)] 
Merge pull request #24475 from yuwata/devpath

sd-device: introduce two helper functions for devnum

3 years agonetwork: drop unused timestamp
Yu Watanabe [Sun, 28 Aug 2022 03:54:52 +0000 (12:54 +0900)] 
network: drop unused timestamp

3 years agotest-64: run one more subtest on non-KVM environment with relaxed condition
Yu Watanabe [Sun, 28 Aug 2022 02:58:52 +0000 (11:58 +0900)] 
test-64: run one more subtest on non-KVM environment with relaxed condition

3 years agodocs: fix incorrect env var name for credentials directory
Uriel Corfa [Sun, 28 Aug 2022 07:56:46 +0000 (09:56 +0200)] 
docs: fix incorrect env var name for credentials directory

CREDENTIAL_PATH appears nowhere in the systemd source code.
$CREDENTIALS_DIRECTORY is what is used instead.

3 years agoshell-completion: drop unused $mode
Yu Watanabe [Sat, 27 Aug 2022 21:10:44 +0000 (06:10 +0900)] 
shell-completion: drop unused $mode

Fixes #24473.

3 years agoudevadm: replace find_device_from_path() with sd_device_new_from_path()
Yu Watanabe [Sat, 27 Aug 2022 20:52:12 +0000 (05:52 +0900)] 
udevadm: replace find_device_from_path() with sd_device_new_from_path()

3 years agotest-network: add missing online check
Yu Watanabe [Sat, 27 Aug 2022 22:47:55 +0000 (07:47 +0900)] 
test-network: add missing online check

3 years agoudev: do not kill workers when requested to set the same log level currently assigned
Yu Watanabe [Sun, 28 Aug 2022 02:14:51 +0000 (11:14 +0900)] 
udev: do not kill workers when requested to set the same log level currently assigned

Also refuse invalid log level.

3 years agoudev/net: drop unused timestamp
Yu Watanabe [Sun, 28 Aug 2022 03:57:09 +0000 (12:57 +0900)] 
udev/net: drop unused timestamp

3 years agotest-64: relax number of partitions used in testcase_simultaneous_events() to speed...
Yu Watanabe [Sun, 28 Aug 2022 02:59:44 +0000 (11:59 +0900)] 
test-64: relax number of partitions used in testcase_simultaneous_events() to speed up non-KVM environment

3 years agotree-wide: use devpath_from_devnum() and device_open_from_devnum() 24475/head
Yu Watanabe [Sat, 27 Aug 2022 20:56:25 +0000 (05:56 +0900)] 
tree-wide: use devpath_from_devnum() and device_open_from_devnum()

Fixes #24465.

3 years agosd-device: skip to check diskseq if device is not initialized
Yu Watanabe [Sat, 27 Aug 2022 21:43:30 +0000 (06:43 +0900)] 
sd-device: skip to check diskseq if device is not initialized

3 years agosd-device: introduce device_open_from_devnum()
Yu Watanabe [Sat, 27 Aug 2022 19:30:23 +0000 (04:30 +0900)] 
sd-device: introduce device_open_from_devnum()

3 years agosd-device: introduce devpath_from_devnum()
Yu Watanabe [Sat, 27 Aug 2022 17:45:56 +0000 (02:45 +0900)] 
sd-device: introduce devpath_from_devnum()

3 years agodevnum-util: split-out device_path_make_inaccessible()
Yu Watanabe [Sat, 27 Aug 2022 19:15:35 +0000 (04:15 +0900)] 
devnum-util: split-out device_path_make_inaccessible()

3 years agosd-device: rename device-util.c -> device-filter.c
Yu Watanabe [Sat, 27 Aug 2022 18:22:02 +0000 (03:22 +0900)] 
sd-device: rename device-util.c -> device-filter.c

The functions provided by the file are only used in sd-device.

3 years agogrowfs,repart: fix misuse of sd_device_get_devpath()
Yu Watanabe [Sat, 27 Aug 2022 17:59:30 +0000 (02:59 +0900)] 
growfs,repart: fix misuse of sd_device_get_devpath()

Follow-up for 0f79b3469f167583033d17f9a6fa0e4341a68003.

To obtain device node, sd_device_get_devname() must be used.

3 years agotest-64: extend timeout for slower env e.g. non-kvm
Yu Watanabe [Sat, 27 Aug 2022 16:43:23 +0000 (01:43 +0900)] 
test-64: extend timeout for slower env e.g. non-kvm

3 years agotree-wide: fix typo
Yu Watanabe [Sat, 27 Aug 2022 15:03:36 +0000 (00:03 +0900)] 
tree-wide: fix typo

3 years agohwdb: Add Dell Professional Sound Bar AE515
Swapnil Devesh [Sat, 27 Aug 2022 09:44:08 +0000 (15:14 +0530)] 
hwdb: Add Dell Professional Sound Bar AE515

3 years agoloop-util: use filter provided by sd_device_enumerator
Yu Watanabe [Sat, 27 Aug 2022 06:24:49 +0000 (15:24 +0900)] 
loop-util: use filter provided by sd_device_enumerator

3 years agoMerge pull request #24468 from yuwata/test-udev-debug
Yu Watanabe [Sat, 27 Aug 2022 09:18:30 +0000 (18:18 +0900)] 
Merge pull request #24468 from yuwata/test-udev-debug

test: enable udev debug log

3 years agotest-50-dissect: generate debugging logs of udevd 24468/head
Yu Watanabe [Fri, 26 Aug 2022 15:52:04 +0000 (00:52 +0900)] 
test-50-dissect: generate debugging logs of udevd

3 years agotest-58-repart: use udevadm control instead of creating service drop-in
Yu Watanabe [Fri, 26 Aug 2022 15:51:28 +0000 (00:51 +0900)] 
test-58-repart: use udevadm control instead of creating service drop-in

3 years agoMerge pull request #23764 from enr0n/oomd-allow-managed-oom-preference
Yu Watanabe [Sat, 27 Aug 2022 05:05:10 +0000 (14:05 +0900)] 
Merge pull request #23764 from enr0n/oomd-allow-managed-oom-preference

oomd: allow ManagedOOMPreference on all cgroups

3 years agoMerge pull request #24463 from mrc0mmand/ubuntu-ci-tweaks
Frantisek Sumsal [Fri, 26 Aug 2022 21:31:50 +0000 (21:31 +0000)] 
Merge pull request #24463 from mrc0mmand/ubuntu-ci-tweaks

(Not only) Ubuntu CI tweaks

3 years agosystemd-growfs: use sd_device_new_from_devnum()
Devendra Tewari [Fri, 26 Aug 2022 11:32:48 +0000 (08:32 -0300)] 
systemd-growfs: use sd_device_new_from_devnum()

Use sd_device_new_from_devnum() instead of
device_path_make_major_minor_sysfs().

3 years agotest: make the virt detection quiet 24463/head
Frantisek Sumsal [Fri, 26 Aug 2022 17:18:20 +0000 (19:18 +0200)] 
test: make the virt detection quiet

Follow-up to cde09b07dfdc132a31672693c037bfc0b5879331.

3 years agotest: set the default QEMU and nspawn timeouts to 30 minutes
Frantisek Sumsal [Fri, 26 Aug 2022 14:19:42 +0000 (16:19 +0200)] 
test: set the default QEMU and nspawn timeouts to 30 minutes

Set both timeouts to some reasonable values instead of just `infinity`
to provide some form of a safe-net in case the test goes haywire and the
environment didn't set the timeouts itself (like our CIs do).

3 years agotest: respect the global $QEMU_TIMEOUT
Frantisek Sumsal [Fri, 26 Aug 2022 14:17:11 +0000 (16:17 +0200)] 
test: respect the global $QEMU_TIMEOUT

CIs set QEMU and nspawn timeouts by themselves which reflect their needs
and possibilities, so let's respect that value, instead of using one
pre-set value which might or might not work for all of them.

Both Ubuntu CI and CentOS CI set these values themselves.

3 years agotest: use a unique machine name for each nspawn test
Frantisek Sumsal [Fri, 26 Aug 2022 13:59:37 +0000 (15:59 +0200)] 
test: use a unique machine name for each nspawn test

to avoid scope clashing in case some previous test crashed and/or didn't
clean up properly. Currently all test machines are called `root`, since
the name is automagically derived from the container path (in this case
`/var/tmp/systemd-test.XXXXXX/root`).

E.g. (from Ubuntu CI):
```
[23:10:12] --x-- Running TEST-71-HOSTNAME --x--
make: Entering directory '/tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/TEST-71-HOSTNAME'
+ make -C TEST-71-HOSTNAME setup run
TEST-71-HOSTNAME SETUP: test hostnamed
Reusing existing cached image /tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/TEST-71-HOSTNAME/../default.img → /tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/default.img
'/var/tmp/systemd-test.1yy2SS/default.img' -> '/tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/default.img'
I: Masking supporting services
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-hwdb-update.service' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-journal-catalog-update.service' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-networkd.service' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-networkd.socket' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-resolved.service' -> '/dev/null'
TEST-71-HOSTNAME RUN: test hostnamed
+ env --unset=UNIFIED_CGROUP_HIERARCHY --unset=SYSTEMD_NSPAWN_UNIFIED_HIERARCHY timeout --foreground 1200 /bin/systemd-nspawn --register=no --kill-signal=SIGKILL --directory=/var/tmp/systemd-test.1yy2SS/root --setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-71.units:/usr/lib/systemd/tests/testdata/units: /lib/systemd/systemd systemd.unit=testsuite.target systemd.wants=testsuite-71.service systemd.wants=end.service
Spawning container root on /var/tmp/systemd-test.1yy2SS/root.
Press ^] three times within 1s to kill container.
Failed to allocate scope: Unit root.scope already exists.
E: nspawn failed with exit code 1
```

3 years agotest: bump the reboot timeout to 60 seconds
Frantisek Sumsal [Fri, 26 Aug 2022 13:53:46 +0000 (15:53 +0200)] 
test: bump the reboot timeout to 60 seconds

As the reboot might take a bit on oversaturated hypervisors (spotted in
Ubuntu CI).

3 years agoMerge pull request #24440 from mrc0mmand/TEST-64-tweaks
Frantisek Sumsal [Fri, 26 Aug 2022 17:16:24 +0000 (17:16 +0000)] 
Merge pull request #24440 from mrc0mmand/TEST-64-tweaks

A couple of TEST-64 tweaks to make it usable without KVM

3 years agoMerge pull request #24456 from yuwata/network-tcp-congctl
Luca Boccassi [Fri, 26 Aug 2022 17:04:51 +0000 (18:04 +0100)] 
Merge pull request #24456 from yuwata/network-tcp-congctl

network: introduce TCPCongestionControlAlgorithm=

3 years agooomd: fix off-by-one when dumping kill candidates 23764/head
Nick Rosbrook [Wed, 20 Jul 2022 15:16:37 +0000 (11:16 -0400)] 
oomd: fix off-by-one when dumping kill candidates

When we kill a cgroup that is towards the end of the sorted candidate
list (i.e. when we have to resort to killing a candidate with
ManagedOOMPreference=avoid), this cgroup is not logged in the candidate
list. This is due to an off-by-one error when assigning dump_until.

3 years agoman: update ManagedOOMPreference entry to reflect new behavior
Nick Rosbrook [Thu, 7 Jul 2022 21:17:53 +0000 (17:17 -0400)] 
man: update ManagedOOMPreference entry to reflect new behavior

3 years agooomd: add tests for oomd_fetch_cgroup_oom_preference
Nick Rosbrook [Tue, 19 Jul 2022 16:48:04 +0000 (12:48 -0400)] 
oomd: add tests for oomd_fetch_cgroup_oom_preference

Add a new test function, test_oomd_fetch_cgroup_oom_preference, to test
the ManagedOOMPreference logic. For starters, cut the relevant tests out
of test_oomd_cgroup_context_acquire_and_insert, and add them to the new
function. Then, expand these tests to cover the new behavior.

3 years agooomd: loosen the restriction on ManagedOOMPreference
Nick Rosbrook [Tue, 19 Jul 2022 15:49:06 +0000 (11:49 -0400)] 
oomd: loosen the restriction on ManagedOOMPreference

The ManagedOOMPreference property is only honored on cgroups which are
owned by root. This precludes anyone from setting ManagedOOMPreference
on cgroups managed by user managers.

Loosen this restriction in the following way: when processing a
monitored cgroup for kill candidates, honor the ManagedOOMPreference
setting if the monitored cgroup and cgroup candidate are owned by the
same user. This allows unprivileged users to configure
ManagedOOMPreference on their cgroups without affecting the kill
priority of ancestor cgroups.

N.B. that since swap kill operates globally to kill the largest
candidate, it is not appropriate to apply this logic to the swap kill
scenario. Therefore, the existing restriction on ManagedOOMPreference
will remain when calculating candidates for swap kill.

Add a new function, oomd_fetch_cgroup_oom_preference, to assist with
this new logic. To simplify things, move the `user.oomd_{avoid,omit}`
xattr reads to this function so that the xattr reads and uid checks are
performed all at once.

3 years agocore/cgroup: allow setting oomd xattrs from user manager
Nick Rosbrook [Tue, 14 Jun 2022 19:25:50 +0000 (15:25 -0400)] 
core/cgroup: allow setting oomd xattrs from user manager

The extended attributes 'user.oomd_avoid' and 'user.oomd_omit' are used
to store the setting of the ManagedOOMPrefernce property. Since these
are user extended attributes, the access permissions are defined by the
file permissions, and there is no need to guard this from user managers.

3 years agosleep: doc update for multiple battery, acpi_btp support and freeze/thaw user.slice
Sonali Srivastava [Fri, 26 Aug 2022 13:53:42 +0000 (19:23 +0530)] 
sleep: doc update for multiple battery, acpi_btp support and freeze/thaw user.slice

3 years agotest: temporarily (?) disable TEST-64 in Ubuntu CI 24440/head
Frantisek Sumsal [Fri, 26 Aug 2022 13:39:32 +0000 (15:39 +0200)] 
test: temporarily (?) disable TEST-64 in Ubuntu CI

The machines are still way too slow for the test to work properly
without accel.

3 years agotest: bump the base VM memory to 768M
Frantisek Sumsal [Thu, 25 Aug 2022 12:52:30 +0000 (14:52 +0200)] 
test: bump the base VM memory to 768M

as with 512M some tests occasionally trip off OOM-killer (e.g.
TEST-64 + multipath).

3 years agotest: lower the # of iterations with plain QEMU
Frantisek Sumsal [Thu, 25 Aug 2022 12:25:07 +0000 (14:25 +0200)] 
test: lower the # of iterations with plain QEMU

3 years agotest: require KVM only for specific sub-tests
Frantisek Sumsal [Thu, 25 Aug 2022 12:23:49 +0000 (14:23 +0200)] 
test: require KVM only for specific sub-tests

since other sub-tests run relatively fine with TCG as well.

3 years agotest: check for other hypervisors as well
Frantisek Sumsal [Thu, 25 Aug 2022 11:51:15 +0000 (13:51 +0200)] 
test: check for other hypervisors as well

EC2 machines run on Xen, so account for that as well when checking KVM
availability.

3 years agotest: lower the # of mpath devices to 16
Frantisek Sumsal [Thu, 25 Aug 2022 10:57:42 +0000 (12:57 +0200)] 
test: lower the # of mpath devices to 16

to make the test suitable for slower machines.

3 years agoMerge pull request #24459 from poettering/tmpfiles-graceful-copy
Lennart Poettering [Fri, 26 Aug 2022 13:25:35 +0000 (15:25 +0200)] 
Merge pull request #24459 from poettering/tmpfiles-graceful-copy

tmpfiles: make absent source of "C" copy lines graceful

3 years agoMerge pull request #24460 from poettering/stub-measure-fix
Lennart Poettering [Fri, 26 Aug 2022 13:24:55 +0000 (15:24 +0200)] 
Merge pull request #24460 from poettering/stub-measure-fix

sd-stub: some minor refactoring of the cpio/TPM code

3 years agocpio: don't claim we measured anything if we weren't even asked 24460/head
Lennart Poettering [Thu, 25 Aug 2022 16:08:49 +0000 (18:08 +0200)] 
cpio: don't claim we measured anything if we weren't even asked

This is a bugfix.

Follow-up for 599fe002a135570406504998dbb7a42dabc963da

3 years agocpio: split out cpio TPM measurement logic from pack_cpio()
Lennart Poettering [Thu, 25 Aug 2022 14:53:43 +0000 (16:53 +0200)] 
cpio: split out cpio TPM measurement logic from pack_cpio()

No code change, just some refactoring, so that we can reuse the
measurement logic later elsewhere.

3 years agotest-network: add test for TCPCongestionControlAlgorithm= 24456/head
Yu Watanabe [Fri, 26 Aug 2022 06:01:30 +0000 (15:01 +0900)] 
test-network: add test for TCPCongestionControlAlgorithm=

3 years agonetwork: introduce TCPCongestionControlAlgorithm=
Yu Watanabe [Fri, 26 Aug 2022 05:43:07 +0000 (14:43 +0900)] 
network: introduce TCPCongestionControlAlgorithm=

Closes #24432.

3 years agoMerge pull request #24457 from poettering/smbios-condition-fix
Lennart Poettering [Fri, 26 Aug 2022 10:22:29 +0000 (12:22 +0200)] 
Merge pull request #24457 from poettering/smbios-condition-fix

SMBIOS condition fix

3 years agotmpfiles: move validation/normalization of path before we use it 24459/head
Lennart Poettering [Fri, 26 Aug 2022 08:12:29 +0000 (10:12 +0200)] 
tmpfiles: move validation/normalization of path before we use it

We need to normalize/validate the path (i.e. first column) of
tmpfiles.d/ lines before we start using the path, otherwise we'll use it
before it's known to be good. This matters since for some line types the
path is mangled into the argument column (i.e. sevents column), and we
should only do that once we know it's in a good state.

3 years agotmpfiles: in C lines, make missing source graceful error
Lennart Poettering [Thu, 25 Aug 2022 15:16:02 +0000 (17:16 +0200)] 
tmpfiles: in C lines, make missing source graceful error

I don't see where it would ever be a good thing that file copies done
via tmpfiles.d/ C lines cause the tmpfiles operation to fail if their
source happens to be missing. It's a problem if we can't set up the
destination properly (which is the job of systemd-tmpfiles after all),
but if the source is simply missing (NB: setting up the source is the job of
of the rules writer) this shouldn't be a problem.

This is useful for copying stuff into place if it happens to exist. For
example, if systemd-stub passes additional data into the initrd's
/.extra/ directory, we can copy it into a better place (e.g. /run/) with
this, where it will survive the initrd→host transition.

This mirrors behaviour of the recently added "^" line modifier which may
be used source "w" lines from credentials – there two the behaviour is
to simply skip the line if the source is missing.

3 years agotest: don't accept failure as succes 24457/head
Lennart Poettering [Fri, 26 Aug 2022 08:37:59 +0000 (10:37 +0200)] 
test: don't accept failure as succes

3 years agocondition: check for last not first ')' in firmware test expressions
Lennart Poettering [Fri, 26 Aug 2022 08:36:45 +0000 (10:36 +0200)] 
condition: check for last not first ')' in firmware test expressions

I possess a machine with ')' in its BIOS version string, which will
cause the current parser to mistake it as the closing ')' of the
smbios-fields() expression.

Let's make sure we always fo for the last, not the first ')', hence.

3 years agotest: wait for loop device to be removed
Yu Watanabe [Thu, 25 Aug 2022 21:33:49 +0000 (06:33 +0900)] 
test: wait for loop device to be removed

Follow-up for bca762ce1abafd24016eba7310fdd38c758419f8.

Fixes #24450.

3 years agotest-sd-device: run subsystem filter test several times
Yu Watanabe [Thu, 25 Aug 2022 20:23:55 +0000 (05:23 +0900)] 
test-sd-device: run subsystem filter test several times

The test is quite racy. Let's wait for all queued udev events to be
processed, and run the test several times.

Fixes #24400.

3 years agosd-netlink: fix attribute type for RTAX_CC_ALGO
Yu Watanabe [Fri, 26 Aug 2022 05:33:54 +0000 (14:33 +0900)] 
sd-netlink: fix attribute type for RTAX_CC_ALGO

3 years agoresolve: control system hostname synthesis via environment variable
Jacek Migacz [Mon, 22 Aug 2022 16:24:29 +0000 (18:24 +0200)] 
resolve: control system hostname synthesis via environment variable

3 years agosleep: freeze and thaw user.slice to save resource while suspend
Sonali Srivastava [Wed, 17 Aug 2022 07:24:20 +0000 (12:54 +0530)] 
sleep: freeze and thaw user.slice to save resource while suspend

3 years agotree-wide: change --kill-who to --kill-whom
Zbigniew Jędrzejewski-Szmek [Wed, 24 Aug 2022 08:41:30 +0000 (10:41 +0200)] 
tree-wide: change --kill-who to --kill-whom

getopt allows non-ambiguous abbreviations, so backwards-compat is maintained, and
people can use --kill-who (or even shorter abbreviations). English is flexible,
so in common speach people would use both forms, even if "whom" is technically
more correct. The advantage of using the longer form in the code is that we
effectively allow both forms, so we stop punishing people who DTGCT¹, but still
allow people to use the spoken form if they prefer.

1. Do the gramatically correct thing

3 years agoMerge pull request #24454 from bluca/ci
Yu Watanabe [Fri, 26 Aug 2022 02:13:53 +0000 (11:13 +0900)] 
Merge pull request #24454 from bluca/ci

Fix Ubuntu/SUSE mkosi

3 years agomkosi: add back packages removed from OpenSUSE build 24454/head
Luca Boccassi [Thu, 25 Aug 2022 22:59:04 +0000 (23:59 +0100)] 
mkosi: add back packages removed from OpenSUSE build

Some packages were removed from the OpenSUSE build, which broke the
unit tests. Add them back.

Fixes: 37d35150cbb5 ("mkosi: Ensure we build all features/components in mkosi")
3 years agomkosi: disable isc-dhcp-server again
Luca Boccassi [Thu, 25 Aug 2022 22:02:29 +0000 (23:02 +0100)] 
mkosi: disable isc-dhcp-server again

It's still failing in Ubuntu:

● isc-dhcp-server.service  loaded failed failed ISC DHCP IPv4 server
● isc-dhcp-server6.service loaded failed failed ISC DHCP IPv6 server

Just disable them via the kernel command line masking.

3 years agojournal: rename special journal field _SYSTEM_CONTEXT= → _RUNTIME_SCOPE=
Lennart Poettering [Thu, 25 Aug 2022 15:32:28 +0000 (17:32 +0200)] 
journal: rename special journal field _SYSTEM_CONTEXT= → _RUNTIME_SCOPE=

Previously the field "_SYSTEM_CONTEXT" knew he values "initrd" + "main". Let's change
this to "_RUNTIME_SCOPE" and "initrd" + "system".

Why? The sysext logic has a very similar concept of "scopes", declaring
whether a sysext image is intended for the initrd or the main system.
Let's thus use the same naming for both.

sysext's extension-release files hence know SYSEXT_SCOPE=initrd|system,
and the journal messages know _RUNTIME_SCOPE=initrd|system, which makes
this reasonably systematic.

Follow-up for: cae8edd93ca2ef90c41cb9b6322b6908d12947b5

(This is not an API break, since no version with this commit has ever
been released.)

3 years agopid1: extend "ConditionFirmware=" for checking SMBIOS system identification information
Daniel Braunwarth [Sat, 30 Jul 2022 13:20:15 +0000 (15:20 +0200)] 
pid1: extend "ConditionFirmware=" for checking SMBIOS system identification information

3 years agomkosi: Print logs of failing tests
Jan Janssen [Thu, 25 Aug 2022 10:13:35 +0000 (12:13 +0200)] 
mkosi: Print logs of failing tests

3 years agocore/mount: voidify unit_acquire_invocation_id()
Yu Watanabe [Thu, 25 Aug 2022 16:16:00 +0000 (01:16 +0900)] 
core/mount: voidify unit_acquire_invocation_id()

Follow-up for 01400460ae16c6522d11d08dd9a4b0928e7980d9.

Fixes CID#1491960.

3 years agoMerge pull request #24442 from yuwata/udev-retry-event
Frantisek Sumsal [Thu, 25 Aug 2022 19:57:19 +0000 (19:57 +0000)] 
Merge pull request #24442 from yuwata/udev-retry-event

udev: make requeued event actually restarted

3 years agovirt: fix alignment
Yu Watanabe [Thu, 25 Aug 2022 16:12:49 +0000 (01:12 +0900)] 
virt: fix alignment

Follow-up for f5558306746c0791dab666e76d51e7ef1ce38362.

3 years agotest: make TEST-63 more reliable on slower machines
Frantisek Sumsal [Thu, 25 Aug 2022 10:05:53 +0000 (12:05 +0200)] 
test: make TEST-63 more reliable on slower machines

Otherwise we might never hit the trigger limit and wait indefinitely.

Found when trying to run the test on an EC2 xen machine without a nested
virt in CentOS CI (in preparations for some ... unforseseen consequences).

3 years agoudev: drop unnecessary calls of event_queue_start() 24442/head
Yu Watanabe [Thu, 25 Aug 2022 15:34:15 +0000 (00:34 +0900)] 
udev: drop unnecessary calls of event_queue_start()

As the subsequent call of on_post() will call it if necessary.

This also drop unnecessary call of event_source_disable() for killing
idle workers, as the event source is disabled in event_queue_start().

3 years agoudev: certainly restart event for previously locked device
Yu Watanabe [Thu, 25 Aug 2022 15:16:17 +0000 (00:16 +0900)] 
udev: certainly restart event for previously locked device

If udevd receives a uevent for a locked block device, then the event
is requeued. However, the queued event will be processed only when at
least one sd_event_source is processed. Hence, if udevd has no event
under processing, or receives no new uevent, etc., then the requeued
event will be never processed.

Follow-up for 400e3d21f8cae53a8ba9f9567f244fbf6f3e076c.

Fixes #24439.

3 years agomkosi: use the just built systemd-sysusers instead of groupadd
Luca Boccassi [Thu, 25 Aug 2022 11:30:58 +0000 (12:30 +0100)] 
mkosi: use the just built systemd-sysusers instead of groupadd

It disappeared again from SUSE Tumbleweed. Just use sysusers since we
just built it.

3 years agoMerge pull request #24408 from keszybz/execstart-escape
Lennart Poettering [Thu, 25 Aug 2022 09:40:57 +0000 (11:40 +0200)] 
Merge pull request #24408 from keszybz/execstart-escape

Properly escape ExecStart= commandlines in transient units

3 years agoMerge pull request #24242 from msekletar/terminate-idle-sessions
Lennart Poettering [Thu, 25 Aug 2022 09:39:42 +0000 (11:39 +0200)] 
Merge pull request #24242 from msekletar/terminate-idle-sessions

Add option to stop idle sessions after specified timeout

3 years agoshutdown: Fix last try detection
Jan Janssen [Wed, 24 Aug 2022 05:53:23 +0000 (07:53 +0200)] 
shutdown: Fix last try detection

This was missed in 5125b67742567de79c12e31f434a11d787b4f6b1.

3 years agoMerge pull request #24429 from poettering/selinux-code-improv
Lennart Poettering [Thu, 25 Aug 2022 09:35:14 +0000 (11:35 +0200)] 
Merge pull request #24429 from poettering/selinux-code-improv

minor selinux-util.c modernization

3 years agosystemd-growfs: remove dependency on udev symlinks
Devendra Tewari [Wed, 24 Aug 2022 10:13:04 +0000 (07:13 -0300)] 
systemd-growfs: remove dependency on udev symlinks

systemd-growfs currently requires that udev ran first to work (because
/dev/block/ symlinks must exist) but that is not what happens when
we're not using initrd and systemd is PID1.

3 years agotime-util: fix overflow condition in usec_sub_signed()
Lennart Poettering [Wed, 24 Aug 2022 08:41:23 +0000 (10:41 +0200)] 
time-util: fix overflow condition in usec_sub_signed()

If the delta specified is INT64_MIN, and we negate that we'd end up at
INT64_MAX+1 which is outside of the int64_t type. Hence let's treat this
case specifically to avoid unintended overflows.

3 years agocore: allow disabling system time correction if rtc returns time far in the future
Franck Bui [Tue, 23 Aug 2022 15:07:23 +0000 (17:07 +0200)] 
core: allow disabling system time correction if rtc returns time far in the future

There might be (embedded) systems that get never updated (things like
e.g. entertainment systems of trains, for example) and where the adjustment of
the system clock (introduced by b10abe4bba61aebe4c667c412741193f11886298) would
do the wrong thing even if the difference between the systemd build time and
the rtc is 15 years or more.

This patch allows disabling the adjustment by setting
'clock-valid-range-usec-max' meson option to 0 or to a negative value.

3 years agojournald: use rate-limited logging to log 'Failed to write entry' message
Richard Phibel [Wed, 17 Aug 2022 20:24:52 +0000 (22:24 +0200)] 
journald: use rate-limited logging to log 'Failed to write entry' message

3 years agoMerge pull request #24370 from keszybz/sysusers-equivs
Luca Boccassi [Wed, 24 Aug 2022 20:35:28 +0000 (21:35 +0100)] 
Merge pull request #24370 from keszybz/sysusers-equivs

Use /bin/bash for root shell and suppress some warnings from sysusers

3 years agoselinux-util: add safety size check before doing strdupa() 24429/head
Lennart Poettering [Wed, 24 Aug 2022 14:57:20 +0000 (16:57 +0200)] 
selinux-util: add safety size check before doing strdupa()

3 years agoselinux-util: modernizations
Lennart Poettering [Wed, 24 Aug 2022 14:55:50 +0000 (16:55 +0200)] 
selinux-util: modernizations

Let's no bother with reading return value of libselinux API calls into
r, if the actual error is in errno anyway.

Let's remove one unnecessary strdup()

Let's rename a return parameter ret_xyz

3 years agoMerge pull request #24072 from poettering/remove-cgroupsv1-docs
Lennart Poettering [Wed, 24 Aug 2022 15:00:53 +0000 (17:00 +0200)] 
Merge pull request #24072 from poettering/remove-cgroupsv1-docs

decgroupsv1ification: first steps – remove from docs, and generate warnings

3 years agotests: add test for StopIdleSessionSec= option 24242/head
Michal Sekletar [Mon, 8 Aug 2022 09:39:52 +0000 (11:39 +0200)] 
tests: add test for StopIdleSessionSec= option

3 years agologind: add option to stop idle sessions after specified timeout
Michal Sekletar [Mon, 8 Aug 2022 07:13:50 +0000 (09:13 +0200)] 
logind: add option to stop idle sessions after specified timeout

Thanks to Jan Pazdziora <jpazdziora@redhat.com> for providing a patch
which implemeted a PoC of this feature.

3 years agoMerge pull request #24420 from keszybz/mouse-power
Lennart Poettering [Wed, 24 Aug 2022 08:16:14 +0000 (10:16 +0200)] 
Merge pull request #24420 from keszybz/mouse-power

Rework on_ac_power()

3 years agobasic/user-util: rename output param to ret, shorten code 24370/head
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2022 15:03:36 +0000 (17:03 +0200)] 
basic/user-util: rename output param to ret, shorten code

3 years agobasic/user-util: avoid filesystem access check
Zbigniew Jędrzejewski-Szmek [Fri, 19 Aug 2022 14:45:08 +0000 (16:45 +0200)] 
basic/user-util: avoid filesystem access check

The check of u==UID_NOBODY is just a register comparison, but
synthesize_nobody() requires a system call, so let's invert the order in the
condition. Since most calls into this module are not for nobody, we should
save one syscall in the common case.