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

55583 Commits

Author SHA1 Message Date
Luca Boccassi
042bf8d0e6 TEST-29: do not pass -q to mk/unsquashfs, not supported on CentOS 8
(cherry picked from commit 963c560a2939c79ba9896280cb5660fea64c94cf)
2022-03-09 21:20:15 +00:00
Zbigniew Jędrzejewski-Szmek
00b5aa8d74 portable: add return parameter to GetImageMetadataWithExtensions
The complaint was that the output array was used for two kinds of data, and the
input flag decided whether this extra data should be included. The flag is
removed, and instead the old method is changed to include the data always as
a separate parameter.

This breaks backward compatibility, but  the old method is effectively broken
and does not appear to be used yet, at least in open source code, by
searching on codesearch.debian.net and github.com.

Fixes #22404.

Co-authored-by: Luca Boccassi <bluca@debian.org>
(cherry picked from commit 087a799f64560bb0379b8a99ebbd9ca84804e4c3)
2022-03-09 21:20:15 +00:00
Zbigniew Jędrzejewski-Szmek
06d466a05c portable: inline one variable declaration
(cherry picked from commit 90e3f3581dd578a23aec9f63ca846babfe4fcaa0)
2022-03-09 21:20:15 +00:00
Zbigniew Jędrzejewski-Szmek
7856dc3109 portablectl: reorder if branches to match previous conditional in the same function
One is a ternary op, the other an normal conditional, but they should still use
the same order of branches.

(cherry picked from commit 573e33de078956ded078653ef3f90f93469b4dbf)
2022-03-09 21:20:15 +00:00
Zbigniew Jędrzejewski-Szmek
931d00d350 TEST-29: trim output a bit
IIUC, pipefail doesn't matter for a sequence of commands joined with &&, and we
don't have any pipes. And such a failing expression also does not trigger an
exit, so the set +e/set -e were noops.

(cherry picked from commit 13391986b50e76cc58744c44ccb8124e48fd3c3d)
2022-03-09 21:20:15 +00:00
Luca Boccassi
a87fdd2af2 portable: add flag to return extension-releases in GetImageMetadataWithExtensions
Return the name of each extension and the associated extension-release
file, and pretty-print them in 'portablectl inspect', if a new flag
is passed.

$ portablectl inspect --extension app2 --extension app0  minimal app0 app1
(Matching unit files with prefixes 'app0', 'app1'.)
Image:
        /run/portables/minimal.raw
Portable Service:
        n/a
Operating System:
        Debian GNU/Linux 10 (buster)
Extension:
        /run/portables/app2.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Operating System:
                n/a (debian 10)
Extension:
        /run/portables/app0.raw
        Extension Scope:
                n/a
        Extension Compatibility Level:
                n/a
        Portable Service:
                n/a
        Portable Prefixes:
                n/a
        Operating System:
                n/a (debian 10)
Unit files:
        app0.service

(cherry picked from commit e3f7ed944ae750a40685c52349f3cc850db0876e)
2022-03-09 21:20:15 +00:00
Frantisek Sumsal
85cc27fe88 test: accept GC'ed units in newer LVM
Since lvm 2.03.15 the transient units are started without `-r`, thus
disappearing once they finish and breaking the test (which expects them
to remain loaded after finishing). Let's accept `LoadState=not-found` as
a valid result as well to fix this.

Follow-up to: d10d562bd4b9f93130fb2b23f2b0d0d4126ea7d4
See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=fbd8b0cf43dc67f51f86f060dce748f446985855

(cherry picked from commit b034f02c628057c30a2136289a1b388a6fb9a737)
2022-03-05 21:03:32 +00:00
Frantisek Sumsal
c635058797 test: lvm 2.03.15 dropped the static autoactivation
so install the respective generator only if we're running with older
lvm versions.

See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=ee8fb0310c53ed003a43b324c99cdfd891dd1a7c
(cherry picked from commit d10d562bd4b9f93130fb2b23f2b0d0d4126ea7d4)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
7310212021 meson: move files' closing brace to separate line
(cherry picked from commit 2f492a739c5edd09f1c16bc7da84c37a8744121a)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
34023aaaaa meson: use files() for libudevd_core_sources too
I'm not sure why a plain-text list was used in this case.

