1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-18 06:03:42 +03:00

55906 Commits

Author SHA1 Message Date
Antonio Alvarez Feijoo
ddceb9ddd1 dissect: add missing --umount to the help output
(cherry picked from commit 1b967529d225077f063d10fbc647f55d6c3aae0e)
(cherry picked from commit d89e9993d2e58c9f9680005c5a66df33723c42af)
2022-11-04 13:09:21 +01:00
Zbigniew Jędrzejewski-Szmek
6cd8cc6fab coredump: avoid deadlock when passing processed backtrace data
We would deadlock when passing the data back from the forked-off process that
was doing backtrace generation back to the coredump parent. This is because we
fork the child and wait for it to exit. The child tries to write too much data
to the output pipe, and and after the first 64k blocks on the parent because
the pipe is full. The bug surfaced in Fedora because of a combination of four
factors:
- 87707784c70dc9894ec613df0a6e75e732a362a3 was backported to v251.5, which
  allowed coredump processing to be successful.
- 1a0281a3ebf4f8c16d40aa9e63103f16cd23bb2a was NOT backported, so the output
  was very verbose.
- Fedora has the ELF package metadata available, so a lot of output can be
  generated. Most other distros just don't have the information.
- gnome-calendar crashes and has a bazillion modules and 69596 bytes of output
  are generated for it.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2135778.

The code is changed to try to write data opportunistically. If we get partial
information, that is still logged. In is generally better to log partial
backtrace information than nothing at all.

(cherry picked from commit 076b807be472630692c5348c60d0c2b7b28ad437)
(cherry picked from commit 087cbfd9362d15eaa389060baa64bc40d1d7fbd0)
2022-11-04 13:09:21 +01:00
Zbigniew Jędrzejewski-Szmek
aab707b22d shared/json: use different return code for empty input
It is useful to distinguish if json_parse_file() got no input or invalid input.
Use different return codes for the two cases.

(cherry picked from commit 87a16eb8b54002a49f12944fc09ce45d0cbadf45)
(cherry picked from commit ab587aaf8e104202e2f5d215950e8f494ce08629)
2022-11-04 13:09:21 +01:00
Zbigniew Jędrzejewski-Szmek
1c40f074fa shared/json: allow json_variant_dump() to return an error
(cherry picked from commit 7922ead507e0d83e4ec72a8cbd2b67194766e58c)
(cherry picked from commit 219272f7b2afcd7f86abbd04360a07b0d5e1c849)
2022-11-04 13:09:21 +01:00
Lennart Poettering
e797ec736d man: document restrictions on naming interfaces
Let's document that "." is a bad choice of character when naming
interfaces. Let's also document the hard restrictions we make when
naming interfaces.

Result of the mess that is #25052.

(cherry picked from commit 8f598a463571608cbeb1b562afcadf2db335a530)
(cherry picked from commit d1066f33b53ec6a51166008c3116d722ed9c75c0)
2022-11-04 13:09:21 +01:00
Daan De Meyer
bad202a76c qrcode-util: Add support for libqrencode 3.0
They didn't actually change API between major versions, so let's
support the previous version as well so we can add CentOS 8 Stream
back to CI.

(cherry picked from commit 3f5225d7f301f70c9418122cf1e1989ccb33ea76)
(cherry picked from commit e2a07cdac6c2750c4d2d771da8c708cb1626b314)
2022-11-04 13:09:21 +01:00
Celeste Liu
b81d1613ad seccomp: add riscv_flush_icache to allow list
This system call is harmless because it only enforces ordering between stores
and instruction cache fetch.

fixed #24991
Related: https://github.com/felixonmars/archriscv-packages/issues/1840

Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
(cherry picked from commit 09925036cf2b5a5c4cf680422a38c427ca692cd6)
(cherry picked from commit 8be601f7ef4d650adfa78356dbe83f8c6aee2f62)
2022-11-04 13:09:21 +01:00
Michael Biebl
c622de4c9d logind: fix getting property OnExternalPower via D-Bus
The BUS_DEFINE_PROPERTY_GET_GLOBAL macro requires a value as third
argument, so we need to call manager_is_on_external_power(). Otherwise
the function pointer is interpreted as a boolean and always returns
true:

