1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-25 10:04:04 +03:00

63459 Commits

Author SHA1 Message Date
Lennart Poettering
5f68f63e19 systemctl: dont's how memory limits that aren't available via D-Bus props
When using an old systemctl on a new PID 1 the "startup" memory limit
props are not initialized and currently be shown in status output as
zero, even though there's code to suppress the output in that case. Alas
it doesn't work, because the relevant fields are not marked as
"unset"... Fix that.

Follow-up for: 53fda560dc2c66502da7ad68db7d79b515a3601a
2023-03-28 13:39:48 +09:00
Yu Watanabe
1d4f517bba
Merge pull request #26993 from mrc0mmand/TEST-46-tweaks
test: explicitly pull in systemd-userdbd.service
2023-03-28 13:39:08 +09:00
Yu Watanabe
024ea9de1d
Merge pull request #26980 from ldv-alt/udevadm-verify
udevadm verify: add more checks
2023-03-28 13:38:12 +09:00
Hans de Goede
4e3a50169b hwdb: Move MSI touchpad-toggle mapping to generic MSI section
Like other MSI laptops the MSI Summit E16 Flip A12UCT laptop also send
atkbd scancode 0x76 for the Fn + F4 touchpad-toggle hotkey combo.

Move the existing mapping for this from the MSI Prestige And MSI Modern
section to the generic MSI laptop section.

While at it also drop the KEYBOARD_KEY_f1=f20 mapping from
the MSI Prestige And MSI Modern section, as that is already listed
in the generic MSI laptop section.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216824
2023-03-28 03:03:02 +09:00
Yu Watanabe
409759634e env-util: introduce strv_env_assign_many() 2023-03-28 02:51:54 +09:00
Daan De Meyer
23428bb19e ukify: Weaken file alignment assertions
Older versions of the stub are not aligned to the PE file alignment
size. If we remove the assertions, the UKI still boots without issues,
so let's drop the assertions and print a message about it instead.
2023-03-27 19:33:16 +02:00
Daan De Meyer
ffa859388b
Merge pull request #27005 from poettering/fd-reopen-symlink
fd_reopen() symlink handling tweaks
2023-03-27 19:32:05 +02:00
Daan De Meyer
16d6acd08b
Merge pull request #26902 from YHNdnzj/restart-sec-step
core: add RestartSteps= and RestartSecMax= to dynamically increase interval between auto restarts
2023-03-27 19:31:21 +02:00
Daan De Meyer
a065dcd239 locale: Add missing libxkbcommon dependency to tests
Fixes opensuse mkosi CI build
2023-03-27 17:15:02 +02:00
Lennart Poettering
2d887a2638 update TODO 2023-03-27 15:55:36 +02:00
Lennart Poettering
8084dec90d
Merge pull request #26932 from dtardon/journal-vacuum
Count size of all journal files when vacuuming
2023-03-27 15:49:58 +02:00
Daan De Meyer
89de1d983e mkosi: Narrow glob used to install python packages
Let's make sure we only install the python3 and python39 python
packages, instead of all the packages of all versions that are
packaged.

This also fixes the CentOS 8 CI because python3.11-pytest was failing
to install.

We have to ship our own powertools repo definition because we need to
enable module_hotfixes for powertools to coerce dnf into installing
some of the python packages.
2023-03-27 14:03:42 +02:00
Mike Yuan
57b33e0ce7
core/dbus-service: add RestartUSecCurrent property
This new property shows how much time we actually
waits before restarting.
2023-03-27 19:31:12 +08:00
Mike Yuan
be1adc27fc
core: add RestartSteps= and RestartSecMax= for exponentially increasing
interval between restarts

RestartSteps= accepts a positive integer as the number of steps
to take to increase the interval between auto-restarts from
RestartSec= to RestartSecMax=, or 0 to disable it.