(cherry picked from commit b9acb5074e115a3010f8507c6f3d2cad4132aa15)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
c76aba2b24 meson: do not use split() in file lists
The approach to use '''…'''.split() instead of a list of strings was initially
used when converting from automake because it allowed identical blocks of lines
to be used for both, making the conversion easier.

But over the years we have been using normal lists more and more, especially
when there were just a few filenames listed. This converts the rest.

No functional change.

(cherry picked from commit f1b98127ff6320648cc3dc876f3b6a5aa3af204b)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
7302937a08 journalctl: advertise --header a bit more
Fixes #2738.

(cherry picked from commit 367a5e8a67bbc2b5e03ca1a3e5a601ef49b5bd2a)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
f1928ef819 man: describe UNIT=/USER_UNIT=
Fixes 17538.

(cherry picked from commit c1d1742a7f6a65f60dce1a4f22a22d443493757c)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
6802c4dc8a man: tweak description of auto/noauto
I think the current behaviour is stupid: 'x-systemd.automount,noauto' should
mean that we create the units, but don't add .mount or .automount to any targets.
Instead, we completely ignore 'noauto'. But let's at least describe the
implementation.

Text suggested by dpartrid in the bug.

Fixes #21040.

(cherry picked from commit 55fabe92e2efb1a907d4c3c93dc63b96ff5b6860)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
dd5ddebef5 man: describe capability checks on the bus
A description of SD_BUS_VTABLE_CAPABILITY is added, and the discussion
on SD_BUS_VTABLE_UNPRIVILEGED in expanded. I think it would be nice
to add longer description of how access is checked (maybe in sd-bus(3)),
but I'm leaving that for later. I think the text that was added here
describes everything, even if tersely.

Fixes #21882.

(cherry picked from commit b4e7d7555e6266ff566a17eb5f616b365771028f)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
8e4c221585 man: fix formatting of macros in sd_bus_add_object
docbook would convert the newline to a space before the first argument:
  SD_BUS_METHOD_WITH_ARGS( member, args, result, handler)

And we need each item in a separate <para>, otherwise they'll all be in
one line.

(cherry picked from commit 3c080282e928a7edfcdb74feb2139ef1ac6f2ad0)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
61c143b08c man: say that we ignore ignored options
Fixes #22057.

(cherry picked from commit 382586894b9c09974aa734a1f77d3f6f69126d76)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
b634a0a615 man: drop outdated info about polkit in pid1
Fixes #22648.

(cherry picked from commit 46d362f406e1a75fc8f924b9b16d5d352be6d081)
2022-03-05 21:03:32 +00:00
David Tardon
543c73300e devnode-acl: use _cleanup_ to free acl_t
(cherry picked from commit 203ea2c8f158288fea56c5be980715b2b7e002fe)
2022-03-05 21:03:32 +00:00
Alfonso Sánchez-Beato
7be5734d02 sd-stub: do not print warning if filesystem is not supported
Do not print a warning in case we try to load the file system protocol for an
unsupported file system, just return EFI_SUCCESS instead.

(cherry picked from commit 178d598b5fae36fa9d54c30668771f9c626724f6)
2022-03-05 21:03:32 +00:00
Tobias Stoeckmann
6b37adf4a1 core: check size before mmap
The data type off_t can be 64 on 32 bit systems if they have large
file support. Since mmap expects a size_t with 32 bits as second
argument truncation could occur. At worst these huge files could
lead to mmaps smaller than the previous check for small files.

This in turn shouldn't have a lot of impact because mmap allocates
at page size boundaries. This also made the PAGE_ALIGN call in
open_mmap unneeded. In fact it was neither in sync with other mmap
calls nor with its own munmap counterpart in error path.

If such large files are encountered, which is very unlikely in these
code paths, treat them with the same error as if they are too small.

(cherry picked from commit 1a823cdeb9faea3849843e0b3dae0fbdd607e8b7)
2022-03-05 21:03:32 +00:00
Lennart Poettering
b707664eee killall: show PID of processes killed in final killing spree
Let's show the PID of killed processes in all cases, to make debugging
easier.

