1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-02 09:47:03 +03:00

58240 Commits

Author SHA1 Message Date
Daan De Meyer
a0402d3ab6 mkosi: Update to latest commit
Fixes an issue with Arch builds failing by updating the archlinux
keyring package.

(cherry picked from commit a41940ed0efc786f60404c5940a664adf047eaab)
2022-11-08 00:09:18 +01:00
Daan De Meyer
081168fa19 mkosi: Build against Fedora rawhide as well
(cherry picked from commit 2d625795700f391b5e40b24388d66a93ba6e49c3)
2022-11-08 00:09:18 +01:00
Daan De Meyer
a38a0504ec mkosi: Remove usage of deprecated option names/sections
(cherry picked from commit 7ca9563ca18e0238d97f1b6eed8df62fdc2436aa)
2022-11-08 00:09:18 +01:00
Daan De Meyer
47404f1802 mkosi: Changes to allow booting with sanitizers in mkosi
- Extra memory because ASAN needs it
- The environment variables to make the sanitizers more useful
- LD_PRELOAD because the ASAN DSO needs to be the first in the list
- The sanitizer library packages
- Disable syscall filters because they interfere with ASAN
- Disable systemd-hwdb-update because it's super slow when systemd-hwdb
  is built with sanitizers
- Take the value for meson's b_sanitize option from the SANITIZERS
  environment variable

(cherry picked from commit 69d638e67e5bfc5fedcae4072f144a4f7d798c9a)
2022-11-08 00:09:18 +01:00
Daan De Meyer
db1281e12e mkosi: Update Ubuntu config to 22.04
(cherry picked from commit 111ff5d5115cb2f49aba59da5dbdf96a28d0974d)
2022-11-08 00:09:18 +01:00
Daan De Meyer
ca8dc691fe mkosi: Install xxd in images
Came in handy while working on
https://github.com/systemd/systemd/pull/24024 so let's install it
in the image by default.

(cherry picked from commit a6e6b6954c3b245894f50929190ac687eda9019b)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
f12a6945c6 ci: limit which env variables we pass through sudo
to work around #23987.

(cherry picked from commit d46e7c7cfd6c286a38298c067f16ac784c2a26f0)
2022-11-08 00:09:18 +01:00
Luca Boccassi
7e24ac6d77 mkosi: update to latest main
Fix build failure on SUSE Tumbleweed due to config changes

(cherry picked from commit 3a883d36eb383581f3c1b06cd2629401cfaa446d)
2022-11-08 00:09:18 +01:00
Daan De Meyer
a46ba01e79 mkosi: Update to latest release
This fixes the mkosi github action to unbreak the mkosi CI

(cherry picked from commit 13f4f0fd81eb37b73c0c3c0b5fb70adf8fb8e3ba)
2022-11-08 00:09:18 +01:00
Daan De Meyer
7ef1d71895 mkosi: Pull in fix that solves action mirror issue
(cherry picked from commit c024a6ac96f6e08eca57bd0253df6ffad603981a)
2022-11-08 00:09:18 +01:00
Daan De Meyer
d3d90ae66b mkosi: Update CI to mkosi 13
(cherry picked from commit f304d038845a2f5e5c02512a099dfeb4a70ee883)
2022-11-08 00:09:18 +01:00
Evgeny Vereshchagin
9bf797be2c ci: build systemd with clang with -Dmode=release --optimization=2
This is what's most likely used to build systemd with clang in
practice so let's test it as well.

Preparation for reverting 0bd292567a
(which replaced bogus buffer overflow found with _FORTIFY_SOURCE=3
with actual segfaults).

(cherry picked from commit 36cb69fc43cbce6d883b3a0da4f793c81dbf4b2e)
2022-11-08 00:09:18 +01:00
Evgeny Vereshchagin
9e88b3a5e1 ci: bump gcc in the "build test" workflow
gcc-12 has been released