Closes #6129
2023-03-27 19:31:12 +08:00
Frantisek Sumsal
13c2d0b15f userdb: rename the destructor to follow our coding style 2023-03-27 13:29:49 +02:00
Frantisek Sumsal
d31706384d userdb: fix a memory leak
[   49.275617] testsuite-46.sh[1862]: =================================================================
[   49.275870] testsuite-46.sh[1862]: ==1862==ERROR: LeakSanitizer: detected memory leaks
[   49.276039] testsuite-46.sh[1862]: Direct leak of 103 byte(s) in 14 object(s) allocated from:
[   49.276515] testsuite-46.sh[1862]:     #0 0x7f4dbc07243b in strdup (/lib64/libasan.so.8+0x7243b)
[   49.276707] testsuite-46.sh[1862]:     #1 0x7f4dbb3900d5 in free_and_strdup ../src/basic/string-util.c:952
[   49.276931] testsuite-46.sh[1862]:     #2 0x7f4dbb15c67d in json_dispatch_user_group_name ../src/shared/json.c:4699
[   49.277134] testsuite-46.sh[1862]:     #3 0x7f4dbb16da9b in json_dispatch ../src/shared/json.c:4395
[   49.277352] testsuite-46.sh[1862]:     #4 0x7f4dbb25b28e in userdb_on_query_reply ../src/shared/userdb.c:305
[   49.277603] testsuite-46.sh[1862]:     #5 0x7f4dbb2748b9 in varlink_dispatch_reply ../src/shared/varlink.c:760
[   49.277766] testsuite-46.sh[1862]:     #6 0x7f4dbb2748b9 in varlink_process ../src/shared/varlink.c:951
[   49.277975] testsuite-46.sh[1862]:     #7 0x7f4dbb27a001 in defer_callback ../src/shared/varlink.c:1897
[   49.278197] testsuite-46.sh[1862]:     #8 0x7f4dbb5d57dd in source_dispatch ../src/libsystemd/sd-event/sd-event.c:4191
[   49.278421] testsuite-46.sh[1862]:     #9 0x7f4dbb5d685d in sd_event_dispatch ../src/libsystemd/sd-event/sd-event.c:4780
[   49.278675] testsuite-46.sh[1862]:     #10 0x7f4dbb5d70bf in sd_event_run ../src/libsystemd/sd-event/sd-event.c:4841
[   49.278873] testsuite-46.sh[1862]:     #11 0x7f4dbb257e7c in userdb_process ../src/shared/userdb.c:591
[   49.279048] testsuite-46.sh[1862]:     #12 0x7f4dbb25f78f in membershipdb_iterator_get ../src/shared/userdb.c:1411
[   49.279280] testsuite-46.sh[1862]:     #13 0x7f4dbb23a98c in user_record_show ../src/shared/user-record-show.c:187
[   49.279504] testsuite-46.sh[1862]:     #14 0x404ae3 in show_user ../src/userdb/userdbctl.c:93
[   49.279710] testsuite-46.sh[1862]:     #15 0x40b4f5 in display_user ../src/userdb/userdbctl.c:418
[   49.279961] testsuite-46.sh[1862]:     #16 0x7f4dbb2804d2 in dispatch_verb ../src/shared/verbs.c:110
[   49.280233] testsuite-46.sh[1862]:     #17 0x40dcf3 in run ../src/userdb/userdbctl.c:1327
[   49.280434] testsuite-46.sh[1862]:     #18 0x40dcf3 in main ../src/userdb/userdbctl.c:1330
[   49.280657] testsuite-46.sh[1862]:     #19 0x7f4db9e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
[   49.280907] testsuite-46.sh[1862]: SUMMARY: AddressSanitizer: 103 byte(s) leaked in 14 allocation(s).
2023-03-27 13:29:49 +02:00
Frantisek Sumsal
98fa6c7210 test: explicitly pull in systemd-userdbd.socket
Since we don't run preset-all on the test image, the
systemd-userdbd.socket remains disabled. Let's pull it in explicitly
to give systemd-userdbd some coverage as well.
2023-03-27 13:29:12 +02:00
Lennart Poettering
f447b74185 update TODO 2023-03-27 13:20:11 +02:00
Lennart Poettering
09a7cef5ab test-fd-util: use stat_inode_same() where appropriate 2023-03-27 12:28:48 +02:00
Lennart Poettering
fdb583e6a9 fd-util: cover some corner cases with fd_reopen() on symlinks
The /proc/self/fd/ interface cannot be used to follow symlinks pinned
via O_PATH. Add a comment + test for that. Moreover, using fd_reopen()
with O_NOFOLLOW cannot work. Add an explicit check and test for that, to
make behaviour uniform.
2023-03-27 12:28:48 +02:00
Dmitry V. Levin
ebb00082d8 udev-rules: fix grammar in diagnostics about lines that have no effect
Fixes: 25de7aa7b90c ("udev: modernize udev-rules.c")
2023-03-27 10:00:30 +00:00
Frantisek Sumsal
4c9c91defc test: verify the journal with and without a sealing key
The bit flips during journal verification cause various types of journal
corruptions, so it's useful to go through it even without a sealing key
to see how we handle corrupted stuff.