```
$ busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager OnExternalPower
b true
$ /lib/systemd/systemd-ac-power  --verbose
no
```

Thanks: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021644
(cherry picked from commit 63168cb517a556b2f4f175b365f5a4b4c7e85150)
(cherry picked from commit 3028e05955f1d1a43d57bbbe05321546d56c70a9)
2022-11-04 13:09:20 +01:00
Zbigniew Jędrzejewski-Szmek
4ddeea92fa shared/condition: avoid nss lookup in PID1
PID 1 is not allowed to do nss lookups because this may take a long time or
even deadlock.

While at it, the comparisons are reordered to do the "easy" comparisons which
only require a string comparison first. Delay parsing of the UID until it is
really necessary. The result is the same, because we know that "root" and
"nobody" parse as valid.

(cherry picked from commit 734f96b8490a2c48712ff6754a84fcaeac3d53c1)
(cherry picked from commit 5da595db39e8c6b229dfe388130683ff9a32eda5)
2022-11-04 13:09:20 +01:00
Yu Watanabe
5a9738b46e test: add more tests for StateDirectory= with DynamicUser=
This also moves the check for writable paths from test-execute to TEST-34.

Closes #10337.

(cherry picked from commit f01f70a9a3f3609c0c8bdbaa4b0b4abbb2b43993)
(cherry picked from commit 40053e60f5bfd51c0effb5869172cebe8cbe9228)
2022-11-04 13:09:20 +01:00
Yu Watanabe
ef3ef05f39 core: do not create symlink to private directory if parent already exists
The very basic functinality of StateDirectory= or friends is creating
specified directories. That should work if one entry is a subdirectory
of another. However, it does not when combined with DynamicUser=yes.

To support such case, this adds ExecDirectoryItem.only_create flag, and
if it is set PID1 only create private directory, and not create the symlink
to the private directory.

Fixes #24783.

(cherry picked from commit a2ab603cc42e1484c799f76a233b077c17db91cb)
(cherry picked from commit 0ba2e4bb6943545a4e43855970a3a3102dffbbc0)
2022-11-04 13:09:20 +01:00
Yu Watanabe
bfe7236f55 core: make exec_directory_add() extends existing symlinks
Follow-up for 211a3d87fb1fe971dc42a47b4c5cc167def8ab4e.

Previously, although ExecDirectoryItem.symlinks is strv, it always
contains at most one symlink.

(cherry picked from commit 564e5c987877f7e481d896c7fd82e8e5a69addc2)
(cherry picked from commit 1de3cb97ee0157dd53e583b369a41e55d3ca8977)
2022-11-04 13:09:20 +01:00
Yu Watanabe
950aa1d702 sd-ndisc: ignore failure in sending solicitation
Even if a bonding master interface has carrier, the underlying slave
interfaces may not. In such a case, sending solicitation fails with
-ENOBUS. Here, let's unconditionally ignore errors, as anyway we will
send a solicitation later.

Fixes #24717.

(cherry picked from commit 852bf93826b151be8b85d894071d95eb3b0d4498)
(cherry picked from commit d7b83b99862fd51226ec2960d65a6e3fdc8dfeed)
2022-11-04 13:09:20 +01:00
Zbigniew Jędrzejewski-Szmek
1316666e98 analyze: add forgotten return statement
We would fail with an assert in sd_bus_message_enter_container() afterwards.

(cherry picked from commit 5475e963c5e6ade35404384ba03caf79cb1bc2e5)
(cherry picked from commit e0ba044985ac33d5eb2fb0d09fc2ff1b2f9b73dc)
2022-11-04 13:09:20 +01:00
Zbigniew Jędrzejewski-Szmek
c54086dad8 basic/log: include the log syntax callback in the errno protection block
In general, log_syntax_internal() must keep errno unchanged. But the
call to log_syntax_callback() was added outside of the block protected
by PROTECT_ERRNO.