(cherry picked from commit af7211541272823b1ef4fef8c36d10dc1027733e)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
dcbc64db61 ci: prefer the distro llvm version if available
(cherry picked from commit 50b2b5200409cf6306640e1275d9639183bbecfd)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
ccd81889d4 ci: bump GH Actions to Ubuntu Jammy where applicable
(cherry picked from commit aa1bf7e61dd899d45a98911c0b728e9115759ae2)
2022-11-08 00:09:18 +01:00
Antonio Alvarez Feijoo
b8fbf21526 kernel-install/90-loaderentry: do not add multiple systemd.machine_id options
Do not unconditionally add a new systemd.machine_id command line option, first
check if it already exists with the expected value.

Fixes #25203

(cherry picked from commit 981502c5cc9ce32c3f77ff74aad87cd6f0da3b16)
(cherry picked from commit 80f91fcb199c8f4ccb2494c42e9229e3791e0989)
2022-11-08 00:09:18 +01:00
Franck Bui
fe5e692bfc tests: minor simplification in test-execute
No functional change.

(cherry picked from commit 09415aef940f4a471da7cb899b9a66f1504d7c77)
(cherry picked from commit cf23a522b2d5d601c97b0a3e5dc985ab7ad37d6c)
2022-11-08 00:09:18 +01:00
Franck Bui
a94fe70bbe tests: make test-execute pass on openSUSE
In my understanding user group "3" (aka "sys") is kept for historical reasons
but not really useful these days. That's probably explained why this group
isn't defined on openSUSE.

Hence let's drop reference to this user group, this shouldn't lessen the
revelance of the test since SupplementaryGroups= is still tested with 2 other
groups.

(cherry picked from commit d723b0467d7b8c5c772086d5352442f3fca4368d)
(cherry picked from commit 64036ee87190afe3c12d0965147e8600f639d937)
2022-11-08 00:09:18 +01:00
Luca Boccassi
4a65c1674b firstboot: fix segfault when --locale-messages= is passed without --locale=
\#0  __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:295
No locals.
\#1  0x0000557444eb172b in process_locale () at ../src/firstboot/firstboot.c:342
        etc_localeconf = 0x7ffd40217b80 "/root/root/etc/locale.conf"
        locales = {0x0, 0x0, 0x0}
        i = 0
        r = <optimized out>
        __PRETTY_FUNCTION__ = "process_locale"
        __func__ = "process_locale"
\#2  0x0000557444eaff93 in run (argv=0x7ffd40217d98, argc=3) at ../src/firstboot/firstboot.c:1401
        loop_device = 0x0
        unlink_dir = 0x0
        r = <optimized out>
        loop_device = <optimized out>
        unlink_dir = <optimized out>
        r = <optimized out>
        __func__ = <optimized out>
        __PRETTY_FUNCTION__ = <optimized out>
        enabled = <optimized out>
        _error = <optimized out>
        _level = <optimized out>
        _e = <optimized out>
        _level = <optimized out>
        _e = <optimized out>
\#3  main (argc=3, argv=0x7ffd40217d98) at ../src/firstboot/firstboot.c:1432
        r = <optimized out>
        __PRETTY_FUNCTION__ = "main"

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

(cherry picked from commit 4c4a73ce068ef16cfe7ad07c7c3386ac1dbc58fe)
(cherry picked from commit a693cba0c3e1581626004d9d406fb6985a11135c)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
c3b22515b9 test: introduce sanity coverage for auxiliary utils
(cherry picked from commit d1020334fd15e0cffe68cb4d7e862a36253cc481)
(cherry picked from commit 85cf0a962e8b9e3a687bd22e52c3d6333d19a8f8)
2022-11-08 00:09:18 +01:00
Yu Watanabe
c61e4377d7 udev: add safe guard for setting by-id symlink
The ID_BUS property is necessary for creating by-id symlinks.

(cherry picked from commit 5286da064c97d2ac934cb301066aaa8605a3c8f9)
(cherry picked from commit 46a301accdf145293ad59892706bdde0f2d5d51a)
2022-11-08 00:09:18 +01:00
Yu Watanabe
2f4fdaaecc udev: drop redundant call of usb_id and assignment of ID_USB_INTERFACE_NUM
The usb_id builtin command is already called in the above, and the
command sets the ID_USB_INTERFACE_NUM property.