Also, provide a sealing key if running in "CI mode" (i.e. arguments),
to check the FSS-related codepaths in CIs as well.
2023-03-27 11:00:30 +01:00
Dmitry V. Levin
860e2a1115 udev-rules: extend the check for conflicting expressions
Log an error when a rule line contains the following kind of conflicting
match expressions:

  KEY=="foo*", KEY=="bar*"
2023-03-27 10:00:30 +00:00
Dmitry V. Levin
acc1954a03 udev-rules: check token delimiters
When udev_rules_parse_file() is called by udevadm verify, issue warnings
about the following conditions in udev rules:
* the first token in the rule is preceded with a comma
* the last token in the rule is followed by a comma
* there is no comma between tokens
* there is no whitespace between tokens
* there is more than a single comma between tokens
* there is whitespace between a token and a comma
* there is no whitespace after comma
2023-03-27 10:00:30 +00:00
Dmitry V. Levin
9b419eb0b8 udev-rules: move udev_check_rule_line() invocation
Move udev_check_rule_line() invocation from udev_rule_file_get_issues()
to udev_rules_parse_file(), invoke udev_check_rule_line() only when
udev_rules_parse_file() is called by udevadm verify.

Subsequent commits are going to perform more checks invoked from
udev_rules_parse_file().
2023-03-27 10:00:30 +00:00
Dmitry V. Levin
3b94823102 udev-rules: move udev_rules_parse_file() after udev_check_rule_line()
Move udev_rules_parse_file() after udev_check_rule_line() as
the former us going to use the latter.
2023-03-27 10:00:30 +00:00
Dmitry V. Levin
d656c49604 testsuite-17.11.sh: add commas between tokens 2023-03-27 10:00:30 +00:00
Dmitry V. Levin
519044f565 rules: add whitespace after comma before the line continuation 2023-03-27 10:00:30 +00:00
Dmitry V. Levin
4c61088497 rules: remove stray whitespace before comma between tokens 2023-03-27 10:00:30 +00:00
Yu Watanabe
830e52caa2 sd-id128: make id128_read() optionally take root directory 2023-03-27 11:05:25 +02:00
Daan De Meyer
4e24df3cc3
Merge pull request #26961 from DaanDeMeyer/chase-and-pin
chase-symlinks: Add chase_and_open_parent() + at() variant
2023-03-27 10:41:08 +02:00
Luca Boccassi
8e1a129136
Merge pull request #26870 from fbuihuu/move-unit-tests-in-a-dedicated-subdir
Move unit tests in a dedicated subdir
2023-03-27 09:38:15 +01:00
Mike Yuan
c673fd52e0 journalctl: fix when --grep is used with --follow
Follow-up for #25147 (db4691961ca52759fe6645d0fddb659ee4299ac2)

--follow sets arg_lines to 10, which breaks
--grep as the latter implies --reverse.
So let's not set --reverse if --follow is used.
2023-03-27 10:28:59 +02:00
Zbigniew Jędrzejewski-Szmek
957b934f82
Merge pull request #26294 from yuwata/locale-verify-conf
locale: verify loaded keymap or friends
2023-03-27 10:26:24 +02:00
Yu Watanabe
9e43296fd2 bootctl: split-out entry token related definitions into boot-entry.[ch]
No functional change, just preparation for later commits.
These can be used in kernel-install later.