(cherry picked from commit 6b7834fe5de3de690e6efb9467c61691c4b2f30f)
(cherry picked from commit 40742ac74f6b8c0dd2b87a34817cf1b74f089ad1)
2022-11-04 13:09:20 +01:00
Zbigniew Jędrzejewski-Szmek
fa93c572f7 logind: do not emit beep in wall messages
Those may go via the PC speaker, which is annoying and unexpected.
Most people have it off, so this doesn't work reliably anyway, so we can
disable it without much loss.

Fixes #23520.

(cherry picked from commit ef3458cd5dc8d5b400c9abbea92986c43aef18cc)
(cherry picked from commit 3e38c39600dcc0b54b05a870937e57f08dfdc679)
2022-11-04 13:09:20 +01:00
Yu Watanabe
6475b8902f udev: drop assertion which is always false
Fixes a bug introduced by 67c3e1f63a5221b47a8fea85ae421671f29f3b7e.

Fixes #24945.

(cherry picked from commit 6209bbbd4b1c9ed2886028ab2ee3df0a7d0e2494)
(cherry picked from commit bf13ffec5932ced47861bfc440c879d9cdf6891a)
2022-11-04 13:09:20 +01:00
anarcat
f7d1325f3c man/shutdown: document how to switch to single-user mode
Before Debian switched to systemd, `shutdown now` would reset the system into
single user mode, doing roughly the equivalent of `telinit 1`.

Now, systemd's `shutdown` command does not behave that way; it defaults to
`poweroff` which might be confusing for users (like me) used to the previous
method.

Because I don't use the command often, I keep being stumped by this behavior,
and every time I look at the `shutdown(1)` manpage, I don't understand why I
can't find what I am looking for. This patch should make sure that people like
me find their way back to some sort of reason.

Maybe the *proper* way to fix this would be to restore the more classic
behavior, but I'm definitely not going to climb that hill. Besides, I clearly
remember the time I found out about the `shutdown` command and was *really*
confused when it brought me back to a command-line prompt. That was really
counter-intuitive and I find that change to actually be a good thing. So I'm
not proposing to change this behavior, merely document it better.

I originally added this to the `-P` option but it was suggested adding a new
`COMPATIBILITY` section instead, where other such issues could be added.

The `COMPATIBILITY` section is not actually officially documented. `man(1)`
talks about a `CONFORMING TO` section, but `shutdown(1)` is not
POSIX (`shutdown(2)` is, of course), so there's no actual standard on how this
should work.

The other option I considered was to add a `BUGS` section, but that seemed to
inflammatory, and definitely counter-productive.

(cherry picked from commit 9aafd310cc42716a923e0d40e56db7952e16a9a3)
(cherry picked from commit 78a8e938e44c76788a8c1d8dfa1f299cc5e2ba14)
2022-11-04 13:09:20 +01:00
Arnaud Ferraris
b1881b45b7 repart: always honour --discard=no
Currently, even if `--discard=no` is passed to `systemd-repart`, the
`context_discard_gap_after()` function still runs normally, discarding
e.g. all blocks between the GPT and the start of the first partition.

This can lead to issues on some embedded devices, where this space
holds the bootloader and shouldn't be modified (creating a protective
partition there is not always possible due to the specifics of the boot
process of some ARM-based SoC's).

This commit ensures passing `--discard=no` would be enough to ensure
the bootloader isn't wiped in such cases.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@gmail.com>
(cherry picked from commit 5113436b054aea7185a0287590aa64486fec3cec)
(cherry picked from commit 4abc5b2cfe11a00f14982f9b01717685c4601fcd)
2022-11-04 13:09:20 +01:00
Jacek Migacz
6d6e6a6be1 resolve: unsupported DNSSEC algorithms are considered INSECURE; not BOGUS
Resolves: #19824
(cherry picked from commit 1ca3600120c6db775f0fe357f6fc6cb3a13f1cc6)
(cherry picked from commit e91ea65aba5c146262074494a4d1de52bc919b6b)
2022-11-04 13:09:20 +01:00
Jonas Kümmerlin
f3869ed8df generator: skip fsck if fsck command is missing
This is useful for systems which don't have any fsck.