(cherry picked from commit b2e53f5a0f12db65c88404477fedee5c57d201ba)
(cherry picked from commit 3d2f0c5b8a939665dfff141ed6c550f9c9849fb1)
2022-11-08 00:09:18 +01:00
Yu Watanabe
491924940f udev: first set properties based on usb subsystem
After 479da1107a0d4e2f7ef5cd938512b87a0e45f180, the usb_id builtin
command does not set ID_SERIAL if ID_BUS is already set.
Before the commit, all properties set based on pci bus were overwritten
by the usb_id, hence now it is sufficient setting them only when ID_BUS is
not set yet.

Fixes #25238.

(cherry picked from commit 01e704eba982fbc1517287cd261d229ff8e0a779)
(cherry picked from commit dafd73367b4a30e274eb7e06bd610648aab1cc15)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
293c006789 test: further extend systemctl's sanity coverage
Also, fix a race condition introduced by d16684fe13:
```
[   16.904218] H testsuite-26.sh[394]: + systemd-run --unit failed.service /bin/false
[   16.964783] H systemd[845]: failed.service: Executing: /bin/false
[   16.965062] H systemd[1]: Started failed.service.
[   16.965462] H testsuite-26.sh[844]: Running as unit: failed.service
[   16.966390] H testsuite-26.sh[394]: + systemctl is-failed failed.service
[   16.977970] H testsuite-26.sh[846]: active
[   16.978403] H systemd[1]: failed.service: Main process exited, code=exited, status=1/FAILURE
[   16.978478] H systemd[1]: failed.service: Failed with result 'exit-code'.
```

(cherry picked from commit 23f3a6f5ff864fd26063c6c35fdaa6d85de566c7)
(cherry picked from commit 30ec52a92aa8672e8345855dd5a92181a4beedc1)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
f48e6576a2 test: add a couple of sanity tests for systemctl
(cherry picked from commit d16684fe13e1d56e55df19b57b6c01b9a9303086)
(cherry picked from commit 77860d006da0289801cb464a28b10974dd1decc7)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
3d5e379808 test: rename TEST-26-SETENV to TEST-26-SYSTEMCTL
(cherry picked from commit c5c258ae0a4a0cfc829ed07ff96c7fab79b6ca71)
(cherry picked from commit bcf30f9170261c7bd8a2232e5b7b03573ae7b57f)
2022-11-08 00:09:18 +01:00
Daan De Meyer
a34afc4197 namespace: Add hidepid/subset support check
Using fsopen()/fsconfig(), we can check if hidepid/subset are supported to
avoid the noisy logs from the kernel if they aren't supported. This works
on centos/redhat 8 as well since they've backported fsopen()/fsconfig().

(cherry picked from commit 1c265fcd5963603d338233840129ecad8d9c1420)
(cherry picked from commit 077a1d54b350a0de1b334698806dd28ff05690cd)
2022-11-08 00:09:18 +01:00
Jan Janssen
2ac138a5b6 coverage: Mark _coverage__exit as noreturn
../src/basic/coverage.h:15:48: warning: function '_coverage__exit' could
be declared with attribute 'noreturn' [-Wmissing-noreturn]

(cherry picked from commit 0bab5534b334677652bb69fe15eaa54ce84cbe7d)
(cherry picked from commit bb1ae9bcd38d9eb6d47b974f9e269efa9c36d1d8)
2022-11-08 00:09:18 +01:00
Yu Watanabe
9952c228a9 parse_hwdb: allow negative value for EVDEV_ABS_ properties
(cherry picked from commit f0b75cda5a3eac3fe953fd1a429a39e077387997)
(cherry picked from commit dda23814f068d66edae3f75eef26909dbe7b1fcb)
2022-11-08 00:09:18 +01:00
Frantisek Sumsal
7b6fa1d3e6 test: add a couple of sanity tests for journalctl
(cherry picked from commit ca46781c5ffa3aaa7a8fb6f09976357d003c4aae)
(cherry picked from commit 0508cd3b00a2c629c72c0c0e64f7aed7016e8794)
2022-11-08 00:09:18 +01:00
Yu Watanabe
cf21555d6d sd-device-monitor: dynamically allocate receive buffer
If udevd broadcasts a processed device with huge amount of properties,
then clients cannot receive the device.

Fixes #24987.

