1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

59447 Commits

Author SHA1 Message Date
Yu Watanabe
6dd3b818bb tree-wide: fix typo 2022-08-28 00:03:36 +09:00
Swapnil Devesh
e4c346f789 hwdb: Add Dell Professional Sound Bar AE515 2022-08-27 23:40:16 +09:00
Yu Watanabe
5c467ef4fb loop-util: use filter provided by sd_device_enumerator 2022-08-27 11:32:11 +00:00
Yu Watanabe
989e350218
Merge pull request #24468 from yuwata/test-udev-debug
test: enable udev debug log
2022-08-27 18:18:30 +09:00
Yu Watanabe
20d4b3ccd1 test-50-dissect: generate debugging logs of udevd 2022-08-27 15:14:19 +09:00
Yu Watanabe
e867b0163b test-58-repart: use udevadm control instead of creating service drop-in 2022-08-27 15:14:19 +09:00
Yu Watanabe
a3dd119b35
Merge pull request #23764 from enr0n/oomd-allow-managed-oom-preference
oomd: allow ManagedOOMPreference on all cgroups
2022-08-27 14:05:10 +09:00
Frantisek Sumsal
91685cf9f1
Merge pull request #24463 from mrc0mmand/ubuntu-ci-tweaks
(Not only) Ubuntu CI tweaks
2022-08-26 21:31:50 +00:00
Devendra Tewari
0f79b3469f systemd-growfs: use sd_device_new_from_devnum()
Use sd_device_new_from_devnum() instead of
device_path_make_major_minor_sysfs().
2022-08-26 20:33:03 +01:00
Frantisek Sumsal
12ee072db5 test: make the virt detection quiet
Follow-up to cde09b07df.
2022-08-26 19:18:20 +02:00
Frantisek Sumsal
cd15f7f6d1 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).
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
3c833171bd 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.
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
10d7ed12c9 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
```
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
6ef1262d63 test: bump the reboot timeout to 60 seconds
As the reboot might take a bit on oversaturated hypervisors (spotted in
Ubuntu CI).
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
528ba54bbe
Merge pull request #24440 from mrc0mmand/TEST-64-tweaks
A couple of TEST-64 tweaks to make it usable without KVM
2022-08-26 17:16:24 +00:00
Luca Boccassi
34f166d601
Merge pull request #24456 from yuwata/network-tcp-congctl
network: introduce TCPCongestionControlAlgorithm=
2022-08-26 18:04:51 +01:00
Nick Rosbrook
b814de3054 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.
2022-08-26 12:40:58 -04:00
Nick Rosbrook
58b2f0d1f5 man: update ManagedOOMPreference entry to reflect new behavior 2022-08-26 12:40:58 -04:00
Nick Rosbrook
39f9eee882 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.
2022-08-26 12:40:58 -04:00
Nick Rosbrook
652a4efb66 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.
2022-08-26 12:40:58 -04:00
Nick Rosbrook
b1cd8ed420 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.
2022-08-26 12:40:58 -04:00
Sonali Srivastava
31a07872fa sleep: doc update for multiple battery, acpi_btp support and freeze/thaw user.slice 2022-08-26 17:38:36 +01:00
Frantisek Sumsal
9def084861 test: temporarily (?) disable TEST-64 in Ubuntu CI
The machines are still way too slow for the test to work properly
without accel.
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
6a9c497768 test: bump the base VM memory to 768M
as with 512M some tests occasionally trip off OOM-killer (e.g.
TEST-64 + multipath).
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
b307c22757 test: lower the # of iterations with plain QEMU 2022-08-26 15:40:34 +02:00
Frantisek Sumsal
092499b9f6 test: require KVM only for specific sub-tests
since other sub-tests run relatively fine with TCG as well.
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
cde09b07df test: check for other hypervisors as well
EC2 machines run on Xen, so account for that as well when checking KVM
availability.
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
1678bd2f81 test: lower the # of mpath devices to 16
to make the test suitable for slower machines.
2022-08-26 15:40:34 +02:00
Lennart Poettering
bf2cc3865a
Merge pull request #24459 from poettering/tmpfiles-graceful-copy
tmpfiles: make absent source of "C" copy lines graceful
2022-08-26 15:25:35 +02:00
Lennart Poettering
2da53d9031
Merge pull request #24460 from poettering/stub-measure-fix
sd-stub: some minor refactoring of the cpio/TPM code
2022-08-26 15:24:55 +02:00
Lennart Poettering
5eb1d8561c cpio: don't claim we measured anything if we weren't even asked
This is a bugfix.

Follow-up for 599fe002a1
2022-08-26 13:08:32 +02:00
Lennart Poettering
71611f2b56 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.
2022-08-26 13:08:32 +02:00
Yu Watanabe
93e898d624 test-network: add test for TCPCongestionControlAlgorithm= 2022-08-26 19:47:27 +09:00
Yu Watanabe
dc7c21f001 network: introduce TCPCongestionControlAlgorithm=
Closes #24432.
2022-08-26 19:47:23 +09:00
Lennart Poettering
92686e8fc4
Merge pull request #24457 from poettering/smbios-condition-fix
SMBIOS condition fix
2022-08-26 12:22:29 +02:00
Lennart Poettering
35c18a51f5 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.
2022-08-26 11:11:48 +02:00
Lennart Poettering
ce610af143 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.
2022-08-26 11:11:48 +02:00
Lennart Poettering
acd3c86624 test: don't accept failure as succes 2022-08-26 10:46:37 +02:00
Lennart Poettering
1dc042ae12 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.
2022-08-26 10:46:37 +02:00
Yu Watanabe
1a0e065e9f test: wait for loop device to be removed
Follow-up for bca762ce1a.

Fixes #24450.
2022-08-26 07:38:38 +00:00
Yu Watanabe
5342810bcf 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.
2022-08-26 07:29:36 +00:00
Yu Watanabe
51b8753017 sd-netlink: fix attribute type for RTAX_CC_ALGO 2022-08-26 14:33:54 +09:00
Jacek Migacz
d896260958 resolve: control system hostname synthesis via environment variable 2022-08-26 11:19:17 +09:00
Sonali Srivastava
f13f91f06a sleep: freeze and thaw user.slice to save resource while suspend 2022-08-26 11:16:35 +09:00
Zbigniew Jędrzejewski-Szmek
4ccde410a3 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
2022-08-26 11:15:44 +09:00
Yu Watanabe
2f968def11
Merge pull request #24454 from bluca/ci
Fix Ubuntu/SUSE mkosi
2022-08-26 11:13:53 +09:00
Luca Boccassi
a26e6bf8bf 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: 37d35150cb ("mkosi: Ensure we build all features/components in mkosi")
2022-08-26 00:12:55 +01:00
Luca Boccassi
255963ec3a 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.
2022-08-25 23:02:29 +01:00
Lennart Poettering
abd6faae80 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: cae8edd93c

(This is not an API break, since no version with this commit has ever
been released.)
2022-08-25 22:27:26 +01:00
Daniel Braunwarth
bf07a12516 pid1: extend "ConditionFirmware=" for checking SMBIOS system identification information 2022-08-25 21:44:21 +01:00