We already skip emitting the fsck dependency when the fsck.$fstype helper
is missing, but fstab-generator doesn't necessarily know the fstype when
handling the root= parameter.

Previously, systemd-fsck was started for these mounts and then exited
immediately because it couldn't find the fsck.$fstype helper.

(cherry picked from commit 13556724379a52951eb1977c2b7989a0159fd77c)
(cherry picked from commit 73db7d99323c236625656f906eb4e429613d324b)
2022-11-04 13:09:20 +01:00
Lennart Poettering
2009ecad44 nspawn: fix two error strings
(cherry picked from commit c941b650753f8ceada80a1df70fe8285a84995bc)
(cherry picked from commit 2e6e0498aa4bd72ade6479a67e5e5e390bc69766)
2022-11-04 13:09:20 +01:00
j00512545
5a18b43801 fix typo in log
(cherry picked from commit 365c2885f01371e547ae880ebfd920131b436735)
(cherry picked from commit 4cb75191c45c0c8f67759cf61137a65c220f8932)
2022-11-04 13:02:21 +01:00
Heinrich Schuchardt
87d6e6a14f meson: add libatomic dependency
Building with GCC 12.2 and binutils 2.39 fails on riscv64 Ubuntu Kinetic
with:

FAILED: systemd-oomd
/usr/bin/ld: systemd-oomd.p/src_oom_oomd-util.c.o:
in function `oomd_cgroup_context_acquire':
build/../src/oom/oomd-util.c:415:
undefined reference to `__atomic_exchange_1'

We have to link with -latomic.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
(cherry picked from commit 132c73b57ad1d363e97e1f4720f0e920826f34e1)
(cherry picked from commit 738eca5e05cf6494dc3f4126f6e33f03c7bac54d)
2022-11-04 13:02:21 +01:00
David Edmundson
01ea6ba5f1 xdg-autostart-service: Use common boolean parser
Technically the desktop entry specification says value should be the
string "true" or "false". Pragmatically every desktop has their own
parsing rules which are typically less strict on how to interpret other
values.

This caused some regressions downstream when we switched to the
xdg-autostart-generator where existing handmade files contained values
with "True" or "False".

(cherry picked from commit 38429cb1e3f37c298aa20ab25d644c87a23dd2e2)
(cherry picked from commit c40fa78968821096b3e9757107bfd10657ef92ff)
2022-11-04 13:02:21 +01:00
Ansgar Burchardt
99a630479b base-filesystem.c: add trailing zero byte for s390x entry
(cherry picked from commit 4167e2135e0df7ce21820107e73492bb749280b9)
(cherry picked from commit 654ae8c1e4b6ba367ba09936462fe2eb1ad8ea2e)
2022-11-04 13:02:21 +01:00
Yu Watanabe
260633c50b mount-util: fix error code
If multiple service is starting simultaneously with a shared image,
then one of the service may fail to create a mount node:

systemd[695]: Bind-mounting /usr/lib/os-release on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC "")...
systemd[696]: Bind-mounting /usr/lib/os-release on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC "")...
systemd[695]: Failed to mount /usr/lib/os-release (type n/a) on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC ""): No such file or directory
systemd[696]: Failed to mount /usr/lib/os-release (type n/a) on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC ""): No such file or directory
systemd[695]: Bind-mounting /usr/lib/os-release on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC "")...
systemd[696]: Failed to create destination mount point node '/run/systemd/unit-root/run/host/os-release': Operation not permitted
systemd[695]: Successfully mounted /usr/lib/os-release to /run/systemd/unit-root/run/host/os-release

The function apply_one_mount() in src/core/namespace.c gracefully
handles -EEXIST from make_mount_point_inode_from_path(), but it erroneously
returned -EPERM previously. This fixes the issue.

Fixes one of the issues in #24147, especially reported at
https://github.com/systemd/systemd/issues/24147#issuecomment-1236194671.