(cherry picked from commit efbd4b3ca84c0426b6ff98d6352f82f3b7c090b2)
2022-11-03 17:10:52 +01:00
Frantisek Sumsal
ee42e84968 man: use the correct 'Markers' property name for marking units
Follow-up to c9615f7352 and 70666e28a1.

(cherry picked from commit 1ca1bb03dec9ae3e8d734bd40eeb60210ffd7a0a)
2022-11-03 17:10:52 +01:00
Yu Watanabe
45090f3418 core: fix memleak in GetUnitFileLinks method
(cherry picked from commit a12ba535fa677e642c7ba19e81062ed6e9365ceb)
2022-11-03 17:10:52 +01:00
Yu Watanabe
7eefd2fbb7 network: forcibly reconfigure all interfaces after sleep
Previously, interfaces are partially reconfigured in a spurious way.
Let's use the same way as `networkctl reconfigure`.

Hopefully fixes #14987 and #24997.

(cherry picked from commit a39a9ac8065c29330207838b70fe388bde2bc254)
2022-11-03 16:56:27 +01:00
Youfu Zhang
66fa6110ba resolved: fix typo in feature level table
(cherry picked from commit 2ab0042854934827e61076c6e42c7381fdf78fdf)
2022-11-03 16:54:28 +01:00
Yu Watanabe
2f8f1d9e4a network: skip to reassign master ifindex if already set
Otherwise, the slave interface may go down, especially when the master
is bond.

Fixes #25067.

(cherry picked from commit 9f913d37a01f71e559d099bff280827f8817d8c5)
2022-11-03 16:52:59 +01:00
Lennart Poettering
d94f197818 resolved: fix copypasta in resolved varlink API
As reported by @holtmann

(cherry picked from commit 6032283b2fcc4ff6713eb84433a170a71ff84641)
2022-11-03 16:51:31 +01:00
Yu Watanabe
b61fcaca1b udev: always create device symlinks for USB disks
Previously, ata_id might not be able to retrieve attributes correctly,
and properties from usb_id were used as a fallback. See issue #24921
and PR #24923. To keep backward compatibility, still we need to create
symlinks based on USB serial.

Fixes #25179.

(cherry picked from commit 479da1107a0d4e2f7ef5cd938512b87a0e45f180)
2022-11-03 16:50:50 +01:00
Steve Ramage
6fc2f387af man: Add documentation for AssertCredential= (#25178)
Fixes #25177.

Co-authored-by: Steve Ramage <gitcommits@sjrx.net>
(cherry picked from commit 1d87f03a6e62476b996bccaba62af329aa40ba1c)
2022-11-03 16:49:37 +01:00
Nick Rosbrook
c339e8d71b man: document reboot --poweroff exception
When reboot is invoked, the -p/--poweroff option is intentionally
ignored. Update the man page to reflect this exception.

(cherry picked from commit 6dfaeac3704c68a1e297cef0c08e5b6ee1dbf3b7)
2022-11-03 16:49:16 +01:00
Yu Watanabe
91b8491e97 network: allow 0 for table number
Fixes #25089.

(cherry picked from commit 513bed294ef73566b170bd6943da702571278b1c)
2022-11-03 16:48:18 +01:00
Yu Watanabe
3f94f03389 network: Table= also accepts table name
(cherry picked from commit 29de4f7304bd02bd52bf484b08e704baf9e23948)
2022-11-03 16:48:12 +01:00
Lennart Poettering
bdd84e82e5 analyze: add --image= + --root= to --help text
(cherry picked from commit 9f5b68d6b7b4ea2645f094bfc7a9e7c80ec3bcb0)
2022-11-03 16:46:35 +01:00
Jan Janssen
23d66a03de meson: Fix build with --optimization=plain
Note that -O0 is deliberately filtered out as we have to compile with at
least -O1 due to #24202.

Fixes: #24323
(cherry picked from commit 7aa4762ce274a1c9a59902b972fa4fdee1b22715)
2022-10-24 21:50:57 +02:00
Zbigniew Jędrzejewski-Szmek
98a45608c4 manager: allow transient units to have drop-ins
In https://github.com/containers/podman/issues/16107, starting of a transient
slice unit fails because there's a "global" drop-in
/usr/lib/systemd/user/slice.d/10-oomd-per-slice-defaults.conf (provided by
systemd-oomd-defaults package to install some default oomd policy). This means
that the unit_is_pristine() check fails and starting of the unit is forbidden.

It seems pretty clear to me that dropins at any other level then the unit
should be ignored in this check: we now have multiple layers of drop-ins
(for each level of the cgroup path, and also "global" ones for a specific
unit type). If we install a "global" drop-in, we wouldn't be able to start
any transient units of that type, which seems undesired.

In principle we could reject dropins at the unit level, but I don't think that
is useful. The whole reason for drop-ins is that they are "add ons", and there
isn't any particular reason to disallow them for transient units. It would also
make things harder to implement and describe: one place for drop-ins is good,
but another is bad. (And as a corner case: for instanciated units, a drop-in
in the template would be acceptable, but a instance-specific drop-in bad?)

Thus, $subject.

While at it, adjust the message. All the conditions in unit_is_pristine()
essentially mean that it wasn't loaded (e.g. it might be in an error state),
and that it doesn't have a fragment path (now that drop-ins are acceptable).
If there's a job for it, it necessarilly must have been loaded. If it is
merged into another unit, it also was loaded and found to be an alias.
Based on the discussion in the bugs, it seems that the current message
is far from obvious ;)

