Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2019 16:04:26 +0000 (17:04 +0100)]
hibernate-resume-generator: wait "infinitely" for the resume device
This makes changes similar to the parent commit, but for hibernate-resume-generator.
If resume= is specified on the kernel command line, we'll set JobRunningTimeoutSec=0
for the device. This matches what we do for the root device.
In practice, other timeouts will take effect. For example dracut tries (and
fails :[ ) to start dracut-emergency.service after some time.
Fixes #7242, https://bugzilla.redhat.com/show_bug.cgi?id=
1705522.
(cherry picked from commit
ff757c9d294153a26a9dd2d9817d1985656f3002)
Zbigniew Jędrzejewski-Szmek [Wed, 5 Feb 2020 16:54:16 +0000 (17:54 +0100)]
hwdb: update to v245-rc1
The change in
419a8a2dabb4184080d06f583f9539780ec10ec6 is not included.
Zbigniew Jędrzejewski-Szmek [Tue, 4 Feb 2020 17:39:04 +0000 (18:39 +0100)]
Fix typo in function name
(cherry picked from commit
bc130b6858327b382b07b3985cf48e2aa9016b2d)
Lennart Poettering [Wed, 22 Jan 2020 16:07:47 +0000 (17:07 +0100)]
polkit: when authorizing via PK let's re-resolve callback/userdata instead of caching it
Previously, when doing an async PK query we'd store the original
callback/userdata pair and call it again after the PK request is
complete. This is problematic, since PK queries might be slow and in the
meantime the userdata might be released and re-acquired. Let's avoid
this by always traversing through the message handlers so that we always
re-resolve the callback and userdata pair and thus can be sure it's
up-to-date and properly valid.
(cherry picked from commit
637486261528e8aa3da9f26a4487dc254f4b7abb)
Lennart Poettering [Wed, 22 Jan 2020 16:05:17 +0000 (17:05 +0100)]
sd-bus: introduce API for re-enqueuing incoming messages
When authorizing via PolicyKit we want to process incoming method calls
twice: once to process and figure out that we need PK authentication,
and a second time after we aquired PK authentication to actually execute
the operation. With this new call sd_bus_enqueue_for_read() we have a
way to put an incoming message back into the read queue for this
purpose.
This might have other uses too, for example debugging.
(cherry picked from commit
1068447e6954dc6ce52f099ed174c442cb89ed54)
zjs: patch modified to not make the function public
Lennart Poettering [Wed, 22 Jan 2020 15:53:59 +0000 (16:53 +0100)]
polkit: use structured initialization
(cherry picked from commit
f4425c72c7395ec93ae00052916a66e2f60f200b)
Lennart Poettering [Wed, 22 Jan 2020 15:52:10 +0000 (16:52 +0100)]
polkit: on async pk requests, re-validate action/details
When we do an async pk request, let's store which action/details we used
for the original request, and when we are called for the second time,
let's compare. If the action/details changed, let's not allow the access
to go through.
(cherry picked from commit
7f56982289275ce84e20f0554475864953e6aaab)
Lennart Poettering [Wed, 22 Jan 2020 15:44:43 +0000 (16:44 +0100)]
polkit: reuse some common bus message appending code
(cherry picked from commit
95f82ae9d774f3508ce89dcbdd0714ef7385df59)
Lennart Poettering [Wed, 22 Jan 2020 13:29:43 +0000 (14:29 +0100)]
bus-polkit: rename return error parameter to ret_error
(cherry picked from commit
773b1a7916bfce3aa2a21ecf534d475032e8528e)
Lennart Poettering [Wed, 22 Jan 2020 10:39:22 +0000 (11:39 +0100)]
shared: split out polkit stuff from bus-util.c → bus-polkit.c
It's enough, complex stuff to warrant its own source file.
No other changes, just splitting out.
(cherry picked from commit
269e4d2d6b75329ae39a71ebe2c14500e03cda95)
Frantisek Sumsal [Tue, 4 Feb 2020 12:49:01 +0000 (13:49 +0100)]
test: adapt to the new capsh format
Since libcap v2.29 the format of cap_to_text() has been changed which
makes certain `test-execute` subtest fail. Let's remove the offending
part of the output (dropped capabilities) to make it compatible with
both the old and the new libcap.
(cherry picked from commit
9569e385036c05c0bf9fbccdbf3d131161398e2e)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Feb 2020 19:38:54 +0000 (20:38 +0100)]
meson: update efi path detection to gnu-efi-3.0.11
Fixes systemd build in Fedora rawhide.
The old ldsdir option is not useful, because both the directory and the
file name changed. Let's remove the option and try to autodetect the file
name. If this turns out to be not enough, a new option to simply specify
the full path to the file can be added.
F31:
efi arch: x86_64
EFI machine type: x64
EFI CC ccache cc
EFI lds: /usr/lib64/gnuefi/elf_x64_efi.lds
EFI crt0: /usr/lib64/gnuefi/crt0-efi-x64.o
EFI include directory: /usr/include/efi
F32:
efi arch: x86_64
EFI machine type: x64
EFI CC ccache cc
EFI lds: /usr/lib/gnuefi/x64/efi.lds
EFI crt0: /usr/lib/gnuefi/x64/crt0.o
EFI include directory: /usr/include/efi
(cherry picked from commit
ce4121c6ff92c1c368874bd451b73fa9b1ddec4a)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Feb 2020 14:45:07 +0000 (15:45 +0100)]
presets: "disable" all passive targets by default
Officially we default to a "enable *", even though pretty much everybody
overrides this with "disable *". We have a bunch of targets and services which
should not be enabled by default. In case the default policy is not overriden,
our passive units would be enabled by presets, which is generally not useful at
all. So let's explicitly mark them as disabled.
Note that this effectively changes very little. E.g. on Fedora, all the units
listed in this patch were "disabled" already.
Fixes #14648.
(cherry picked from commit
61c3e2c8bfc28cea5b52d8643fac3d85f4c571d2)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2020 14:53:57 +0000 (15:53 +0100)]
shared/sysctl-util: normalize repeated slashes or dots to a single value
We use those strings as hash keys. While writing "a...b" looks strange,
"a///b" does not look so strange. Both syntaxes would actually result in the
value being correctly written to the file, but they would confuse our
de-deplication over keys. So let's normalize. Output also becomes nicer.
Add test.
(cherry picked from commit
f3b136a4847a0993e2dc1197779160dca4da6dac)
Yu Watanabe [Thu, 30 Jan 2020 11:18:35 +0000 (20:18 +0900)]
dhcp6: do not use T1 and T2 longer than one provided by the lease
Fixes #12623.
(cherry picked from commit
9de8a4259eaebf4635142474e016b90ce5be5181)
Yu Watanabe [Wed, 29 Jan 2020 11:39:12 +0000 (20:39 +0900)]
network: fix implicit type conversion warning by GCC-10
Fixes part of #14691.
(cherry picked from commit
a44956c94a93fe34b5398ed9aefcf0fc705d4fa6)
Yu Watanabe [Sun, 26 Jan 2020 04:05:13 +0000 (13:05 +0900)]
bootspec: parse random-seed-mode line in loader.conf
Fixes #14657.
(cherry picked from commit
fe5a698f7646735335a97cc429ebe5d79f67fb70)
Yu Watanabe [Sun, 26 Jan 2020 03:59:48 +0000 (12:59 +0900)]
sd-boot: fix typo
Fixes #14657.
(cherry picked from commit
a14c18ba7b4e85f34bd48c5a778ea5eafe5c8688)
dann frazier [Tue, 28 Jan 2020 01:45:17 +0000 (18:45 -0700)]
test: Synchronize journal before reading from it
There's a race condition in the sysuser test where it may try to read
entries from the journal before they are available. Fix it by adding a
`journalctl --sync` call.
BugLink: https://bugs.launchpad.net/bugs/1776654
(cherry picked from commit
37b9966e2525790843ab302a5b8009853a7905a0)
sangelovic [Mon, 27 Jan 2020 20:40:37 +0000 (21:40 +0100)]
sd-bus: fix introspection bug in signal parameter names
(cherry picked from commit
58abbbcc6bcedc4eebd1f5c7733cd41518e1f2e3)
Susant Sahani [Sat, 25 Jan 2020 10:30:08 +0000 (11:30 +0100)]
efi: fix build.
```
ninja -C build
ninja: Entering directory `build'
[29/101] Generating systemd_boot.so with a custom command.
FAILED: src/boot/efi/systemd_boot.so
/usr/bin/ld -o src/boot/efi/systemd_boot.so -T /usr/lib64/gnuefi/elf_x64_efi.lds -shared -Bsymbolic -nostdlib -znocombreloc -L /usr/lib64 /usr/lib64/gnuefi/crt0-efi-x64.o src/boot/efi/disk.c.o src/boot/efi/graphics.c.o src/boot/efi/measure.c.o src/boot/efi/pe.c.o src/boot/efi/util.c.o src/boot/efi/boot.c.o src/boot/efi/console.c.o src/boot/efi/crc32.c.o src/boot/efi/random-seed.c.o src/boot/efi/sha256.c.o src/boot/efi/shim.c.o -lefi -lgnuefi /usr/lib/gcc/x86_64-redhat-linux/10/libgcc.a
/usr/bin/ld: src/boot/efi/graphics.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/pe.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/util.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/boot.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/console.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/random-seed.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/shim.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
[31/101] Generating stub.c.o with a custom command.
ninja: build stopped: subcommand failed.
make: *** [Makefile:2: all] Error 1
```
(cherry picked from commit
8bdda551dab5579a14db1d66f34356d45d5cda16)
Lennart Poettering [Tue, 21 Jan 2020 09:40:18 +0000 (10:40 +0100)]
generator: order growfs for the root fs after systemd-remount-fs
Fixes: #14603
(cherry picked from commit
18e6e8635f06ac8d935ed5494ea65c6dac6af90f)
Lennart Poettering [Tue, 21 Jan 2020 12:43:04 +0000 (13:43 +0100)]
loginctl: use /org/freedesktop/login1/session/auto when "lock-session" is called without argument
This way we'll use the "display" session automatically, and that makes
the call work when invoked from user@.service.
Fixes: #13614
(cherry picked from commit
dc084399fad28cc98e7bcdb9074141c97e863bee)
Antonio Russo [Tue, 21 Jan 2020 02:35:13 +0000 (19:35 -0700)]
Documentation update for x-systemd.{before,after}
A minor clarification in the manual page is made.
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
(cherry picked from commit
81248e7f3e83a24cbbc8d2a09a01abf55e81bcda)
Andreas Rammhold [Tue, 21 Jan 2020 17:22:22 +0000 (18:22 +0100)]
man: fix typo in systemd.netdev Xfrm example
The first section header in that example should probably be `[NetDev]` and not `[Xfrm]`.
(cherry picked from commit
a15e1a5df0c943ec5414014e54719bd1259fd00a)
Lennart Poettering [Tue, 21 Jan 2020 11:03:02 +0000 (12:03 +0100)]
timesyncd: log louder when we refuse a server due to root distance
This is something people should know about, since it's caused by
misconfiguration.
Fixes: #13912
(cherry picked from commit
ce96c9cb1a8f81ff4bbc40f5a98d003d6ffacb57)
Lennart Poettering [Mon, 20 Jan 2020 16:11:31 +0000 (17:11 +0100)]
resolved: drop DNSSEC root key that is not valid anymore
I guess we can drop this now, the key is no longer valid until
2019-01-11, hence there's no point in still including it in our trust
anchor.
(cherry picked from commit
f1f20764f9e52d6825867b2852206ed6cfcabbb9)
Lennart Poettering [Tue, 21 Jan 2020 09:49:58 +0000 (10:49 +0100)]
journal: don't use startswith() on something that is not a NUL-terminated string
Otherwise we might access memory coming after it that is not valid or
allocated.
Fixes: #14114
(cherry picked from commit
e0567bc8adfe027052b78b40efb57d543924f138)
Lennart Poettering [Mon, 20 Jan 2020 13:40:44 +0000 (14:40 +0100)]
test: add test for https://github.com/systemd/systemd/issues/14560
(cherry picked from commit
e56a8790a0bf9021d693daef037cd6af85badf0d)
Lennart Poettering [Fri, 17 Jan 2020 11:41:53 +0000 (12:41 +0100)]
core: make sure StandardInput=file: doesn't get dup'ed to stdout/stderr by default
Fixes: #14560
(cherry picked from commit
3b7f79dc9fc5557074ebe4a3b060e8dcf8cdcc0f)
Sascha Dewald [Sat, 18 Jan 2020 08:17:57 +0000 (08:17 +0000)]
pkgconf: add full generator paths
(cherry picked from commit
fc57f105d9e2b2e9e95bb739d23fa7711b5fa4b3)
Lennart Poettering [Fri, 17 Jan 2020 14:37:56 +0000 (15:37 +0100)]
tree-wide: we forgot to destroy some bus errors
(cherry picked from commit
7e284b054ec599012f0dad6a745f6b52eba87853)
Lennart Poettering [Fri, 17 Jan 2020 14:09:01 +0000 (15:09 +0100)]
mount: make checks on perpetual mount units more lax
We don#t really care where perpetual mounts are mounted from, since they
have to exist since before we run anyway.
(cherry picked from commit
0879fbd6fedc2f813aebcb1a4eba005a99525bde)
Lennart Poettering [Fri, 17 Jan 2020 14:02:13 +0000 (15:02 +0100)]
core: never allow perpetual units to be masked
Fixes: #14550
(cherry picked from commit
88414eed6f45f738ae765d9f72d67c6dc5a51950)
Wieland Hoffmann [Sat, 18 Jan 2020 07:38:29 +0000 (08:38 +0100)]
typo: "May modify to" -> "May modify"
(cherry picked from commit
287cf2d802263c909553689869b2146c67bb765f)
Arian van Putten [Wed, 15 Jan 2020 16:10:11 +0000 (17:10 +0100)]
Disable reading SystemdOptions EFI Var when in SecureBoot mode
In SecureBoot mode this is probably not what you want. As your cmdline
is cryptographically signed like when using Type #2 EFI Unified Kernel
Images (https://systemd.io/BOOT_LOADER_SPECIFICATION/) The user's
intention is then that the cmdline should not be modified. You want to
make sure that the system starts up as exactly specified in the signed
artifact.
(cherry picked from commit
c7d26acce6dcb0e72be6160873fac758e9b7c440)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2020 13:45:28 +0000 (14:45 +0100)]
sysctl: downgrade message when we have no permission
We need to run sysctl also in containers, because the network
subtree is namespaces and may legitimately be writable. But logging
all "errors" at notice level creates unwanted noise.
Also downgrade message about missing sysctls to log_info. This might also be
relatively common when configuration is targeted at different kernel
versions. With log_debug it'll still end up in the logs, but isn't really worth
of "notice" most of the time.
https://bugzilla.redhat.com/show_bug.cgi?id=
1609806
(cherry picked from commit
32458cc9687c1b60ff0f22c0e71da93ce78b1534)
Luca Boccassi [Thu, 16 Jan 2020 16:24:07 +0000 (16:24 +0000)]
Clarify journald.conf MaxLevelStore documentation
'stored on disk' gives the impression that this option affects only
permanent storage, even though it affects everything the journal
records, regardless of the storage type.
Use 'stored in the journal' to avoid confusion.
(cherry picked from commit
c97ae2b29036af29480ee506a072525917f5d41f)
Lennart Poettering [Mon, 6 Jan 2020 19:13:16 +0000 (20:13 +0100)]
logind: refuse overriding idle hint on tty sessions
Previously we'd allow marking TTY sessions as idle, but when the user
tried to unmark it as idle again it we'd just revert to automatic TTY
atime idle detection, thus making it impossible to mark the session as
non-idle, unless its TTY is atime-touched all the time. But of course,
marking a session as idle is pretty much fatal if you never can mark it
as non-idle again.
This change is triggred by bug reports such as this:
https://github.com/systemd/systemd/issues/14053
With this patch we will now output a clean, clear error message if a
client tries to manipulate the idle state of a non-graphical session.
This means we now have clear rules: "manual" idle logic for graphical
sessions, and TTY based ones for all others that have a TTY of some
form.
I considered allowing the idle state to be overriden both ways for tty
sessions but that's problematic: for sessions that are temporarily
upgraded from tty to graphical and thus suddenly want to manage their
own idle state we'd need to a way to detect when the upgrade goes away
and thus we should revert to old behaviour. Without reverting to the
previous TTY idle auto-magic we'd otherwise be stuck in an eternally
idle or eternally non-idle state, with really bad effects in case
auto-suspend is used. Thus, let's instead generate a proper error
message, saying clearly we don't support it.
(Also includes some other fixes and clean-ups in related code)
Closes: #14053
(cherry picked from commit
be2bb14f00441d9e4a26f94834518db3829e83ed)
Lennart Poettering [Mon, 13 Jan 2020 19:06:39 +0000 (20:06 +0100)]
cgroup: update only siblings that got realized once
Fixes: #14475
Replaces: #14554
(cherry picked from commit
e1e98911a818ad3b46c6a1c26d759df590bef476)
Jun'ichi Nomura [Tue, 3 Dec 2019 07:52:02 +0000 (16:52 +0900)]
mount: mark an existing "mounting" unit from /proc/self/mountinfo as "just_mounted"
When starting a mount unit, systemd invokes mount command and moves the
unit's internal state to "mounting". Then it watches for updates of
/proc/self/mountinfo. When the expected mount entry newly appears in
mountinfo, the unit internal state is changed to "mounting-done".
Finally, when systemd finds the mount command has finished, it checks
whether the unit internal state is "mounting-done" and changes the state
to "mounted".
If the state was not "mounting-done" in the last step though mount command
was successfully finished, the unit is marked as "failed" with following
log messages:
Mount process finished, but there is no mount.
Failed with result 'protocol'.
If daemon-reload is done in parallel with starting mount unit, it is
possible that things happen in following order and result in above failure.
1. the mount unit state changes to "mounting"
2. daemon-reload saves the unit state
3. kernel completes the mount and /proc/self/mountinfo is updated
4. daemon-reload restores the saved unit state, that is "mounting"
5. systemd notices the mount command has finished but the unit state
is still "mounting" though it should be "mounting-done"
mount_setup_existing_unit() should take into account that MOUNT_MOUNTING
is transitional state and set MOUNT_PROC_JUST_MOUNTED flag if the unit
comes from /proc/self/mountinfo so that mount_process_proc_self_mountinfo()
later can make state transition from "mounting" to "mounting-done".
Fixes: #10872
(cherry picked from commit
1d086a6e59729635396204fc05234f1d3caa0847)
Timo Schlüßler [Mon, 13 Jan 2020 09:26:58 +0000 (09:26 +0000)]
journalctl: Correctly handle combination of --reverse and --lines (fixes #1596)
(cherry picked from commit
23b392166388003530fef02ac5758c91315a707b)
Timo Schlüßler [Mon, 13 Jan 2020 09:09:45 +0000 (09:09 +0000)]
journalctl: Correctly handle --show-cursor in combination with --until or --since and --reverse
(cherry picked from commit
3ac9cac7f7a34c3713b49841ee75ef9c9357e7e4)
Lennart Poettering [Thu, 9 Jan 2020 16:30:31 +0000 (17:30 +0100)]
core: fix re-realization of cgroup siblings
This is a fix-up for
eef85c4a3f8054d29383a176f6cebd1ef3a15b9a which
broke this.
Tracked down by @w-simon
Fixes: #14453
(cherry picked from commit
65f6b6bdcb500c576674b5838e4cc4c35e18bfde)
Lennart Poettering [Thu, 9 Jan 2020 10:51:40 +0000 (11:51 +0100)]
core: propagate service state to socket in more load states
It makes sense to filter state changes for some load states that
shouldn't happen, but the common cases should be accepted, because they
might happen during runtime when "systemctl daemon-reload" is issued and
unit files changed state in between. Otherwise we lose events.
Fixes: #4708
(cherry picked from commit
4c2ef3276735ad9f7fccf33f5bdcbe7d8751e7ec)
HATAYAMA Daisuke [Wed, 18 Dec 2019 03:01:42 +0000 (22:01 -0500)]
man: describe "symlink" and "systemctl link" explicitly in UNIT FILE LOAD PATH
There are sometimes users who put unit files in a location that is inaccessible
when systemd starts although they are not found and thus not started because
the corresponding mount units have not activated yet.
There is already a warning for such issue in man 8 systemctl:
link PATH...
...<snip>...
The file system where
the linked unit files are located must be accessible
when systemd is started (e.g. anything underneath /home
or /var is not allowed, unless those directories are
located on the root file system).
However, it looks that it's difficult to find the warning because introductory
users typically doesn't know systemctl link.
Although there is a description in UNIT FILE LOAD PATH pointing to systemctl
link, symlink is now not explicitly mentioned there and thus users doesn't
easily get aware of they should read it.
To deal with this, let's describe "symlink" and "systemctl link" more
explicitly in UNIT FILE LOAD PATH.
(cherry picked from commit
b63c88b6271804e4770a14d94c66210e0c8063d7)
Lennart Poettering [Thu, 9 Jan 2020 11:01:45 +0000 (12:01 +0100)]
core: be more restrictive on the dependency types we allow to be created transiently
We should allow the ones that the [Unit] section of regular unit files
may accet, but no other, in particular not the internal deps we
synthesize as reverse of explicitly configured ones, such was WantedBy=.
Fixes: #14251
(cherry picked from commit
404308486aa285c67c5af4c8e7d6be393ce5a3c7)
Thomas Schmitt [Mon, 6 Jan 2020 07:10:32 +0000 (15:10 +0800)]
udev: don't import parent ID_FS_ data on partitions
When probing partitions, we inherit important information from the parent
disk device such as ID_MODEL, and usage of such properties is seen to
be acceptable and well established.
However, we need to exclude filesystem information from the properties
that get inherited. Information about the device content should not be
passed on in this way.
For example, Linux distro install media commonly uses an ISO filesystem
plus a partition table. The ISO filesystem is detected on the main disk
device, but we should not pass down those details to the partitions,
some or all of which may be pointing at storage areas completely distinct
from the ISO filesystem.
This is particularly problematic when adding new partitions on media
set up in this way (since the new partitions are then reported to contain
the parent device's ISO filesystem), or when dealing with more unusual
hybrid ISO layouts. The inaccuracy of information here inversely affects
users of blkid and udev's persistent storage symlinks.
Exclude ID_FS_* properties from the inheritance chain to avoid these
problems.
Fixes: #14408
(cherry picked from commit
19212f27816686a5cac2c965301cea8624ac467f)
Zbigniew Jędrzejewski-Szmek [Wed, 8 Jan 2020 09:39:44 +0000 (10:39 +0100)]
man: fix option name
(cherry picked from commit
95522092925ac7b3526211c9c0c35b5722b43e95)
ezst036 [Wed, 8 Jan 2020 00:47:15 +0000 (19:47 -0500)]
Support Plugable UD-PRO8 dock
Add support for Plugable Pro8 docking station for auto-configuring seat
(cherry picked from commit
95f2b4dd237faa57fd3e93245d560e47cdedfc2c)
Lennart Poettering [Tue, 7 Jan 2020 16:21:24 +0000 (17:21 +0100)]
gpt-auto: don't assume XBOOTLDR is vfat
Let's not assume "umask=" is a valid mount option for XBOOTLDR
partitions unconditionally.
Fixes: #14165
(cherry picked from commit
4f0840669e172a2570b17b0991459d3a6839f804)
Lennart Poettering [Tue, 7 Jan 2020 17:02:15 +0000 (18:02 +0100)]
man: fix documentation of IBM VIO device naming
We generate "v" in two different ways, and they got mixed up.
(cherry picked from commit
a1686563ded4cb6967034a59a61a50534c952dad)
Lennart Poettering [Tue, 7 Jan 2020 17:01:56 +0000 (18:01 +0100)]
man: slightly extend documentation on difference between ID_NET_NAME_ONBOARD and ID_NET_LABEL_ONBOARD
(cherry picked from commit
e232c307c052c85825e5017be868e1bd6bf4f97a)
Lennart Poettering [Tue, 7 Jan 2020 14:20:32 +0000 (15:20 +0100)]
boot: fix osrel parser
let's check VERSION instead of VERSION_ID where appropriate.
Fixes: #14493
(cherry picked from commit
4353974d75940352486bac21b877a598e70558d5)
Yu Watanabe [Tue, 7 Jan 2020 10:22:59 +0000 (19:22 +0900)]
udev: do not use exact match of file permission
This partially reverts
25de7aa7b90c23d33ea50ada1e50c5834a414237.
Fixes #14473.
(cherry picked from commit
7a182f10343796eab92a8256e347c11b4be78ea7)
Yu Watanabe [Mon, 6 Jan 2020 07:48:27 +0000 (16:48 +0900)]
network: lower the log-level of harmless message
Closes #14285.
(cherry picked from commit
d6246fd498ab0e4a9a78bcfd4cc1625af16f4784)
Zbigniew Jędrzejewski-Szmek [Thu, 19 Dec 2019 10:48:46 +0000 (11:48 +0100)]
hwdb: ignore keys added in kernel 5.5
python-evdev needs to be rebuilt with new kernel headers. Before that
happens, our test would reject those keys as unknown.
(cherry picked from commit
12c7d4d65e4fbc95b2f76853bdcf4fdc554d5c11)
Frantisek Sumsal [Sat, 28 Dec 2019 11:29:19 +0000 (12:29 +0100)]
systemctl: skip non-existent units in the 'cat' verb
When processing list of units (either provided manually or as a
wildcard), let's skip units for which we don't have an on-disk
counterpart, but note the -ENOENT error code and propagate it back to
the user.
Fixes: #14082
(cherry picked from commit
a25457f5b7689265bd2235c4da218896e7c5c1d0)
Topi Miettinen [Sat, 28 Dec 2019 17:38:27 +0000 (19:38 +0200)]
systemd.exec: document the file system for EnvironmentFile paths
Files specified with EnvironmentFile are read from PID1 mount namespace, before
any file system operations like RootImage or BindPaths are in effect.
(cherry picked from commit
412a6c646ced41ac9b12c4a4f97e34c0350e1040)
Tobias Stoeckmann [Tue, 31 Dec 2019 12:56:02 +0000 (13:56 +0100)]
systemd-analyze: fixed typo in documentation
The example shows the output of critical-chain, which means
that the title is wrong.
(cherry picked from commit
be78e0f07b2379f51e6530269be953c0b520c447)
Felipe Sateler [Tue, 24 Dec 2019 01:04:44 +0000 (22:04 -0300)]
test-condition: fix group check condition
We were checking the uid, whereas we should have checked the gid
(cherry picked from commit
98cd752a285c0fba84b8d98f3ba255ed4d11c881)
Lennart Poettering [Fri, 20 Dec 2019 15:59:42 +0000 (16:59 +0100)]
umount: show correct error message
We fucked up errno vs. r two times, let's correct that.
While we are at it, let's handle the error first, like we usually do,
and the clean case without indentation.
(cherry picked from commit
88287615e631d2023ff337a08b6ff45b1cfa58ee)
Lennart Poettering [Fri, 20 Dec 2019 11:26:17 +0000 (12:26 +0100)]
Revert "Drop dbus activation stub service"
This reverts commit
07125d24eedb71693b3bf2b1f0730cd01aaac2dd.
In contrast to what is claimed in #13396 dbus-broker apparently does
care for the service file to be around, and otherwise will claim
"Service Not Activatable" in the time between systemd starting up the
broker and connecting to it, which the stub service file is supposed to
make go away.
Reverting this makes the integration test suite pass again on host with
dbus-broker (i.e. current Fedora desktop).
Tested with dbus-broker-21-6.fc31.x86_64.
(cherry picked from commit
b895fa08e6809ab54e20888f7d01ae848272e981)
Zbigniew Jędrzejewski-Szmek [Wed, 18 Dec 2019 10:23:30 +0000 (11:23 +0100)]
man: add section about user manager units
(cherry picked from commit
277519db51291c7e11b2120016c39914520f5009)
Zbigniew Jędrzejewski-Szmek [Wed, 18 Dec 2019 09:32:03 +0000 (10:32 +0100)]
man: add remote-*.targets to the bootup sequence
I think this makes it easier to see the difference between local and remote
mounts.
Make the graph a bit narrower while at it.
(cherry picked from commit
f71502c49fd9fce6328f9364f600578383551dce)
Lennart Poettering [Wed, 18 Dec 2019 13:57:11 +0000 (14:57 +0100)]
time-util: also use 32bit hack on EOVERFLOW
As per
https://github.com/systemd/systemd/issues/14362#issuecomment-
566722686
let's also prepare for EOVERFLOW.
(cherry picked from commit
9e7c8f64cfda101496f56f5546097221e8ad5d6a)
Anita Zhang [Thu, 19 Dec 2019 00:09:49 +0000 (16:09 -0800)]
[man] note which UID ranges will get user journals
Fixes #13926
(cherry picked from commit
a1533ad73f099ed7f2c01a69c23ad700fbf249f3)
Anita Zhang [Thu, 19 Dec 2019 00:08:53 +0000 (16:08 -0800)]
[man] fix URL
(cherry picked from commit
d59fc29bb742e4258dab0606ab1a95cfaa1ea473)
Topi Miettinen [Wed, 18 Dec 2019 18:25:03 +0000 (20:25 +0200)]
analyze: badness if neither of RootImage and RootDirectory exists
Instead of requiring both RootImage and RootDirectory directives, give badness
points if neither is present. Fixes conversion in
d737b451f.
(cherry picked from commit
d909b40fda52d6822a0f7201f9c17818df2bd091)
Yu Watanabe [Sat, 7 Dec 2019 15:32:36 +0000 (00:32 +0900)]
network: introduce AddPrefixRoute= and deprecate PrefixRoute=
PrefixRoute= was added by
e63be0847c39bfdca45c25c505922814374581a7,
but unfortunately, the meaning of PrefixRoute= is inverted; when true
IFA_F_NOPREFIXROUTE flag is added. This introduces AddPrefixRoute=
setting.
(cherry picked from commit
de697db05b08464180af4a257f6df88b00d60b9e)
Topi Miettinen [Tue, 17 Dec 2019 13:47:37 +0000 (15:47 +0200)]
shared/dropin: fix assert for invalid drop-in
Don't try to show top level drop-in for non-existent units or when trying to
instantiate non-instantiated units:
$ systemctl cat nonexistent@.service
Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting.
$ systemctl cat systemd-journald@.service
Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting.
(cherry picked from commit
7a670b1dd981c645064f69faf85b04620aadbafb)
Dimitri John Ledkov [Fri, 13 Dec 2019 23:22:51 +0000 (23:22 +0000)]
initrd: make udev cleanup service confict trigger and settle too
Otherwise, systemd-udev-trigger|settle.service that ran in the initrd may
ramain active, and never re-run again from the system root.
This is observed by forexample examining ESP with udevadm info, which in the
initrd has all the ID_* variables, and none of them in fully booted system.
(cherry picked from commit
f27bb6abd3b825034e0dde631ae3047128d2162d)
Lennart Poettering [Tue, 17 Dec 2019 16:30:55 +0000 (17:30 +0100)]
man: we support growing xfs too these days
(cherry picked from commit
76b73ce21c0a4063696bd7c777ae12d99cd8fb69)
Lennart Poettering [Tue, 17 Dec 2019 10:22:17 +0000 (11:22 +0100)]
time-util: deal with systems where userspace has 64bit time_t but kernel does not
Fixes: #14362
(cherry picked from commit
601f91bec5646a9c6fbd4f1ec5f1b4ae28d3a770)
Anita Zhang [Tue, 17 Dec 2019 09:08:04 +0000 (01:08 -0800)]
[import] fix stdin/stdout pipe behavior in import/export tar/raw
The code existed in machinectl to use stdin/stdout if the path for
import/export tar/raw was empty or dash (-) but a check to
`fd_verify_regular` in importd prevented it from working.
Update the check instead to explicitly check for regular file or
pipe/fifo.
Fixes #14346
(cherry picked from commit
1209ef94bd09bdc67a7b51f084910a5982f2f010)
Bart Willems [Mon, 16 Dec 2019 15:45:59 +0000 (16:45 +0100)]
systemctl: show what verbs support --dry-run in the help page
Signed-off-by: Bart Willems <bwillems@protonmail.com>
(cherry picked from commit
4afb4a9cc574caccb1bca1de0e4012fd0ac37128)
Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2019 15:06:47 +0000 (16:06 +0100)]
cryptsetup-generator: unconfuse writing of the device timeout
The code was using timeout=0 as the default option string. This option string
was ultimately passed to generator_write_timeouts(), which only looks for
comment=systemd.device-timeout= or x-systemd.device-timeout=, i.e. the whole
call path was bogus. Let's rework this: generator_write_timeouts() now writes
any timeouts if configured by the user. create_disk() writes out it's own
timeout, but with lower priority. Since the code path that was calling
timeout=0 was not effective, the only change is that we stop overwriting the
timeout if explicitly configured by the user.
In both code paths, ignore failure to write.
(cherry picked from commit
7cecc563163f539c497ecdf5ab00729fcd8c97c1)
Zbigniew Jędrzejewski-Szmek [Fri, 13 Dec 2019 18:25:50 +0000 (19:25 +0100)]
shared/install: log syntax error for invalid DefaultInstance=
Ideally, we would want to report this over back over dbus. But that is pretty hard,
because the unitfile parsing logic doesn't provide any feedback.
systemd-analyze verify also doesn't notice the issue, because it doesn't look
at the [Install] section at all. Let's print a message in the logs at least.
(cherry picked from commit
e51712963b817995781534975470f1b54171702b)
Zbigniew Jędrzejewski-Szmek [Fri, 13 Dec 2019 17:36:29 +0000 (18:36 +0100)]
shared/install: provide a nicer error message for invalid WantedBy=/Required= values
$ build/systemctl --user cat badinstall
# /home/zbyszek/.config/systemd/user/badinstall.service
[Service]
ExecStart=true
[Install]
WantedBy=asdf
$ build/systemctl --user enable badinstall
Failed to enable unit: "asdf" is not a valid unit name.
Fixes #4209.
(cherry picked from commit
d7ceaf72618aa2466fc4465ce8fcebf0cba68cc1)
Dan Streetman [Tue, 29 Oct 2019 14:31:58 +0000 (10:31 -0400)]
network: set ipv6 mtu after link-up or device mtu change
The kernel resets the ipv6 mtu after NETDEV_UP or NETDEV_CHANGEMTU event,
so we must reset the ipv6 mtu to our configured value after we detect
IFF_UP flag set or after we set the device mtu.
Fixes: #13914.
(cherry picked from commit
d236718c167af46bbf4460fc6b82db8396bd43a5)
Lennart Poettering [Wed, 11 Dec 2019 10:52:00 +0000 (11:52 +0100)]
man: fix typo in net-naming-scheme man page
(cherry picked from commit
955ed5d540fe090687e085d894381f6bf0e57688)
Yu Watanabe [Wed, 11 Dec 2019 11:09:11 +0000 (20:09 +0900)]
network: tc: drop unused element
(cherry picked from commit
1f9dd3bfdf0a44e919f35b0e101fa2b5687952b5)
cheese1 [Wed, 11 Dec 2019 09:33:13 +0000 (10:33 +0100)]
man: fix typos (#14304)
(cherry picked from commit
f32d15b0e4f5a0d2c31b22cb66f690a158ae9dfd)
AJ Bagwell [Tue, 10 Dec 2019 16:27:31 +0000 (16:27 +0000)]
ipv4ll: do not reset conflict counter on restart
Don't reset the conflict counter when trying a new pseudo random
address, so that after trying 10 addresses the londer timeout is used in
accordance with the RFC
Fixes #14299.
(cherry picked from commit
e92b60b20f21111a0c28135c1b5c78fc851a4f15)
Lennart Poettering [Mon, 9 Dec 2019 17:24:41 +0000 (18:24 +0100)]
macro: avoid subtraction overflow in ALIGN_POWER2()
(cherry picked from commit
85c267afa7ce4697a1231649de815b2556b3950f)
Yu Watanabe [Sun, 8 Dec 2019 10:54:49 +0000 (19:54 +0900)]
test-network: add a test case for SendOption=
(cherry picked from commit
0810e6d787bd2675630aba94a08f0da7498b3966)
Yu Watanabe [Sun, 8 Dec 2019 10:54:20 +0000 (19:54 +0900)]
network: fix segfault in parsing SendOption=
Fixes #14283.
(cherry picked from commit
83b56c70e6bcca3359b26197a7463e4c22868df1)
Mike Gilbert [Fri, 6 Dec 2019 19:28:13 +0000 (14:28 -0500)]
seccomp: real syscall numbers are >= 0
Real syscall numbers start at 0. The fake seccomp values seem to be
strictly less than 0.
Fixes:
4df8fe8415eaf4abd5b93c3447452547c6ea9e5f
(cherry picked from commit
fb4b0465abbd96e6d342e5606c61c919c99a82ff)
Yu Watanabe [Sat, 7 Dec 2019 14:20:37 +0000 (23:20 +0900)]
network: fix copy and paste mistake
(cherry picked from commit
6d62ec61b9413a78757c758a940cef13f6ce5063)
Yu Watanabe [Thu, 5 Dec 2019 10:54:29 +0000 (19:54 +0900)]
network: do not drop foreign config if interface is in initialized state
If the interface is in initialized state, no network file is assigned to
the interface. If an interface is not managed by networkd, previously,
the foreign configs of the interface was dropped.
Fixes #14250.
(cherry picked from commit
2c7b826ddf52bd09956815dd8e52329e62ce985a)
Christian Ehrhardt [Wed, 4 Dec 2019 10:44:32 +0000 (11:44 +0100)]
seccomp: mmap test results depend on kernel/libseccomp/glibc
Like with shmat already the actual results of the test
test_memory_deny_write_execute_mmap depend on kernel/libseccomp/glibc
of the platform it is running on.
There are known-good platforms, but on the others do not assert success
(which implies test has actually failed as no seccomp blocking was achieved),
but instead make the check dependent to the success of the mmap call
on that platforms.
Finally the assert of the munmap on that valid pointer should return ==0,
so that is what the check should be for in case of p != MAP_FAILED.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
(cherry picked from commit
49219b5c2a654ee6639887aa21a78b41da0576f1)
Christian Ehrhardt [Wed, 27 Nov 2019 09:53:50 +0000 (10:53 +0100)]
seccomp: use per arch shmat_syscall
At the beginning of seccomp_memory_deny_write_execute architectures
can set individual filter_syscall, block_syscall, shmat_syscall values.
The former two are then used in the call to add_seccomp_syscall_filter
but shmat_syscall is not.
Right now all shmat_syscall values are the same, so the change is a
no-op, but if ever an architecture is added/modified this would be a
subtle source for a mistake so fix it by using shmat_syscall later.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
(cherry picked from commit
5ef3ed97e3c718be790b1f38928ca66cb68250a8)
Christian Ehrhardt [Wed, 27 Nov 2019 08:57:55 +0000 (09:57 +0100)]
seccomp: ensure rules are loaded in seccomp_memory_deny_write_execute
If seccomp_memory_deny_write_execute was fatally failing to load rules it
already returned a bad retval.
But if any adding filters failed it skipped the subsequent seccomp_load and
always returned an rc of 0 even if no rule was loaded at all.
Lets fix this requiring to (non fatally-failing) load at least one rule set.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
(cherry picked from commit
903659e7b242c3cc897e32835f1918d380b24e5f)
Christian Ehrhardt [Wed, 27 Nov 2019 08:52:07 +0000 (09:52 +0100)]
seccomp: fix multiplexed system calls
Since libseccomp 2.4.2 more architectures have shmat handled as multiplexed
call. Those will fail to be added due to seccomp_rule_add_exact failing
on them since they'd need to add multiple rules [1].
See the discussion at https://github.com/seccomp/libseccomp/issues/193
After discussions about the options rejected [2][3] the initial thought of
a fallback to the non '_exact' version of the seccomp rule adding the next
option is to handle those now affected (i386, s390, s390x) the same way as
ppc which ignores and does not block shmat.
[1]: https://github.com/seccomp/libseccomp/issues/193
[2]: https://github.com/systemd/systemd/pull/14167#issuecomment-
559136906
[3]: https://github.com/systemd/systemd/commit/
469830d1
(cherry picked from commit
bed4668d1daeb640c1d55e79e6a1725c81118e39)
Timo Wilken [Thu, 5 Dec 2019 18:36:57 +0000 (18:36 +0000)]
Fix typo (duplicate "or")
This fixes a double "or" in the text of `systemctl --help`.
(cherry picked from commit
ab4fae0c8c3fae4d3d67bf6e1176bbda1dfa208e)
Yu Watanabe [Wed, 4 Dec 2019 10:12:36 +0000 (19:12 +0900)]
network: if /sys is rw, then udev should be around
This switches detect_container() to path_is_read_only_rw("/sys"), as if
systemd-udevd.service is conditionalized with that way.
This also updates the log message.
(cherry picked from commit
bf331d87171b7750d1c72ab0b140a240c0cf32c3)
Yu Watanabe [Mon, 2 Dec 2019 15:51:44 +0000 (00:51 +0900)]
nspawn: do not fail if udev is not running
If /sys is read only filesystem, e.g., nspawn is running in container,
then usually udev is not running. In such a case, let's assume that
the interface is already initialized. Also, this makes nspawn refuse
to use the network interface which is under renaming.
Fixes #14223.
(cherry picked from commit
26208d5b9674079dcf2c9d301f09a7c7b23bfdc3)
Jérémy Rosen [Fri, 29 Nov 2019 19:28:35 +0000 (20:28 +0100)]
Create parent directories when creating systemd-private subdirs
This is needed when systemd is compiled without systemd-tmpfiles
(cherry picked from commit
a652f050a78616efb9e75c5b49c925400c64dded)
Yu Watanabe [Mon, 2 Dec 2019 15:29:44 +0000 (00:29 +0900)]
network: do not return error but return UINT64_MAX if speed meter is disabled
Fixes #14222.
(cherry picked from commit
e813de549b17f2601750c95825d8e0740cbee38c)
Topi Miettinen [Tue, 3 Dec 2019 18:36:37 +0000 (20:36 +0200)]
core: swap priority can be negative
Negative priorities are useful for swap targets which should be only used as
last resort.
(cherry picked from commit
7477451b691d288dad67b4c8ce9e519e9b75770d)