(cherry picked from commit b6ca2b281eff254dce2293990360e799af806ad4)
(cherry picked from commit 24238be484e6d7633bc68c784f7b3180299a80d4)
2022-11-04 13:02:21 +01:00
Jan Janssen
b2082bbad0 stub: Use EfiLoaderCode for kernel memory
Fixes: #24237
(cherry picked from commit 79a7ef89aa5dd9d99a904f1253bad7512d3feee5)
(cherry picked from commit 7dacfb3fb4eaceedf994705d63fa1a1b72f8f12a)
2022-11-04 13:02:21 +01:00
David Rheinsberg
a9b264eb6b bus: use inline trace argument for ANONYMOUS auth
Rather than using a separate DATA round to transmit the trace-string of
the ANONYMOUS authentication scheme, transmit it inline as argument.
This requires a refactor of the client-side SASL parser, as we now have
a different set of replies depending on the mode used.

This fixes an issue where libdbus-1 does not query for trace-strings if
not transmit inline as AUTH-ANONYMOUS argument. It is unclear from the
wording of the spec whether this is a violation by libdbus-1. However,
we can work around it by simply changing our mode of transmittal.

(cherry picked from commit 347f48246f7014f2e266b1fcb4527edee93037da)
(cherry picked from commit bb803856bc8f86c76fbfdd3f5c61f84264e79ab4)
2022-11-04 13:02:21 +01:00
Christian Hesse
eb06b4cd8f systemctl: color ignored exit status in yellow, not red
If the executable path is prefixed with "-", an exit code of the command
normally considered a failure (i.e. non-zero exit status or abnormal exit
due to signal) is recorded, but has no further effect and is considered
equivalent to success.

Let's honor this with `systemctl status`, and color ignored exit status
in yellow, not red.

(cherry picked from commit e879434df550c6dcfc02f23e613f4dda7f741089)
(cherry picked from commit de08edca171be09c10e6860664497b101fc36bc6)
2022-11-04 13:02:21 +01:00
Lennart Poettering
787034e091 manager: make clear internal Dump() logic is debugging only.
(cherry picked from commit acf2de52171106f7084e9410f4cc838b9a4183dd)
(cherry picked from commit 1531a496e37be4da0e094f72f6f5c8eb8d4a150a)
2022-11-04 13:02:21 +01:00
Lennart Poettering
d4b9c0477d man: document the Dump() calls of the PID 1 D-Bus interface, and what they are
(cherry picked from commit 0df8512124b05ed2d3be1537a4023e89ec33f0f7)
(cherry picked from commit c4fd38f7d221ae5b438f81df6171701fcf3df352)
2022-11-04 13:02:21 +01:00
Yu Watanabe
165b8f8853 resolve: do not cache mDNS goodbye packet
Fixes #24842.

(cherry picked from commit a78049fc0e6a75446cb782b548ae9db8edf7a107)
(cherry picked from commit 140fee4627dccf0e5ad5fed9dacb9384698668f8)
2022-11-04 13:02:21 +01:00
Adam Williamson
d44dbdb682 kbd-model-map: correct variants for cz-qwerty to include comma
As explained by @poncovka , the 'xvariant' string should contain
the same number of comma-separated elements as 'xlayout'. When
we have two layouts we need two items in xvariant, in this case
one of them is empty.

See https://github.com/rhinstaller/anaconda/pull/4355#pullrequestreview-1119913870
for @poncovka's full explanation.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
(cherry picked from commit 950aeeb8ffc950637fac22cb5a42074f227d57f3)
(cherry picked from commit 1a2d93a7700d5056f01ee5b42605b1245310f690)
2022-11-04 13:02:21 +01:00
msizanoen1
5670a04b3d resolve: persist DNSOverTLS configuration in state file
Currently, NetworkManager will set DNSOverTLS according to its
`connection.dnsovertls` configuration only once during connection,
instead of every single restart of systemd-resolved, causing resolved to
lose the configuration on restart.

Fix this by persisting DNSOverTLS in the runtime state file, which will
also make it more consistent with other interface-specific settings.