Fixes https://github.com/containers/podman/issues/16107,
https://bugzilla.redhat.com/show_bug.cgi?id=2133792.

(cherry picked from commit 1f83244641f13a9cb28fdac7e3c17c5446242dfb)
2022-10-24 21:21:51 +02:00
Zbigniew Jędrzejewski-Szmek
228cd82d2c manager: reformat boolean expression in unit_is_pristine()
Not not IN_SET(…) is just too much for my poor brain. Let's invert
the expression to make it easier to undertand.

(cherry picked from commit b146a7345b69de16e88347acadb3783ffeeaad9d)
2022-10-24 21:21:50 +02:00
Yu Watanabe
06dc900efa network/bridge: fix UseBPDU= and AllowPortToBeRoot=
Fixes bugs caused by 7f9915f0de67f3a10a4b22810d119da65af8c84a.

Fixes #24268.

(cherry picked from commit 3f504b892b92f54087feeb3fb35e3938567d7fa0)
v251.7
2022-10-24 21:05:57 +02:00
Lennart Poettering
b0972e4df0 homed: properly initialize all return params
(cherry picked from commit 3b1494ad700ca1ac4b5917b0bb97e7dc9fabc2be)
2022-10-24 20:52:58 +02:00
Zbigniew Jędrzejewski-Szmek
d61ccd0252 meson: always use libatomic if found
Semi-quoting https://github.com/systemd/systemd/issues/25057:

clang-16 has made the choice to turn on -Werror=implicit-function-declaration,implicit-int.
(See Gentoo's tracker bug https://bugs.gentoo.org/870412).
Added in commit 132c73b57ad1d363e97e1f4720f0e920826f34e1, systemd now does a
check to see if libatomic is needed with some compile/link tests with e.g.
__atomic_exchange_1, but the tests don't provide a prototype for
__atomic_exchange_1 so with clang-16 the test fails, breaking the build.

Let's simplify things by linking to libatomic unconditionally if it is found
and seems to work. If actually unneeded, it might be dropped via --as-needed.
This seems to work with gcc and clang.

declare_dependency() is used instead of cc.find_library(), because the latter
picks up a symlink in gcc private directory (e.g.
/usr/lib/gcc/x86_64-redhat-linux/12/libatomic.so), and we don't want that.

Fixes #25057.

(cherry picked from commit 96f8c63601a33a7e9e47397be2de811e00477ad8)
2022-10-24 20:52:45 +02:00
Luca Boccassi
833ad5f950 Revert "Fix issue with system time set back (#24131)"
This fix unfortunately introduced a much worse regression that
is affecting many users, so let's revert it for now and rework
it in the next release.

This reverts commit 5ded3917a161d87984d74d70b5eb2a254e54b44e.

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

(cherry picked from commit 0bf1d0ff049dd257dc5b6efc6b3f5864dc8bee6e)
2022-10-24 20:52:23 +02:00