Note, unlike the our usual coding style, the arguments for
boot_entry_token_ensure() and parse_boot_entry_token_type() are
referenced, updated, and may freed, hence, always pass initialized
values. That's why they are not named as 'ret_xyz'.
2023-03-27 09:51:18 +02:00
Daan De Meyer
670afc182a chase-symlinks: Add chase_and_open_parent() + at() variant
Helper to chase a path, pin its parent directory and return the filename
of the resolved path in its parent directory.
2023-03-26 20:31:10 +02:00
Gertalitec
600362aa11 Define $KERNEL_INSTALL_UKI_GENERATOR
Define $KERNEL_INSTALL_UKI_GENERATOR in case one wants it to be different from $KERNEL_INSTALL_INITRD_GENERATOR. This can be useful if one wants to use mkinitcpio / Dracut to generate the initrd, but without creating the UKI so this can be left for e.g. ukify or something else. Right now these initrd generators will read /etc/kernel/install.conf and generate the UKI
2023-03-26 16:54:16 +02:00
taniishkaaa
f33c1c49a5
hwdb: Fixed thumb buttons reversed on CHERRY MW 2310 (#26992)
Fixes #12914.
2023-03-26 23:52:31 +09:00
Yu Watanabe
596ac132fb hwdb: drop redundant entry
Follow-up for ff155c81620bc4e1ccce27d4d5194707048d8143.

The entry already matches with the generic rule defined at the beginning
of the hwdb file.
2023-03-26 19:01:49 +08:00
Franck Bui
f8d527aa9a test: install symlinks with valid targets on SUSE and Debian 2023-03-26 10:44:09 +02:00
Yu Watanabe
cccc14c5a8
Merge pull request #26973 from mrc0mmand/userdbctl-tests
test: add a couple of tests for userdbctl
2023-03-26 09:49:27 +09:00
Zbigniew Jędrzejewski-Szmek
14ecfc1cd2 core/main: restore the correct assert about array position
'pos' is incremented after each assignment. If we use the maximum number
of arguments, we end up with pos==9 after all the assignments, and it
points to where the next value would be assigned. This position must remain
NULL.

The assert I "fixed" was intentionally introduced in
26abdc73a212b90f7c4b71808a1028d2e87ab09f as a bugfix. So my "fix" repeated
the same error that was fixed back then.
2023-03-26 09:48:14 +09:00
Yu Watanabe
6fc0d6b5ac
Merge pull request #26983 from mrc0mmand/coredump-test-followup
test: don't expand the subshell expression prematurely
2023-03-26 09:47:49 +09:00
Frantisek Sumsal
237d81fdb3 test: filter the merged coverage report instead
So we don't have to do this twice - once for the base report and then
for each "real" one.

Follow-up to 7fdd6e157a.
2023-03-25 17:55:41 +01:00
Frantisek Sumsal
93fe228bb1 test: add a couple of tests for userdbctl 2023-03-25 14:13:00 +01:00
Frantisek Sumsal
7fdd6e157a test: do an initial coverage capture
I noticed that our coverage reports miss some files completely - this
happens when the test doesn't touch the code in them at all, so the
generated coverage data (and resulting reports) have no information
about them. Let's fix this by doing an initial zero coverage capture
that contains a zeroed counter for every instrumented line in every
file, so when we later merge it with a capture from the test, it shows up
with a missing coverage instead of not showing at all.
2023-03-25 12:29:40 +00:00
Frantisek Sumsal
91c031f169 test: drop unnecessary return
Return code of the EXIT trap handler is ignored in bash.
2023-03-25 12:17:11 +01:00
Frantisek Sumsal
370fa624f5 test: don't touch the /failed marker in the subtest scripts
As it is already handled by the "main" script (testsuite-74.sh).
2023-03-25 12:15:33 +01:00
Frantisek Sumsal
0b189ac84c test: don't expand the subshell expression prematurely
We need to expand the subshell expression during the `bash -c`
invocation, not before, to take the desired effect, as now it expands to:

timeout 30 bash -c 'while [[ 0 -eq 0 ]]; do sleep 1; done'

instead of the expected:

timeout 30 bash -c 'while [[ $(coredumpctl list -q --no-legend 770 | wc -l) -eq 0 ]]; do sleep 1; done'

Follow-up to aadbd81f7f.
2023-03-25 12:10:58 +01:00
taniishkaaa
ff155c8162
hwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)
Closes #22793.
2023-03-25 11:41:07 +01:00