(cherry picked from commit b49e029a9953dd0f327efe9035a7c429c3cfeb92)
(cherry picked from commit 9d1ebb22479b16e10623138ccbf3cd27378bf230)
2022-11-04 13:02:21 +01:00
Yu Watanabe
d24b858687 udev: support by-path devlink for multipath nvme block devices
If multipath feature is enabled, nvme block devices may belong to the
"nvme-subsystem" subsystem, instead of "nvme" subsystem.
(What a confusing name...)

Then, the syspath is something like the following,
    /sys/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0n1
Hence, we need to find the 'real parent' device, such as
    /sys/devices/pci0000:00/0000:00:1c.4/0000:3c:00.0/nvme/nvme0

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2031810.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2124964.
Replaces #24748.

(cherry picked from commit 67c3e1f63a5221b47a8fea85ae421671f29f3b7e)
(cherry picked from commit 3137ac6ef5db1dcebd297e6d8c6af372d6acf23d)
2022-11-04 13:02:21 +01:00
Lennart Poettering
3f074e438a run: make --working-directory= work for --scope too
This sounds like a more user-friendly alternative to #24780

(cherry picked from commit fecc44776638a24099ce7e9ac227bcaa2c34f1e0)
(cherry picked from commit c948091cc54fda83923f3c13be51f4de1b422c59)
2022-11-04 13:02:21 +01:00
Adam Williamson
40766f6a48 kbd-model-map: add a mapping for switched czech qwerty/us
See https://bugzilla.redhat.com/show_bug.cgi?id=2121106 for the
background on this. One of Fedora's QA folks ran an install
and chose two keyboard layouts: Czech (qwerty) and US. Due to
the sad details of how the whole logic flow for trying to decide
what kbd layout best matches a given xkb config works (see
details in the bug comments), we wound up deciding the best-
matching kbd layout for this situation was cz-us-qwertz, which
is a czech/us switched layout, but is qwertz, not qwerty. This
seems like a poor outcome. Adding this line should result in us
picking cz-qwerty in this case. Which may be the 'legacy'
cz-qwerty.map from upstream kbd project (which is switched
cz/us), or may be the auto-converted xkb layout (which obviously
isn't switched). But either way, at least its primary mode is
Czech qwerty, which seems like a *better* choice than a layout
whose primary mode is Czech qwertz.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
(cherry picked from commit 97f99506980d92e858dc4685a2e84d9548d6eca4)
(cherry picked from commit 7bb204620dc7515146d02fc475768203d0037f9d)
2022-11-04 13:02:21 +01:00
Yu Watanabe
0ae11d2942 test: add more test cases for mkdir_p_safe() and mkdir_p_root()
(cherry picked from commit f8d5048dbf633f1bcccedbd337d751b33c5996a2)
(cherry picked from commit e5157050d1012cc621dd5608efbad366f57f8b12)
2022-11-04 13:02:21 +01:00
Yu Watanabe
259a84d5c2 mkdir: chase_symlinks_and_stat() does not return 0
This reverts commits e22916e61d1fdb7b46918b605ebf783d9017f9d8 and
1e146d738232acbe7f72903e9c5e4d1166ea67f5.

(cherry picked from commit f1d93b84bcc7c722a03928587023b144d4cc5e48)
(cherry picked from commit b3a9f7b5cb6a6ff56c60232b63f56d4b3cbae92f)
2022-11-04 13:02:21 +01:00
Daniel Braunwarth
bb2d46fc68 journalctl: respect --quiet flag during file concistency verification
Fixes #24563.

(cherry picked from commit 43deb1a8dce012c67a1285f7ef1bd40d971a4730)
(cherry picked from commit ac805eac156155bb8afdbaf704400e0ef854a6c9)
2022-11-04 13:02:21 +01:00
Sebastian Scheibner
6fd508a3ae busctl: Fix warning about invaild introspection data
The set_put function returns 0 if the element is already in the set and
not EEXIST, like e.g. hashmap does.

(cherry picked from commit bdff06de069fc83f18a126bf6b899ae2341572c3)
(cherry picked from commit 175ba30cf64772b136b5b982f04ff3c9a8295e23)
2022-11-04 13:02:21 +01:00
Lennart Poettering
7831972971 units: prolong the stop timeout for homed
Let's give IO/resizing/… more time then usual.

Fixes: #22901
(cherry picked from commit d3d2dd5e4f07c5d513c06df69f2c214681ddcd2a)
(cherry picked from commit 8b89e677e92b728383e203d98db45ae919fe6c97)
2022-11-04 13:02:21 +01:00
Lennart Poettering
7c2a025984 homed: don't wait indefinitely for workers on exit
Let's put some time-limit on it.

Fixes: #22901
(cherry picked from commit f8f621821a30b5b7e6c69dfb770e1c4cbc3db715)
(cherry picked from commit 202a79e7c506df0606bd17d1c7522bacc776398d)
2022-11-04 13:02:21 +01:00
Jade Bilkey
559e851a95 man: fix static bridge example
A NetDev is needed to create the bridge in order to match the example's description "This creates a bridge..."

(cherry picked from commit bc33789a06e5a727fa4662b0dfcbe02ef7e46687)
(cherry picked from commit 44660d2e12d8fb418307f2a701cd97823618574c)
2022-11-04 13:02:21 +01:00
Lennart Poettering
40cedddab7 log: don't attempt to duplicate closed fd
if the console fd is not open we shouldn#t try to move it out of the 0…2
range.

Fixes: #24535
Alternative-for: #24537
(cherry picked from commit f1ee066840eea748ad4074ac2bc859bb897953b9)
(cherry picked from commit e0dde8a14f8b05b88e1add1abdb68c364913346b)
2022-11-04 13:02:21 +01:00
Daniel Braunwarth
ba29bb342d 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.

(cherry picked from commit 1037178acfd093fb10d8f5e74f3072f78afdf7e8)
(cherry picked from commit 254b77e73cb81265146de653563a7fe3f9936b56)
2022-11-04 13:02:21 +01:00
Yu Watanabe
e22632a9da udev-util: minor cleanups for on_ac_power()
Follow-ups for #24420.

(cherry picked from commit 8676bdb70842ebb8d55fcc50774ba69f8a14b51a)
(cherry picked from commit 96da39ddb11cd4ea5514def19480c0b88b4b33f5)
2022-11-04 13:02:21 +01:00
Yu Watanabe
deb03fe7e5 shell-completion: drop unused $mode
Fixes #24473.

(cherry picked from commit c4c9714464a0e8138f247405c3a52bab00f60781)
(cherry picked from commit 49f9fa87b2186fe77c373dc8a8cf6759ff285687)
2022-11-04 13:02:21 +01:00
Zbigniew Jędrzejewski-Szmek
1f5ccc9931 on-ac-power: ignore devices with scope==Device
My mouse is reported as:

P: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.2/0003:046D:C52B.001E/0003:046D:4051.001F/power_supply/hidpp_battery_4
M: hidpp_battery_4
R: 4
U: power_supply
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.2/0003:046D:C52B.001E/0003:046D:4051.001F/power_supply/hidpp_battery_4
E: SUBSYSTEM=power_supply
E: POWER_SUPPLY_NAME=hidpp_battery_4
E: POWER_SUPPLY_TYPE=Battery
E: POWER_SUPPLY_ONLINE=1
E: POWER_SUPPLY_STATUS=Discharging
E: POWER_SUPPLY_SCOPE=Device
E: POWER_SUPPLY_MODEL_NAME=Wireless Mouse M510
E: POWER_SUPPLY_MANUFACTURER=Logitech
E: POWER_SUPPLY_SERIAL_NUMBER=4051-bc-cd-d2-5b
E: POWER_SUPPLY_CAPACITY_LEVEL=Normal

See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=25a0bc2dfc2ea732f40af2dae52426ead66ae76e
Effectively, "System" and "Unkown" are passed through, "Device" is rejected.

(cherry picked from commit 3c69e94a5ce8076fa1240028f24d9b4ba1b67408)
(cherry picked from commit b00cb050c80e8a8005420020bc1ea8f432992de8)
2022-11-04 13:02:21 +01:00