See: https://lists.freedesktop.org/archives/systemd-devel/2022-March/047504.html
(cherry picked from commit 94ce42bcb6288583bfa8995aa705d99a9221f47e)
2022-03-05 21:03:32 +00:00
Daan De Meyer
1ef5fd61bd shared: Add more dlopen() tests
Add dlopen_dw(), dlopen_elf() and dlopen_pcre2() to the dlopen test.
To enable adding dlopen_pcre2(), we move pcre2-dlopen.h/c from
src/journal to src/shared.

(cherry picked from commit ee48779e05831a0ec5e1ba5e7ed5fe92aaca1d9e)
2022-03-05 21:03:32 +00:00
Josh Triplett
3dc6881d87 file-hierarchy: Document /sys/fs/cgroup
file-hierarchy does not mention anything about the expected mountpoint
for cgroups. This may lead some software to believe it will need to
search for it (e.g. by scanning mountinfo) rather than just looking in
the canonical location.

Document the canonical mountpoint as /sys/fs/cgroup. Also provide
information on the non-default configurations, but
make it clear that in such configurations if cgroup2 is mounted (hybrid
mode) it won't have resource controllers attached. This will help
software know if it should fall back to /sys/fs/cgroup/unified or just
ignore that case.

(cherry picked from commit c8aeb9d672fac7ac2d1e350431b7b4e734b90a5d)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
d4dd289f82 man: recommend built-in platform.freedesktop_os_release() in our page
Python gained support for reading os-release, let's advertise it a bit more.
Our open-coded example is still useful, but let's not suggest it as the
default implementation.

I added quotes around the printed string because it looks a bit better
this way.

(cherry picked from commit ee6fd6a50922d2b27c97084e1c3f9872d495c273)
2022-03-05 21:03:32 +00:00
Frantisek Sumsal
99d291eee9 test: accept both unpadded and padded partition sizes
Since util-linux/util-linux@921c7da55e
libfdisk aligns the last partition (on GPT) for optimal I/O. Let's
account for that.

Fixes: #22606
(cherry picked from commit d490188b8f6da658d8086dd53b7db95735e5cca1)
2022-03-05 21:03:32 +00:00
Daan De Meyer
f0cc6d2f99 mkosi: Remove Arch nspawn workaround
This has been fixed so the workaround can be removed.

(cherry picked from commit 6b2ab8fc5cc0f706b85cbd559e8dcf4e05d7687d)
2022-03-05 21:03:32 +00:00
Daan De Meyer
e517b37922 meson: Drop required libfdisk version to 2.32
We initially pinned this to 2.33 in
e71f5585b9b0580428f9530d0a485265c9c25165 because libfdisk 2.32 in
CentOS 8 didn't have
2f35c1ead6
backported.

If we check now, we can see it has been backported
(https://git.centos.org/rpms/util-linux/blob/c8s/f/SOURCES/0048-libfdisk-count-gaps-to-possible-size-when-resize.patch)
which means we can drop the required version to 2.32 instead of 2.33.

(cherry picked from commit baec7d782b07414f0c13ba3a0b0b526973e04923)
2022-03-05 21:03:32 +00:00
Peter Hutterer
ea5701eb64 udev-builtin-input_id: don't label absolute mice as pointing sticks
The Getac UX10 tablet exposes a "CUST0000:00 0EEF:C002 Mouse" device
with BTN_LEFT/RIGHT and ABS_X/Y on the i2c bus. This causes the builtin
to incorrectly label it as pointing stick (all i2c mice are
tagged as ID_INPUT_POINTING_STICK, see 3d7ac1c655ec4).

Fix this by adding a separate variable for absolute pointing
devices like the VMmouse USB mouse or this Getac tablet - this way we
skip the pointing stick check.

See https://gitlab.freedesktop.org/libinput/libinput/-/issues/743
for recordings.

(cherry picked from commit 8ac9ec4d5c210825759d515422d3e66c20615fc1)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
ea65b10aab man: various issues reported in #22432
Fixes #22432.

(cherry picked from commit fe003f02dd19b9ae88af0384e5cf4f5934d1e9db)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
b568be2aec man/systemd-analyze: split out example to a separate section
It turns out we can't have an Example nested in a list, and every
combination of nesting I tried looked bad either in troff or in html.
The whole example is moved to a separate section.

(cherry picked from commit e6ce19516315138d983ed4b7776d9ebd2fb296d8)
2022-03-05 21:03:32 +00:00
Zbigniew Jędrzejewski-Szmek
c1cdb13193 man: adjust command for Fedora installations
glibc now has Suggests:glibc-minimal-langpack, so we don't
need to mention it ourselves.

--repo=… is a nicer alternative to --disablerepo=* --enablerepo=….
It also avoids the issue with quoting.

Let's exclude weak deps, but install systemd-networkd, so the container
can configure networking if necessary.

(cherry picked from commit 8c4db5629c877425b2f46e414a94a8f24280a9d3)
2022-03-05 21:03:32 +00:00
Yu Watanabe
a7ec2be150 journal-send: close fd on exit when running with valgrind
Fixes an issue reported in #22576.

(cherry picked from commit eb9752d2be82d994cd6a17f271be27c4d56423d6)
2022-03-05 21:03:32 +00:00
Yu Watanabe
4d24a36990 test-journal-send: close fd opend by syslog()
Fixes an issue reported in #22576.

(cherry picked from commit 9048a6ccf3bd4f6794fc1ac9a838e1a0bfbcabf1)
2022-03-05 21:03:32 +00:00
Yu Watanabe
02bebaef30 unit: escape %
Fixes #22601.

(cherry picked from commit 6e4d122ad1db11ca898de183f898f731c4839d4a)
2022-03-05 21:03:32 +00:00
Lennart Poettering
4a90c12f4f clang-format: we actually typically use 16ch continuation indentation
We use 8 for blocks, and 16 for continuation in most cases afaics, hence
say so in .clang-format too

(cherry picked from commit 92148fb77766767fdb6ad6e52747317dae2aae85)
2022-03-05 21:03:32 +00:00
Yu Watanabe
81d3e2abff test: fix file descriptor leak in test-psi-util
Fixes an issue reported in #22576.

(cherry picked from commit be99883e131ef422f8278ec1d099520996a78bb0)
2022-03-05 21:03:32 +00:00
Yu Watanabe
d9189c3111 test: fix file descriptor leak in test-tmpfiles.c
Also fixes a typo in assertion.

Fixes an issure reported in #22576.

(cherry picked from commit 1da5325d19dee654326e5fa2f61262e5e0a40fff)
2022-03-05 21:03:32 +00:00
Yu Watanabe
cfe1cd0a06 test: fix file descriptor leak in test-fs-util
Fixes an issue reported in #22576.

(cherry picked from commit 19962747ca86a25e7102c536380bb2e9d7cfee9a)
2022-03-05 21:03:32 +00:00
Jan Janssen
e37912e4bc boot: Handle shift and logo keys too
Some firmware supports sending input events for shift and logo keys.
Previously, we would suppress these with EFI_NOT_READY unless
some other key was pressed alongside, but it is really the job of the
caller to decide how to handle these.

Note that for keys that already have a printable shift representation
the reported input event will not have the shift key bits set
(Shift+a is reported as A). Should some firmware turn out to violate the
spec here we can always remove that part.

(cherry picked from commit 3f9973bf368475d1f2f7f587e7af728dd6d84e10)
2022-03-05 21:03:32 +00:00
Jan Janssen
c6603da3ad boot: Properly check status code of console_key_read
In some cases there was a unlikely possibility that we would look
at an uninitialized key value.
Also, returning in case of unexpected input error cases should prevent
infinite looping.

(cherry picked from commit 1cb5d7857b205023a0473ec13df154ae2e254066)
2022-03-05 21:03:32 +00:00
Yu Watanabe
55ec995341 test: fix file descriptor leak in test-oomd-util
Fixes an issue reported in #22576.

(cherry picked from commit 282696ce52471f5e3c963b9d98dbc89fba3a1fba)
2022-03-05 21:03:32 +00:00
Yu Watanabe
92b86911c0 test: fix file descriptor leak in test-catalog
Fixes an issue reported in #22576.

(cherry picked from commit 62d4b3b36e9aba9e605ba042a75c374155b6e18b)
2022-03-05 21:03:32 +00:00
Yu Watanabe
b10cc2de7d test-oomd-util: fix conditional jump on uninitialised value
Fixes #22577.

(cherry picked from commit a6d6a51d83fae32212e1780e71b16517a4df9a57)
2022-03-05 21:03:32 +00:00
Yu Watanabe
1343c2efd5 test-oomd-util: style fixlets
(cherry picked from commit d9fe39b24a0a5464c83c7a754752ca21dbd2578f)
2022-03-05 21:03:32 +00:00
Franck Bui
2198c08d07 core: really skip automatic restart when a JOB_STOP job is pending
It's not clear why we rescheduled a service auto restart while a stop job for
the unit was pending. The comment claims that the unit shouldn't be restarted
but the code did reschedule an auto restart meanwhile.

In practice that was rarely an issue because the service waited for the next
auto restart to be rescheduled, letting the queued stop job to be proceed and
service_stop() to be called preventing the next restart to complete.

However when RestartSec=0, the timer expired right away making PID1 to
reschedule the unit again, making the timer expired right away... and so
on. This busy loop prevented PID1 to handle any queued jobs (and hence giving
no chance to the start rate limiting to trigger), which made the busy loop last
forever.

This patch breaks this loop by skipping the reschedule of the unit auto restart
and hence not depending on the value of u->restart_usec anymore.

Fixes: #13667
(cherry picked from commit c972880640ee19e89ce9265d8eae1b3aae190332)
2022-03-05 21:03:32 +00:00
Matthias Lisin
d016749c00 docs: swap Name and Partition Type UUID in header
(cherry picked from commit 7d5beae28ca75725a680b0ab3ef5728a252282e5)
2022-03-05 21:03:32 +00:00
Matthias Lisin
5a322fd54b tools: adjust re.match to recent gpt.h additions
with addition of SD_ID128_MAKE_UUID_STR entries to src/shared/gpt.h the tool
failed halfway due to falsly matching the new entries

(cherry picked from commit 5fa87e9651074e8b78f632e43f0c2001a27f5b60)
2022-03-05 21:03:32 +00:00
Luca Boccassi
7f28c0f3f3 mkosi CI: mask isc-dhcp-server units
The packages are installed to provide the dhcpd binary, used by
test/test-network/systemd-networkd-tests.py, but we don't need the units
to run, and in fact in some cases the image fails to boot because of
them:

Spawning container image on /home/runner/work/systemd/systemd/image.raw.
Press ^] three times within 1s to kill container.
● isc-dhcp-server.service  loaded failed failed ISC DHCP IPv4 server
● isc-dhcp-server6.service loaded failed failed ISC DHCP IPv6 server
Container image failed with error code 1.
Error: Process completed with exit code 1.

Mask the units with an --extra-tree.

(cherry picked from commit 21838f36a64e71dd6439692e57d629f27e4954ea)
2022-03-05 21:03:32 +00:00
Frantisek Sumsal
e59c381e23 systemctl: make --timestamp= affect the show verb as well
Currently the `--timestamp=` option has no effect on timestamps shown by
`systemctl show`, let's fix that.

Spotted in #22567.

Before:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 15:25:57 CET
StateChangeTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ConditionTimestamp=Sat 2021-12-11 15:25:57 CET
AssertTimestamp=Sat 2021-12-11 15:25:57 CET
```

After:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 14:25:57.177848 UTC
StateChangeTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
InactiveExitTimestamp=Sat 2021-12-11 14:25:57.177871 UTC
ActiveEnterTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
ActiveExitTimestamp=Sat 2021-12-11 14:25:57.144677 UTC
InactiveEnterTimestamp=Sat 2021-12-11 14:25:57.176331 UTC
ConditionTimestamp=Sat 2021-12-11 14:25:57.176980 UTC
AssertTimestamp=Sat 2021-12-11 14:25:57.176980 UTC

```

(cherry picked from commit a59e5c625da5a6e0c46e493d55f2f4212e9457ca)
2022-03-05 21:03:32 +00:00