Yu Watanabe [Wed, 4 Aug 2021 18:14:41 +0000 (03:14 +0900)]
core: wrap cgroup path with empty_to_root() in log messages
This fixes e.g. the following log message:
---
systemd[1]: -.slice: Failed to migrate controller cgroups from , ignoring: Read-only file system
---
(cherry picked from commit
6178e2f88956e1900f445908ed053865cc22e879)
(cherry picked from commit
24a40953d3d6ad8b1429d19da2f66399ae3f7e0b)
Yu Watanabe [Wed, 4 Aug 2021 18:13:48 +0000 (03:13 +0900)]
core/cgroup: fix error handling of cg_remove_xattr()
(cherry picked from commit
0cddb53c85588fbfb8043f622895c7bd15819198)
(cherry picked from commit
7e79bfce0674c58068d2a125ed666986544e790f)
Yu Watanabe [Wed, 4 Aug 2021 09:16:44 +0000 (18:16 +0900)]
sd-netlink: always append new bridge FDB entries
This partially reverts
192a9d95ea3e058afd824d38a9cea16ad0a84a57 (#19432).
Fixes #20305.
(cherry picked from commit
74c1ab841fbad9d4f237c819577fcd1d46a072b6)
(cherry picked from commit
f65dedbb8f3bd8a0ec69a02f63f62f339a791423)
Michal Koutný [Fri, 12 Feb 2021 17:11:18 +0000 (18:11 +0100)]
mkosi: openSUSE update --bootable=no dependencies
Since we can build --bootable=no images without dracut->systemd, we need
to add systemd runtime dependencies explicitely.
(cherry picked from commit
f2bb8857cd093eb9bd5e1dad6fb996a0a4463556)
(cherry picked from commit
e4e572117b41f6e8152a30acc6f60a0385090137)
Zbigniew Jędrzejewski-Szmek [Sat, 31 Jul 2021 07:16:52 +0000 (09:16 +0200)]
man: describe veritysetup command syntax
It makes it easier to diagnose what the generated units actually do.
(cherry picked from commit
d53285d551d883bb9f097eca0942e8c585e33470)
(cherry picked from commit
e820d11a409ba93cf1634031fd363dde5e2b6a94)
Zbigniew Jędrzejewski-Szmek [Sat, 31 Jul 2021 07:00:11 +0000 (09:00 +0200)]
veritysetup: print help for --help/-h/help
In general our commands print help on --help, but here this would trigger
the error that two arguments are needed. Let's make this more user-friendly.
(cherry picked from commit
5d5e43cc33637a12f743f17294cfbd3ede08a1b3)
(cherry picked from commit
5e5923f272682476c053e5afd705e0f6b4595cbf)
David Seifert [Mon, 2 Aug 2021 14:09:10 +0000 (16:09 +0200)]
Use correct `<poll.h>` include
* `<sys/poll.h>` is not specified in POSIX
(cherry picked from commit
2b6c0bb2a341c95223ce672249e43c743b03d78c)
(cherry picked from commit
fba9fd963bb3b5fafdb123788b3fabe6ed0830c9)
David Seifert [Mon, 2 Aug 2021 10:41:38 +0000 (12:41 +0200)]
Use correct `<fcntl.h>` include
* `<sys/fcntl.h>` is not specified in POSIX
(cherry picked from commit
f8d54f7810aeea5ff27a5db03e1aab7ea54c8268)
(cherry picked from commit
cc94387e674c7db7b15efe56763fe6c87363f73d)
Frantisek Sumsal [Thu, 29 Jul 2021 16:44:51 +0000 (18:44 +0200)]
test: correctly detect ASan on s390x
s390x uses BRAS(L) instead of CALL(Q), e.g.:
```
1009528: c0 e5 ff ff f8 a0 brasl %r14,
1008668 <__asan_report_load1@plt>
10095f0: c0 e5 ff ff ea ec brasl %r14,
1006bc8 <__asan_stack_malloc_4@plt>
10097f8: c0 e5 ff ff f8 f8 brasl %r14,
10089e8 <__asan_report_load8@plt>
```
x86_64 for reference:
```
4011f3: e8 48 fe ff ff callq 401040 <__asan_report_load1@plt>
401227: e8 24 fe ff ff callq 401050 <__asan_report_load8@plt>
401251: e8 da fd ff ff callq 401030 <__asan_init@plt>
```
(cherry picked from commit
8bf79f05532162d19fe6ee211297cff81b4f9874)
(cherry picked from commit
02a744940e26a6ecf8778800a4317e9a8a474482)
Zbigniew Jędrzejewski-Szmek [Wed, 28 Jul 2021 10:57:10 +0000 (12:57 +0200)]
systemctl: allow set-property to be called with a glob pattern
We call "systemctl set-property … Markers=+needs-restart" and this should
also work for globs, e.g. "user@*.service" or "syncthing@*.service".
https://bugzilla.redhat.com/show_bug.cgi?id=
1986258
(cherry picked from commit
23a0ffa59f9cb26c4b016c9fd1a3a70da2607f61)
(cherry picked from commit
d334cc62101b8b8ea37d8458f90abc5a6136b315)
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jul 2021 07:42:09 +0000 (09:42 +0200)]
man/systemctl: rework descriptions of bind and mount-image
The text used "unit's view" to mean mount namespace. But we talk about
mount namespaces in the later part of the paragraph anyway, so trying to
use an "approachable term" only makes the whole thing harder to understand.
Let's use the precise term.
Some paragraph-breaking and re-indentation is done too.
(cherry picked from commit
e04eae5e1c43c050e0707d3fcfdc16691b761d61)
(cherry picked from commit
dcdfc4d9a77720d0432d0e587e41e96dc8b8542c)
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jul 2021 07:39:19 +0000 (09:39 +0200)]
man: use title of docs/ pages when referring to them
There is some inconsistency, partially caused by the awkward naming
of the docs/ pages. But let's be consistent and use the "official" title.
If we ever change plural↔singular, we should use the same form everywhere.
(cherry picked from commit
d6029680df7c4991e37662467668816a83c0b806)
(cherry picked from commit
77681242c8c6d7693814b8245e9096e43faa21be)
Zbigniew Jędrzejewski-Szmek [Tue, 27 Jul 2021 07:37:29 +0000 (09:37 +0200)]
man: fix assorted issues reported by the manpage-l10n project
Fixes #20297.
(cherry picked from commit
be0d27ee0c2a2cce39490b8cfc0e7d995fbd7644)
(cherry picked from commit
9eb9b07c404be8d59a800c70593809a69f0d0e55)
[Only the parts that were conflict-free: I think it's nice to fix errors, but
not important enough to devote actual work to it.]
Lennart Poettering [Tue, 27 Jul 2021 15:11:09 +0000 (17:11 +0200)]
seccomp: move sched_getaffinity() from @system-service to @default
See: https://github.com/systemd/systemd/pull/20191#issuecomment-
881982739
In general, we shouldn't blanket move syscalls like this into @default,
given that glibc actually does have fallbacks, afaics. However, as
long as the syscalls are "read-only" and thus benign, I figure it's a
safe thing to do. But we should probably stick to a "if in doubt, don't"
rule, and put these syscalls in @system-service as default, but not into
@default.
I think in the real world @system-service is the sensible group people
should use, and not @default actually.
(cherry picked from commit
7df660e45682af5c40a236abe1bdc5ddcf3b3533)
(cherry picked from commit
898949f71513da918c4aa94a0681fbc6b868e00f)
Lennart Poettering [Tue, 27 Jul 2021 15:10:21 +0000 (17:10 +0200)]
seccomp: drop getrandom() from @system-service
It's included in @default now, since
14f4b1b568907350d023d1429c1aa4aaa8925f22, and since @system-service
pulls that in we can drop it from @system-service.
Follow-up for #20191
(cherry picked from commit
67347f37407489a68e12da8f75b78ae1d1168de9)
(cherry picked from commit
24243d8d271c56c2ebe5cb361d8b2ebab7f6ead0)
Khem Raj [Mon, 26 Jul 2021 17:58:46 +0000 (10:58 -0700)]
networkd: Include linux/netdevice.h header
This header provides definitions for NET_NAME_UNKNOWN ånd NET_NAME_ENUM
Fixes build issue found with non-glibc systems
../git/src/network/networkd-link.c:1203:52: error: 'NET_NAME_UNKNOWN' undeclared (first use in this function)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit
2a0d07d6a0d5be63c6c10cb0789412f584858ec1)
(cherry picked from commit
46ced8149d5d97bf485bd668115915bcb6d47deb)
ratijas [Fri, 23 Jul 2021 10:32:52 +0000 (13:32 +0300)]
man: Fix incorrect EFI vendor UUID (last missing nibble)
(cherry picked from commit
d2e84b601805ae89cf8cb1b383b30c7c97cac73d)
(cherry picked from commit
08c99e5600f92c5143b931a507980a2655380cb3)
Cristian Rodríguez [Fri, 9 Jul 2021 21:19:05 +0000 (17:19 -0400)]
malloc() uses getrandom now
glibc master uses getrandom in malloc since https://sourceware.org/git/?p=glibc.git;a=commit;h=
fc859c304898a5ec72e0ba5269ed136ed0ea10e1 , getrandom should be in the default set so to avoid all non trivial programs to fallback to a PRNG.
(cherry picked from commit
14f4b1b568907350d023d1429c1aa4aaa8925f22)
(cherry picked from commit
765c366274db3ff841da237769f2b20a4ec3a045)
David Tardon [Mon, 2 Aug 2021 11:31:04 +0000 (13:31 +0200)]
machined-varlink: fix double free
Fixes: #18599
(cherry picked from commit
feac9a1d1bf3f59adaa85f58b655ec01a111a29a)
(cherry picked from commit
1600b38cd2029533547f8c3d4abfa12911ca0630)
Yu Watanabe [Mon, 14 Jun 2021 17:13:59 +0000 (02:13 +0900)]
sd-event: always reshuffle time prioq on changing online/offline state
Before
81107b8419c39f726fd2805517a5b9faab204e59, the compare functions
for the latest or earliest prioq did not handle ratelimited flag.
So, it was ok to not reshuffle the time prioq when changing the flag.
But now, those two compare functions also compare the source is
ratelimited or not. So, it is necessary to reshuffle the time prioq
after changing the ratelimited flag.
Hopefully fixes #19903.
(cherry picked from commit
2115b9b6629eeba7bc9f42f757f38205febb1cb7)
Hopefully fixes #20285 and
https://bugzilla.redhat.com/show_bug.cgi?id=
1984651.
Yu Watanabe [Mon, 14 Jun 2021 17:03:02 +0000 (02:03 +0900)]
sd-event: make event_source_time_prioq_reshuffle() accept all event source type
But it does nothing for an event source which is neither a timer nor
ratelimited.
(cherry picked from commit
5c08c7ab23dbf02aaf4e4bbae8e08a195da230a4)
Yu Watanabe [Mon, 14 Jun 2021 16:01:48 +0000 (01:01 +0900)]
sd-event: use usec_add()
(cherry picked from commit
a595fb5ca9c69c589e758e9ebe3b70ac90450ba3)
Yu Watanabe [Mon, 14 Jun 2021 15:44:04 +0000 (00:44 +0900)]
sd-event: drop unnecessary "else"
(cherry picked from commit
7e2bf71ca3638e36ee33215ceee386ba8013da6d)
Florian Klink [Sat, 17 Jul 2021 17:49:42 +0000 (19:49 +0200)]
man: document nss-{resolve,myhostname} resolving in the other direction, too
(cherry picked from commit
946f7ce32cef44d9bfcf2dc594bb193341434f57)
(cherry picked from commit
f869a39bceb35406d3193058d6ab5308c2e28f17)
Florian Klink [Thu, 1 Jul 2021 20:11:27 +0000 (22:11 +0200)]
man: stop recommending putting myhostname after dns
nss-resolve also looks in /etc/hosts, and has the same local hostname
resolving logic as nss-myhostname. We shouldn't recommend another order
than nss-resolve uses internally.
When nss-resolve is used, there's no possibility to override
nss-myhostname hosts via DNS *anyway*.
On top of that, it's not a good idea to allow DNS to override local
hostnames as all - at least not something we should advertise in the
docs.
Followup of
f918c67d38ba6ccd4eb0dc657f3f3155e5010cae /
https://github.com/systemd/systemd/pull/16754.
(cherry picked from commit
ce266330fc3bd6767451ac3400336cd9acebe9c1)
(cherry picked from commit
21423efc5852194ba3bf2bbc8067258e35c1558d)
Zbigniew Jędrzejewski-Szmek [Thu, 22 Jul 2021 06:21:46 +0000 (08:21 +0200)]
pid1: propagate the original command line when reexecuting
When we reexec the manager in a container, we lose configuration settings on
the kernel command line:
$ systemd-nspawn -M rawhide -b systemd.status-unit-format=name systemd.show-status=yes
...
# tr '\0' ' ' </proc/1/cmdline
/usr/lib/systemd/systemd systemd.status_unit_format=combined systemd.show-status=yes
# sudo systemctl daemon-reexec
# tr '\0' ' ' </proc/1/cmdline
/usr/lib/systemd/systemd --system --deserialize 20
This means that after daemon-reexec, the settings that we gain from the
commandline are reset to defaults.
So let's reeexecute with the original arguments copied over, modulo some
filtering.
(cherry picked from commit
846f1da465beda990c1c01346311393f485df467)
(cherry picked from commit
f3af6ba86c1128ccf6d6f896f70c22f9645a51c5)
Matthijs van Duin [Wed, 21 Jul 2021 09:10:36 +0000 (11:10 +0200)]
sd-bus: fix missing initializer in SD_BUS_VTABLE_END (#20253)
When two fields were added to the vtable.x.start struct, no initializers
for these were added to SD_BUS_VTABLE_END which also (ab)used that
struct (albeit sneakily by using non-designated initialization).
While C tolerates this, C++ prohibits these missing initializers, and
both g++ and clang++ will complain when using -Wextra.
This patch gives SD_BUS_VTABLE_END its own case in the union and
clarifies its initialization.
I tested the behaviour of g++ 10.2 and clang 11 in various cases. Both will warn
(-Wmissing-field-initializers, implied by -Wextra) if you provide initializers for some
but not all fields of a struct. Declaring x.end as empty struct or using an empty initializer
{} to initialize the union or one of its members is valid C++ but not C, although both gcc
and clang accept it without warning (even at -Wall -Wextra -std=c90/c++11) unless you
use -pedantic (which requires -std=c99/c++2a to support designated initializers).
Interestingly, .x = { .start = { 0, 0, NULL } } is the only initializer I found for the union
(among candidates for SD_BUS_VTABLE_END) where gcc doesn't zero-fill it entirely
when allocated on stack, it looked like it did in all other cases (I only examined this on
32-bit arm). clang always seems to initialize all bytes of the union.
[zjs: test case:
$ cat vtable-test.cc
#include "sd-bus.h"
const sd_bus_vtable vtable[] = {
SD_BUS_VTABLE_END
};
$ g++ -I src/systemd/ -Wall -Wmissing-field-initializers -c vtable-test.cc
vtable-test.cc:5:1: warning: missing initializer for member ‘sd_bus_vtable::<unnamed union>::<unnamed struct>::features’ [-Wmissing-field-initializers]
5 | };
| ^
vtable-test.cc:5:1: warning: missing initializer for member ‘sd_bus_vtable::<unnamed union>::<unnamed struct>::vtable_format_reference’ [-Wmissing-field-initializers]
$ clang++ -I src/systemd/ -Wmissing-field-initializers -c vtable-test.cc
vtable-test.cc:4:4: warning: missing field 'features' initializer [-Wmissing-field-initializers]
SD_BUS_VTABLE_END
^
src/systemd/sd-bus-vtable.h:188:28: note: expanded from macro 'SD_BUS_VTABLE_END'
.x = { { 0 } }, \
^
1 warning generated.
Both warnings are gone with the patch.]
(cherry picked from commit
654eaa403070d3c897454a5190603fda4071c3ff)
(cherry picked from commit
cdaf655f73bb3be10d47ab6f00d71a8d0b1a81e3)
Aakash Singh [Mon, 19 Jul 2021 18:57:48 +0000 (00:27 +0530)]
hwdb: 60-keyboard::remove hardcoded definition for KEYBOARD_KEY_56 for MSI Prestige And Modern
(cherry picked from commit
30c9faff0d74ceb0cbafb8ecdd8573bc479984dc)
(cherry picked from commit
95c3ad53f3febdaa1f175b85fb8b08ffc2bc96be)
This fixes a regression which was introduced into v248-stable with
976b4254a336a5bda52e7a38df48564d08f4cbff.
Lennart Poettering [Tue, 18 May 2021 20:27:24 +0000 (22:27 +0200)]
alloc-util: introduce MALLOC_SIZEOF_SAFE() helper
It's a wrapper around malloc_usable_size() that is supposed to be
compatible with _FORTIFY_SOURCES=1, by taking the
__builtin_object_size() data into account, the same way as the
_FORTIFY_SOURCES=1 logic does.
Fixes: #19203
(cherry picked from commit
6df28e1f847d68ad37ffe3f4ff47745b55233861)
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1975564
Lennart Poettering [Thu, 10 Jun 2021 08:19:11 +0000 (10:19 +0200)]
fileio: bump limit for read_full_file() and friends to 64M
Apparently people use such large key files. Specifically, people used 4M
key files, and we lowered the limit from 4M to 4M-1 back in 248.
This raises the limit to 64M for read_full_file() to avoid these
specific issues and give some non-trivial room beyond the 4M files seen
IRL.
Note that that a 64M allocation in glibc is always immediately done via
mmap(), and is thus a lot slower than shorter allocations. This means
read_virtual_file() becomes ridiculously slow if we'd use the large
limit, since we use it all the time for reading /proc and /sys metadata,
and read_virtual_file() typically allocates the full size with malloc()
in advance. In fact it becomes so slow, that test-process-util kept
timing out on me all the time, once I blindly raised the limit.
This patch hence introduces two distinct limits for read_full_file() and
read_virtual_file(): the former is much larger than the latter and the
latter remains where it is. This is safe since the former uses an
exponentially growing realloc() loop while the latter uses the
aforementioend ahead-of-time full limit allocation.
Fixes: #19193
(cherry picked from commit
f6dd48fae807f93e4295c27bff79f4707cc96662)
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1963428
Zbigniew Jędrzejewski-Szmek [Wed, 23 Jun 2021 09:46:41 +0000 (11:46 +0200)]
basic/unit-name: do not use strdupa() on a path
The path may have unbounded length, for example through a fuse mount.
CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and
ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo
and each mountpoint is passed to mount_setup_unit(), which calls
unit_name_path_escape() underneath. A local attacker who is able to mount a
filesystem with a very long path can crash systemd and the whole system.
https://bugzilla.redhat.com/show_bug.cgi?id=
1970887
The resulting string length is bounded by UNIT_NAME_MAX, which is 256. But we
can't easily check the length after simplification before doing the
simplification, which in turns uses a copy of the string we can write to.
So we can't reject paths that are too long before doing the duplication.
Hence the most obvious solution is to switch back to strdup(), as before
7410616cd9dbbec97cf98d75324da5cda2b2f7a2.
(cherry picked from commit
441e0115646d54f080e5c3bb0ba477c892861ab9)
(cherry picked from commit
764b74113e36ac5219a4b82a05f311b5a92136ce)
rene [Tue, 20 Jul 2021 05:45:04 +0000 (15:45 +1000)]
Minor typo (#20254)
Correct resoulution with resolution.
(cherry picked from commit
b838bc11268ea461e8c58ce69e2f781be1821aa1)
(cherry picked from commit
5ea3ec8e18a2883c2ea89af9de48fc0fb0e3f283)
duament [Sat, 17 Jul 2021 17:17:41 +0000 (01:17 +0800)]
shell-completion/zsh/_systemd-run: Fix completion of command names and arguments
(cherry picked from commit
3f49d1faf59acaa85aa5ad502c39b1a601d58d26)
(cherry picked from commit
b511a441f3277750e68a14d8d7e6649c4f182b86)
Raul Tambre [Wed, 14 Jul 2021 11:58:31 +0000 (14:58 +0300)]
man/systemd.network: Fix duplicate Xfrm description
It's already listed along with others (Tunnel, VLAN, etc.) and its description matches those. The duplication was introduced by commit
c3006a485c9c35c0ab947479ff1dd7149fda9750.
(cherry picked from commit
534b5abce12847abc896fba24cafb99c101a2987)
(cherry picked from commit
d4ce78bfa3d90cc4601d1cbb0b51af32fe8f4b2a)
Zbigniew Jędrzejewski-Szmek [Mon, 5 Jul 2021 19:29:11 +0000 (21:29 +0200)]
shared/format-table: allocate buffer of sufficient size
(cherry picked from commit
6dc57047ff0f1f9e98938ffb172dae06e6868b94)
(cherry picked from commit
e6407ca25852dadec355df2e6fdc92d1f189bceb)
Gibeom Gwon [Mon, 12 Jul 2021 17:57:43 +0000 (02:57 +0900)]
homed: allow systemd-homed access to FIDO2 devices
Add DeviceAllow= option for FIDO2 devices in systemd-homed.service.
(cherry picked from commit
85e424c0c852fcb92d108494a6efa9dd0ce943b2)
(cherry picked from commit
727a03e4826efe1392b8a1899b220e7df7976990)
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jul 2021 10:32:39 +0000 (12:32 +0200)]
systemctl: show error when help for unknown unit is requested
Fixes #20189. We would only log at debug level and return failure, which looks
like a noop for the user.
('help' accepts multiple arguments and will show multiple concatenated man
pages in that case. Actually, it will also show multiple concatenated man pages
if the Documentation= setting lists multiple pages. I don't think it's very
terribly useful, but, meh, I don't think we can do much better. If a user
requests a help for a two services, one known and one unknown, there'll now be
a line in the output. It's not very user friendly, but not exactly wrong too.)
(cherry picked from commit
75312ada5324d8adae3f3a0ed97f0acfc8b8bde5)
(cherry picked from commit
486412ad3bba4f1306597302cf66cc4858126243)
Ben Stockett [Fri, 9 Jul 2021 20:29:36 +0000 (20:29 +0000)]
Updated manpage for sd_bus_set_property
Updated manpage for sd_bus_set_property and sd_bus_set_propertyv. In the old manpage, these functions included the parameter sd_bus_message **reply when the actual function had no such argument.
(cherry picked from commit
4226dfafbac2167e1441a7a65d00c29c5016d4fb)
(cherry picked from commit
70a318d012d5900ad16685038a1e9a30e9a2a41d)
nassir90 [Fri, 9 Jul 2021 20:16:02 +0000 (21:16 +0100)]
Fixed typo (#20187)
* Fixed typo
Before, the file claimed that some systemd units are created "from other
configuration". It should have read "from other configuration files".
Co-authored-by: Nozz <nozolo90@gmail.com>
(cherry picked from commit
a814eae728a5e238e39d4a9d952ce8e309fa38fd)
(cherry picked from commit
5263490368b3f2c94935300bb5faa09cc04cb4cd)
Frantisek Sumsal [Fri, 9 Jul 2021 12:59:11 +0000 (14:59 +0200)]
test: strip binaries by default
Since
23f8e01 we always kept binaries unstripped, since $STRIP_BINARIES
is unset by default.
(cherry picked from commit
e68e473ba2d6383155c49337c3c5f2c0d3fb0b5f)
(cherry picked from commit
b149c2c64a1093fd509a94d7a25f01b726798098)
Frantisek Sumsal [Fri, 9 Jul 2021 12:44:38 +0000 (14:44 +0200)]
test: bump the test timeout to give ldconfig.service enough time to finish
Sometimes the ldconfig.service might take a bit longer to finish,
causing spurious test timeouts:
```
[ 1025.858923] systemd[24]: ldconfig.service: Executing: /sbin/ldconfig -X
...
[ 1043.883620] systemd[1]: ldconfig.service: Main process exited, code=exited, status=0/SUCCESS (success)
...
Trying to halt container. Send SIGTERM again to trigger immediate
termination.
Container TEST-52-HONORFIRSTSHUTDOWN terminated by signal KILL.
E: Test timed out after 20s
```
(cherry picked from commit
7fb4ee7aa5b6ffdf2e1e8e50a18630aa30f16505)
(cherry picked from commit
610406767b8ddf23a27c919fe52922d35457e0d3)
nl6720 [Fri, 9 Jul 2021 09:56:54 +0000 (12:56 +0300)]
docs: improve wording when mentioning the acronym "ESP"
"ESP" is "EFI system partition", so "ESP partition" is redundant.
(cherry picked from commit
250db1bf02b9fd73f2e0604acddbc20937c67d19)
(cherry picked from commit
6822cfa5f066fcbf79ded85419d59a97decc67b9)
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jul 2021 11:38:53 +0000 (13:38 +0200)]
hwdb: update to state from v249
This updates various "upstream" hwdb entries. The two new files that
were added in v249, and the associated udev rules, are not included in
this.
Takashi Sakamoto [Wed, 7 Apr 2021 02:49:22 +0000 (11:49 +0900)]
hwdb: allow parser to expect usage of slash sign in value of property
Although in IEEE 1394 unit function list I have a plan to use slash sign
in name of property, current implementation of parser doesn't allow it.
When parsing current entries in database excluded from parser testing, we
can find usage of slash sign in name of property.
This commit adds slash sign in allow list of the parser for my
convenience.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
(cherry picked from commit
5e939304f513ba57ce6595f36b7da641c62c60db)
Jan Palus [Wed, 7 Jul 2021 22:23:21 +0000 (00:23 +0200)]
hostnamed: correct variable with errno in fallback_chassis
fixes assertion failure on arm:
systemd-hostnamed[642]: Assertion '(_error) != 0' failed at src/hostname/hostnamed.c:207, function fallback_chassis(). Aborting.
(cherry picked from commit
105a4245ff13d588e1e848e8ee3cffd6185bd0ae)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 10:39:33 +0000 (12:39 +0200)]
meson: install the right README file in modprobe.d
We put the "global" README file there. Introduced
in
d83e90c73cf25a839f5e60f355baa0d38364ff41.
(cherry picked from commit
378e9d2b6d701a1385c4bf72dfc0697c2c37bd57)
Hamish Moffatt [Mon, 5 Jul 2021 09:06:15 +0000 (19:06 +1000)]
Clarify the behaviour of suspend-then-sleep mode in the manual pages.
Fixes #20125.
(cherry picked from commit
33f899bd479534b0a920ce427cdf06739028f5ab)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 07:26:12 +0000 (09:26 +0200)]
NEWS: add old entry about Type=ether
Apparently it's an important feature for some folks:
https://utcc.utoronto.ca/\~cks/space/blog/linux/NetworkdMACMatchesWidely.
I think we considered this more of a bugfix, but it's somewhere on the border.
Let's add this it's easier to discover.
(cherry picked from commit
88b2a95064675c5f86648053cf124265f5289095)
Anita Zhang [Tue, 6 Jul 2021 09:46:13 +0000 (02:46 -0700)]
oomd: don't collect candidate stats on every interval
cb13961ada52c1b27f6d6c2c6e37a2901f01ed30 updated the oomd logic to
collect candidate data when a kill was about to happen. However there
was still a call left over in the main loop to collect candidate data on
every interval. Remove this since it's unneeded.
Fixes #20122
(cherry picked from commit
d61ee727f037ab4e07af720ab34055e9cafe9cec)
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jul 2021 14:41:28 +0000 (16:41 +0200)]
tmpfiles: fix borked assert
It seems that fd_set_perms() is always called after checking that
fd >= 0 (also when called as action() in glob_item_recursively()),
so it seems that the assertion really came from fd==0.
Fixes #20140.
Also three other similar cases are updated.
(cherry picked from commit
b4b0f87c6275dde32769c2e75231caa1d4c21f9b)
Luca Boccassi [Tue, 6 Jul 2021 11:55:30 +0000 (12:55 +0100)]
man: correct return value of sd_bus_open_with_description
Since https://github.com/systemd/systemd/commit/
f4b2933ee7890e5d414ab266d8586f19027a2bd9
if a description is not set, sd_bus_open_with_description returns -ENXIO, but the
documnetation stated that it returned successfully with a NULL string.
(cherry picked from commit
48e5ef14af5ade97b0f7491c63443778c7602c43)
qhill [Fri, 2 Jul 2021 13:13:13 +0000 (14:13 +0100)]
units: correct description of final.target
This was updated incorrectly in https://github.com/systemd/systemd/pull/20058/commits/
4fd3fc66396026f81fd5b27746f2faf8a9a7b9ee. As https://github.com/systemd/systemd/blob/main/man/systemd.special.xml decribes, this unit is about shutdown rather than boot.
(cherry picked from commit
f127fed75d3bae3a1eb0be6feea334bb8d1c3a43)
Lennart Poettering [Fri, 2 Jul 2021 13:30:43 +0000 (15:30 +0200)]
coredumpctl: show --help text if "coredumpctl help" is called
Most of our programs that take "verbs" make the "help" verb either
equivalent to passing the --help switch (or at least print a message
redirecting the user to that switch). Do so in coredumpctl too, in order
to minimize surprises.
(cherry picked from commit
6d8be376e1682a79f0aecceb2136884c5b4327e2)
Trent Piepho [Thu, 1 Jul 2021 19:19:57 +0000 (12:19 -0700)]
udev: Fix by-uuid symlink for ubifs volumes
ubifs volumes have a UUID and the built-in blkid is able to determine
it. The disk/by-uuid symlink isn't created because ubifs volumes are
not on block devices but on SUBSYSTEM="ubi" devices. See #20071.
Allow ubi subsystem devices to be processed by the persistent storage
rules too. The kernel device name matching already allows ubi* to pass.
The existing rules are sufficient to create the link.
The links look like other by-uuid symlinks, for example:
/dev/disk/by-uuid/
9a136158-585b-4ba4-9b70-
cbaf2cf78a1c -> ../../ubi0_1
(cherry picked from commit
21ac7884e9c1684d091d893254bcbe4b83740e9f)
Anita Zhang [Fri, 2 Jul 2021 00:07:32 +0000 (17:07 -0700)]
oomd: review follow ups to #20020
(cherry picked from commit
e82acab4db6f5f212f6c9c9b3ec2df9010a83925)
Lennart Poettering [Thu, 1 Jul 2021 13:03:16 +0000 (15:03 +0200)]
Revert "rules: ubi mtd - add link to named partitions"
This reverts commit
7f1e9c806b6915e8020cf3706dc87e1cd37bc2fa, PR #6750
Apparently the rule change never worked, see #20071.
Fixes #20071
(cherry picked from commit
4b6bc397b454f79006481c1e8507d85c5bfd2e9a)
Zbigniew Jędrzejewski-Szmek [Thu, 1 Jul 2021 09:06:45 +0000 (11:06 +0200)]
core: add comment explaining event source deallocation
Followup for
bc989831e6. The original reproducer still works w/o the unref,
and doesn't work with this change.
(cherry picked from commit
13bb1ffb912cacea4041910e38674e0984ac5772)
Zbigniew Jędrzejewski-Szmek [Wed, 30 Jun 2021 11:20:27 +0000 (13:20 +0200)]
units: adjust description of systemd-update-utmp.service
"Update about" is not gramatically correct. I also think saying "Record" makes
this easier to understand for people who don't necessarilly know what UTMP is.
(cherry picked from commit
2e32d390b0cb49a7fd074c50fab43c097c38d4f3)
Zbigniew Jędrzejewski-Szmek [Wed, 30 Jun 2021 10:54:31 +0000 (12:54 +0200)]
units: shorten description of kmod-static-nodes.service
As suggested in
https://github.com/systemd/systemd/pull/20058#pullrequestreview-
695023490.
(cherry picked from commit
8ea257852998ee4b2ee7af18313a7af4e172535d)
Zbigniew Jędrzejewski-Szmek [Tue, 29 Jun 2021 07:47:53 +0000 (09:47 +0200)]
units: adjust Descriptions of various units
In general, it's not very usuful to repeat the unit name as the description.
Especially when the word is a common name and if somebody doesn't understand
the meaning immediately, they are not going to gain anything from the
repeat either, e.g. "halt", "swap".
In the status-unit-format=combined output parentheses are used around
Description, so avoid using parenthesis in the Description itself.
(cherry picked from commit
4fd3fc66396026f81fd5b27746f2faf8a9a7b9ee)
Zbigniew Jędrzejewski-Szmek [Tue, 29 Jun 2021 07:29:57 +0000 (09:29 +0200)]
logind, units: unit Descriptions should be capitalized
(cherry picked from commit
0a59216caebdf0488d1200cd818cb46361d1f17b)
Zbigniew Jędrzejewski-Szmek [Tue, 29 Jun 2021 07:10:42 +0000 (09:10 +0200)]
core: add default descriptions for slices
[ OK ] Created slice system-getty.slice (Slice /system/getty).
[ OK ] Created slice system-modprobe.slice (Slice /system/modprobe).
[ OK ] Created slice system-sshd\x2dkeygen.slice (Slice /system/sshd-keygen).
[ OK ] Created slice user.slice (User and Session Slice).
Before, the first three slices were shown without any description which didn't
look nice.
(cherry picked from commit
4dd21726f852010aef17e9b952b4bb1646fdf496)
Zbigniew Jędrzejewski-Szmek [Mon, 10 May 2021 11:12:53 +0000 (13:12 +0200)]
core/service: rework management of exec_fd event source
The code in service_spawn() was written as if exec_fd_event_source
was always unset. (We would either fail the assertion that is moved in the
patch, or leak the event source object if it was set.)
To make this work, let's always assert that exec_fd_event_source is unset,
and actually unset it service_sigchld_event(). I think this is the most
elegant approach. The problem is that we don't have the same information
about execution flags as in service_spawn(), so we need to conditionalize
on pid==main_pid to know if we should disable exec_fd_event_source.
I think this matches all cases where we may set exec_fd_event_source:
service_enter_start() and service_run_next_main().
service_enter_stop_post() calls service_set_state(), which will also destroy
the source. But that happens too late, because from service_enter_stop_post()
we call service_spawn() first, and then service_set_state() second.
(An alternative approach would be to deallocate the existing
exec_fd_event_source in service_spawn(). But this would mean that we would
temporarily have an event source attached to a process that we already know is
dead, which seems less than ideal.)
Original report from Dimitri John Ledkov <dimitri.ledkov@canonical.com>:
> Ubuntu private bug reference for this issue at the moment is
> https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/
1921145
> Michael's and Ian's team run into an issue when using systemd in the
> initrd, without dbus daemon running, and launching a unit in a
> particular way that appears to lock up systemd (pid 1) it self.
> michael vogt: "The attached script works for me to reproduce this on
> classic. I tested 20.04 (245) and 21.04 (247) in a qemu VM. Sometimes
> I need to run it multiple times but usually it crashes after at most 2
> runs. Use "journalctl | tail" to see the messages, it's the same that
> Ian reported. There is also a /var/crash/_usr_lib_systemd_systemd
> crash file created."
> I understand that the particular way to run a unit is very odd,
> however, it is currently possible to invoke, and it would be expected
> for pid1 to not lock up and crash.
> The Assertion that systemd hits is along the lines of:
> [ 10.182627] systemd[1]: Assertion 's' failed at
> src/core/service.c:3204, function service_dispatch_exec_io().
> Aborting.
> [ 10.195458] systemd[1]: Caught <ABRT>, dumped core as pid 449.
> [ 10.204446] systemd[1]: Freezing execution.
(cherry picked from commit
bc989831e634123c2ff43bcbbeae19097ccc9ff9)
Zbigniew Jędrzejewski-Szmek [Mon, 10 May 2021 08:23:08 +0000 (10:23 +0200)]
sd-event: add more asserts about event source integrity
Also "downgrade" assert_se() to assert(), this is not test code.
(cherry picked from commit
199475092d9a6f0482a7b934592784a54b82ffd0)
Zbigniew Jędrzejewski-Szmek [Mon, 10 May 2021 08:22:07 +0000 (10:22 +0200)]
core: disable event sources before unreffing them
This mirrors the change done for systemd-resolved in
97935302283729c9206b84f5e00b1aff0f78ad19. Quoting that patch:
> We generally operate on the assumption that a source is "gone" as soon as we
> unref it. This is generally true because we have the only reference. But if
> something else holds the reference, our unref doesn't really stop the source
> and it could fire again.
In particular, we take temporary references from sd-event code, and when called
from an sd-event callback, we could temporarily see this elevated reference
count. This patch doesn't seem to change anything, but I think it's nicer to do
the same change as in other places and not rely on _unref() immediately
disabling the source.
(cherry picked from commit
5dcadb4c8320f6a7b8a9353404874d43668e4648)
Lennart Poettering [Mon, 1 Mar 2021 17:02:24 +0000 (18:02 +0100)]
Revert "core: do not set noexec on sysfs/procfs"
This reverts commit
b33cd6b3eec52fc50c6c34d6f07a41cc6254c27f.
(cherry picked from commit
988bcc7c21a07acc08f9343b52b492b98b08444a)
Zbigniew Jędrzejewski-Szmek [Wed, 30 Jun 2021 15:17:41 +0000 (17:17 +0200)]
core/cgroup: upgrade log level when we fail to rescope a pid
See https://bugzilla.redhat.com/show_bug.cgi?id=
1973058 again:
systemd[1779]: Started Application launched by gnome-session-binary.
systemd[1779]: app-glib-liveinst\x2dsetup-1897.scope: Failed to add PIDs to scope's control group: No such process
systemd[1779]: app-glib-liveinst\x2dsetup-1897.scope: Failed with result 'resources'.
systemd[1779]: Failed to start Application launched by gnome-session-binary.
systemd[1779]: app-glib-xdg\x2duser\x2ddirs-1900.scope: Failed to add PIDs to scope's control group: No such process
systemd[1779]: app-glib-xdg\x2duser\x2ddirs-1900.scope: Failed with result 'resources'.
systemd[1779]: Failed to start Application launched by gnome-session-binary.
systemd[1779]: app-gnome-gsettings\x2ddata\x2dconvert-1902.scope: Failed to add PIDs to scope's control group: No such process
systemd[1779]: app-gnome-gsettings\x2ddata\x2dconvert-1902.scope: Failed with result 'resources'.
systemd[1779]: Failed to start Application launched by gnome-session-binary.
Since we don't show the PID anywhere, it can be quite hard to figure out what
is going on. There may be logs from the pid above or below in the log, but
we have no PID number to identify them. So let's upgrade the log from
unit_attach_pids_to_cgroup() to tell us precisely which PIDs and why couldn't
be handled.
(cherry picked from commit
7a2ba4078731a00fa105c38c283b2ce7789bb512)
Zbigniew Jędrzejewski-Szmek [Wed, 30 Jun 2021 15:02:45 +0000 (17:02 +0200)]
core: emit nicer log message for exiting ConditionExec processes
See https://bugzilla.redhat.com/show_bug.cgi?id=
1973058:
we would log something like:
systemd[244]: Starting willskip.service...
systemd[244]: willskip.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
systemd[244]: willskip.service: Skipped due to 'exec-condition'.
systemd[244]: Condition check resulted in willskip.service being skipped.
The line with 'Control process exited' would be at LOG_NOTICE level.
With the patch:
systemd[244]: Starting willskip.service...
systemd[244]: willskip.service: Skipped due to 'exec-condition'.
systemd[244]: Condition check resulted in willskip.service being skipped.
Debug logs:
systemd[244]: Starting willskip.service...
systemd[244]: Sent message type=signal sender=org.freedesktop.systemd1 destination=n/a path=/org/freedesktop/systemd1/unit/willskip_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=8 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
systemd[244]: Sent message type=signal sender=org.freedesktop.systemd1 destination=n/a path=/org/freedesktop/systemd1/unit/willskip_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=9 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
systemd[244]: Sent message type=signal sender=org.freedesktop.systemd1 destination=n/a path=/org/freedesktop/systemd1/job/46 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=10 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
systemd[11020]: Skipping PR_SET_MM, as we don't have privileges.
systemd[11020]: willskip.service: Executing: sh -c 'exit 2'
systemd[244]: Received SIGCHLD from PID 11020 (sh).
systemd[244]: Child 11020 (sh) died (code=exited, status=2/INVALIDARGUMENT)
systemd[244]: willskip.service: Child 11020 belongs to willskip.service.
systemd[244]: willskip.service: Condition check process exited, code=exited, status=2/INVALIDARGUMENT (success)
systemd[244]: willskip.service: Got final SIGCHLD for state condition.
systemd[244]: willskip.service: Skipped due to 'exec-condition'.
systemd[244]: willskip.service: Service will not restart (restart setting)
systemd[244]: willskip.service: Changed condition -> dead
systemd[244]: willskip.service: Job 46 willskip.service/start finished, result=done
systemd[244]: Condition check resulted in willskip.service being skipped.
(cherry picked from commit
58441bc177bb1bcdeceff74d3ae6b6d9f93a7fbe)
Anita Zhang [Thu, 24 Jun 2021 21:58:40 +0000 (14:58 -0700)]
oomd: check mem free and swap free before doing a swap-based kill
https://bugzilla.redhat.com/show_bug.cgi?id=
1974763
(cherry picked from commit
cb5ce676d96df64fc08a551581489e6e196ea373)
Anita Zhang [Thu, 24 Jun 2021 10:11:07 +0000 (03:11 -0700)]
oomd: get memory total and free as part of system context
(cherry picked from commit
eeeaa422845a045bded6c44732d5e9b025084011)
Anita Zhang [Thu, 24 Jun 2021 09:37:57 +0000 (02:37 -0700)]
oomd: switch system context parsing to use /proc/meminfo
Makes it easier in the next commits to unify on one way to read swap and
memory info.
(cherry picked from commit
47136b9d9a75fff5f9e2e777aaed736e6f66c7f7)
Luca Boccassi [Wed, 30 Jun 2021 14:51:03 +0000 (15:51 +0100)]
core: when recursively bind-remounting nested mounts, use options from top one
When mount points are stacked, bind_remount_recursive_with_mountinfo()
uses the existing mount options of the "lower" level mount (ie: the
first one that was mounted on a mount point). But the actual mount
point in use is the "top" one (ie: the last one that was mounted on a
mount point), so in practice if the mount options are different between
the layers, the bottom options are used by mistake on the top mount,
which is not what we want. This is because libmount returns the "bottom"
one first.
If the hashmap returns EEXIST, which means the same key (path) with different
value (options) is already present, update the hashmap instead of discarding
the result. This way, the last/top mount options are always used when
mounts are stacked on a mount point.
This was found to cause problems as LXC version 4.x stacks two /sys mounts,
the bottom one read-write and the top one read-only. systemd accidentally
remounts the top-one read-write, breaking various expectations since a
read-only /sys is the way we decide whether we are running in a container
or not (in this particular case, networkd tests are broken as networkd
expects to be able to modify network settings with a writable /sys).
Future versions of LXC will no longer do this double-stacking, but we
need to support running inside older versions too.
This was triggered by https://github.com/systemd/systemd/commit/
6720e356c137
as that causes a recursive remount of '/', which processes '/sys' as one
of the submounts, from make_nosuid(). But it's likely that other combinations
of options could trigger this as well.
Before:
root@systemd-debug:/# systemd-run -t --wait --property ProtectSystem=yes findmnt
Running as unit: run-u9.service
Press ^] three times within 1s to disconnect TTY.
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda2[/var/lib/lxc/systemd-debug/rootfs]
│ ext4 ro,nosuid,relatime,errors=remount-ro,stripe=
├─/dev none tmpfs rw,nosuid,relatime,size=492k,mode=755
│ ├─/dev/.lxc/proc proc proc rw,nosuid,relatime
│ ├─/dev/.lxc/sys sys sysfs rw,nosuid,relatime
│ ├─/dev/console devpts[/2] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/ptmx devpts[/ptmx] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty1 devpts[/0] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty2 devpts[/1] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty3 devpts[/2] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty4 devpts[/3] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/hugepages hugetlbfs hugetlbfs rw,nosuid,relatime,pagesize=2M
│ └─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ ├─/proc/sys proc[/sys] proc ro,nosuid,nodev,noexec,relatime
│ │ ├─/proc/sys/net proc[/sys/net] proc rw,nosuid,nodev,noexec,relatime
│ │ └─/proc/sys/kernel/random/boot_id
│ │ none[/.lxc-boot-id] tmpfs ro,nosuid,nodev,noexec,relatime,size=492k,mo
│ └─/proc/sysrq-trigger proc[/sysrq-trigger] proc ro,nosuid,nodev,noexec,relatime
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ └─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/devices/virtual/net sysfs sysfs rw,relatime
│ │ └─/sys/devices/virtual/net
│ │ sysfs[/devices/virtual/net] sysfs rw,nosuid,relatime
│ ├─/sys/fs/fuse/connections fusectl fusectl rw,nosuid,nodev,noexec,relatime
│ └─/sys/fs/cgroup cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,m
├─/run tmpfs tmpfs ro,nosuid,nodev,size=4912348k,nr_inodes=8192
│ ├─/run/credentials tmpfs[/systemd/inaccessible/dir] tmpfs ro,nosuid,nodev,noexec,size=4912348k,nr_inod
│ └─/run/systemd/incoming tmpfs[/systemd/propagate/run-u9.service]
│ tmpfs ro,nosuid,nodev,size=4912348k,nr_inodes=8192
├─/tmp tmpfs tmpfs rw,nosuid,nodev,size=12280872k,nr_inodes=409
│ └─/tmp tmpfs[/systemd-private-
b730df90da424397a3f246cb15dcdbb1-run-u9.service-K6EUwf/tmp]
│ tmpfs rw,nosuid,nodev,size=12280872k,nr_inodes=409
└─/var/tmp /dev/sda2[/var/lib/lxc/systemd-debug/rootfs/var/tmp/systemd-private-
b730df90da424397a3f246cb15dcdbb1-run-u9.service-vEHyRi/tmp]
ext4 rw,nosuid,relatime,errors=remount-ro,stripe=
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 14.249s
CPU time consumed: 37ms
After:
root@systemd-debug:/# systemd-run -t --wait --property ProtectSystem=yes findmnt
Running as unit: run-u3.service
Press ^] three times within 1s to disconnect TTY.
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda2[/var/lib/lxc/systemd-debug/rootfs]
│ ext4 rw,relatime,errors=remount-ro,stripe=32699
├─/dev none tmpfs rw,relatime,size=492k,mode=755
│ ├─/dev/.lxc/proc proc proc rw,relatime
│ ├─/dev/.lxc/sys sys sysfs rw,relatime
│ ├─/dev/console devpts[/2] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/ptmx devpts[/ptmx] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty1 devpts[/0] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty2 devpts[/1] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty3 devpts[/2] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty4 devpts[/3] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/hugepages hugetlbfs hugetlbfs rw,relatime,pagesize=2M
│ └─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ ├─/proc/sys proc[/sys] proc ro,nosuid,nodev,noexec,relatime
│ │ ├─/proc/sys/net proc[/sys/net] proc rw,nosuid,nodev,noexec,relatime
│ │ └─/proc/sys/kernel/random/boot_id
│ │ none[/.lxc-boot-id] tmpfs ro,nosuid,nodev,noexec,relatime,size=492k,mode=75
│ └─/proc/sysrq-trigger proc[/sysrq-trigger] proc ro,nosuid,nodev,noexec,relatime
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ └─/sys sysfs sysfs ro,nosuid,nodev,noexec,relatime
│ ├─/sys/devices/virtual/net sysfs sysfs rw,relatime
│ │ └─/sys/devices/virtual/net
│ │ sysfs[/devices/virtual/net] sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/fuse/connections fusectl fusectl rw,nosuid,nodev,noexec,relatime
│ └─/sys/fs/cgroup cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory
├─/run tmpfs tmpfs rw,nosuid,nodev,size=4912348k,nr_inodes=819200,mo
│ ├─/run/credentials tmpfs[/systemd/inaccessible/dir]
│ │ tmpfs ro,nosuid,nodev,noexec,size=4912348k,nr_inodes=81
│ └─/run/systemd/incoming tmpfs[/systemd/propagate/run-u3.service]
│ tmpfs ro,nosuid,nodev,size=4912348k,nr_inodes=819200,mo
├─/tmp tmpfs tmpfs rw,nosuid,nodev,size=12280872k,nr_inodes=409600
├─/boot /dev/sda2[/var/lib/lxc/systemd-debug/rootfs/boot]
│ ext4 ro,relatime,errors=remount-ro,stripe=32699
└─/usr /dev/sda2[/var/lib/lxc/systemd-debug/rootfs/usr]
ext4 ro,relatime,errors=remount-ro,stripe=32699
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 14ms
CPU time consumed: 5ms
Host (LXC):
root@systemd-debug:/# findmnt
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda2[/var/lib/lxc/systemd-debug/rootfs]
│ ext4 rw,relatime,errors=remount-ro,stripe=32699
├─/run tmpfs tmpfs rw,nosuid,nodev,size=4912348k,nr_inodes=819200,mode=755
├─/tmp tmpfs tmpfs rw,nosuid,nodev,size=12280872k,nr_inodes=409600
├─/dev none tmpfs rw,relatime,size=492k,mode=755
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/ptmx devpts[/ptmx] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty1 devpts[/0] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty2 devpts[/1] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty3 devpts[/2] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty4 devpts[/3] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/hugepages hugetlbfs hugetlbfs rw,relatime,pagesize=2M
│ ├─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec,relatime
│ ├─/dev/console devpts[/2] devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/.lxc/proc proc proc rw,relatime
│ └─/dev/.lxc/sys sys sysfs rw,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ ├─/proc/sys proc[/sys] proc ro,nosuid,nodev,noexec,relatime
│ │ ├─/proc/sys/kernel/random/boot_id
│ │ │ none[/.lxc-boot-id] tmpfs ro,nosuid,nodev,noexec,relatime,size=492k,mode=755
│ │ └─/proc/sys/net proc[/sys/net] proc rw,nosuid,nodev,noexec,relatime
│ └─/proc/sysrq-trigger proc[/sysrq-trigger] proc ro,nosuid,nodev,noexec,relatime
└─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
└─/sys sysfs sysfs ro,nosuid,nodev,noexec,relatime
├─/sys/devices/virtual/net sysfs sysfs rw,relatime
│ └─/sys/devices/virtual/net
│ sysfs[/devices/virtual/net]
│ sysfs rw,nosuid,nodev,noexec,relatime
├─/sys/fs/fuse/connections fusectl fusectl rw,nosuid,nodev,noexec,relatime
└─/sys/fs/cgroup cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recurs
Fixes https://github.com/systemd/systemd/issues/20032
(cherry picked from commit
e01030633c73d3974390292bba381aca1224709b)
Albert Brox [Wed, 30 Jun 2021 09:54:15 +0000 (05:54 -0400)]
Improve tmpfiles unsafe transition log message (#20048)
(cherry picked from commit
f1bda7ead20c210a28be5decad636e1d95d8c3ec)
Zbigniew Jędrzejewski-Szmek [Sun, 27 Jun 2021 13:49:28 +0000 (15:49 +0200)]
man/dnssec-trust-anchors: update comment syntax description
Let's just use the same phrase as in systemd.syntax(7).
Fixes #20045.
(cherry picked from commit
0b497bc46f4599906e153c1613b32fbb4e4f129e)
Raul Tambre [Tue, 29 Jun 2021 08:49:56 +0000 (11:49 +0300)]
resolved: Fix link to resolv.conf manpage
Seems to typically located in volume 5 these days on Linux systems that systemd targets.
(cherry picked from commit
12c0bb31a7c20663bf10a2effe498332400de92c)
Alexander Tsoy [Mon, 28 Jun 2021 20:00:11 +0000 (23:00 +0300)]
resolved: do not try to copy empty NSEC types bitmaps
dns_resource_record_copy() assumes that NSEC types bitmap is non-empty
which results in a null pointer dereference inside bitmap_copy() in some
cases. Fix this by calling bitmap_copy() conditionally.
(cherry picked from commit
1f00a50c695fe3b55dee38fbd02a902a6c703c87)
Yu Watanabe [Sat, 26 Jun 2021 01:40:07 +0000 (10:40 +0900)]
sd-device: allow to read sysattr which contains embedded NUL
This effectively reverts the commit
2a394d0bf2f0afd8b9ed5faeb33f23459e3c6504.
But drop trailing '\r' of the read value, as sd_device_set_sysattr_value() drops it.
Fixes #20025.
(cherry picked from commit
70160c6eeee07ac6aa817826d13e8eff9563ce1e)
dgcampea [Sat, 26 Jun 2021 12:23:20 +0000 (13:23 +0100)]
man: fix incorrect description regarding DynamicUser= and StateDirectory=
(cherry picked from commit
e8f4bf33d8a6123ad8ae3955c989e36972f4884d)
Yu Watanabe [Sat, 26 Jun 2021 15:02:24 +0000 (00:02 +0900)]
udev-test: add a testcase for string_escape=replace
(cherry picked from commit
33989b967e30acc3f29f9cf9af3eec1817fd508e)
Yu Watanabe [Sat, 26 Jun 2021 14:34:59 +0000 (23:34 +0900)]
udev: fix use of invalid pointer
Fixes a bug introduced by
ea0f4578a7e90f5227817058bfb11bb91dbb1431.
Fixes CID#
1457766.
(cherry picked from commit
7db6b672752ec7335ade74c7a7c52e5fc684c97a)
Zbigniew Jędrzejewski-Szmek [Wed, 23 Jun 2021 16:10:57 +0000 (18:10 +0200)]
dbus-socket: fix check of Listen* arguments
We checked the wrong field, which was always NULL here, so we would always
reject the assignment. We would also print the wrong string in the error
message:
$ sudo systemd-run --socket-property ListenFIFO=/tmp/fifo3 cat
Failed to start transient socket unit: Invalid socket path: FIFO
(cherry picked from commit
aeecab3804aae973577f36880af4b7799e4eb7d5)
David Tardon [Fri, 25 Jun 2021 08:42:53 +0000 (10:42 +0200)]
remove a left-over break
By the "same logic as above...", we want to continue to fallback here,
but the break prohibits that.
This is a follow-up for
ee1aa61c4710ae567a2b844e0f0bb8cb0456ab8c .
(cherry picked from commit
99df1cb6f50875db513a5b45f18191460a150f3d)
Mike Crowe [Thu, 24 Jun 2021 14:25:58 +0000 (15:25 +0100)]
resolvectl: Only strip ifname suffixes when being resolvconf
Only treat interface names containing dots specially when resolvectl is
pretending to be resolvconf to fix
https://github.com/systemd/systemd/issues/20014 .
Move the special suffix-stripping behaviour of ifname_mangle out to the
new ifname_resolvconf_mangle to be called from resolvconf only.
(cherry picked from commit
7875170f01991a1d28cfe284cc7075630cd69055)
Yu Watanabe [Wed, 14 Apr 2021 06:50:36 +0000 (15:50 +0900)]
udev: remove unsafe characters from ID_SERIAL for nvme
Fixes #19309.
(cherry picked from commit
5118e8e71dda211d20e34ec8d3012186ba27d3d3)
Yu Watanabe [Wed, 23 Jun 2021 07:58:20 +0000 (16:58 +0900)]
man: update description of "string_escape=" udev option
(cherry picked from commit
91c27ac686261fcca913ac6e3fe1520f38440dcb)
Yu Watanabe [Wed, 23 Jun 2021 07:33:14 +0000 (16:33 +0900)]
udev: fix key name in debug log
(cherry picked from commit
51c2f543d1474c2615fb8282ea90b2954db33a7e)
Yu Watanabe [Wed, 14 Apr 2021 06:13:54 +0000 (15:13 +0900)]
udev: replace unsafe characters on assigning ENV{key}="val" when OPTIONS="string_escape=replace" is set
Strictly speaking, this breaks backward compatibility, as previously
`ENV{key}="val"` ignored `string_escape=` option. But, introducing
a new option such as `string_escape=hoge` sounds overkill for me.
The default escape mode is `ESCAPE_UNSET`, so I hope this merely break
existing rules.
(cherry picked from commit
ea0f4578a7e90f5227817058bfb11bb91dbb1431)
Andrea Pappacoda [Thu, 24 Jun 2021 15:30:51 +0000 (17:30 +0200)]
docs: update autofs Kconfig name
(cherry picked from commit
0c651d32d49e66ea0152eea5e65dd19fe01e7a06)
Zbigniew Jędrzejewski-Szmek [Tue, 8 Jun 2021 07:06:11 +0000 (09:06 +0200)]
man/50-xdg-data-dirs: add quotes as suggested by shellcheck
(cherry picked from commit
aa45911b793255bec34fe8c128c80bda1482cc14)
Lennart Poettering [Thu, 24 Jun 2021 11:13:39 +0000 (13:13 +0200)]
sd-journal: add missing bracket in journal verify log message
(cherry picked from commit
6abd991c718dbc1480ab7e71103a8b3e886bd3a3)
Yu Watanabe [Wed, 23 Jun 2021 16:22:07 +0000 (01:22 +0900)]
sd-dhcp-client: tentatively ignore FORCERENEW command
This makes DHCP client ignore FORCERENEW requests, as unauthenticated
FORCERENEW requests causes a security issue (TALOS-2020-1142, CVE-2020-13529).
Let's re-enable this after RFC3118 (Authentication for DHCP Messages)
and/or RFC6704 (Forcerenew Nonce Authentication) are implemented.
Fixes #16774.
(cherry picked from commit
38e980a6a5a3442c2f48b1f827284388096d8ca5)
Luca Boccassi [Tue, 22 Jun 2021 13:56:19 +0000 (14:56 +0100)]
completion: fix 'unbound variables' errors
Fixes https://github.com/systemd/systemd/issues/19987
(cherry picked from commit
36ec026830c6978be8bd39f3c6d1d7822495e07f)
Luca Boccassi [Tue, 22 Jun 2021 13:55:22 +0000 (14:55 +0100)]
completion/systemd-delta,-resolve: autocomplete with parameters
(cherry picked from commit
6a0667d2b6f05682c2ced1b53132274049b9ea5c)
Hristo Venev [Tue, 22 Jun 2021 09:29:03 +0000 (12:29 +0300)]
networkd: Permit all-zero RoutingPolicyRule prefixes
For example this `From` address range is no longer ignored:
[RoutingPolicyRule]
From=0.0.0.0/8
(cherry picked from commit
2e8a32afbc300e0fe6b624174cd3f3d03467fed8)
Anders Wenhaug [Sun, 20 Jun 2021 19:43:07 +0000 (21:43 +0200)]
time-util: don't use plural units indiscriminately
format_timestamp_relative currently returns the plural form of
years and months no matter the quantity, and in many cases (for
durations > 1 week) this is the same with days.
This patch changes this so that the function takes the quantity into account,
returning "1 month 1 week ago" instead of "1 months 1 weeks ago".
(cherry picked from commit
45eb4d2261ed0d943fd503a6d79ee3b7b7558c09)
plattrap [Fri, 18 Jun 2021 00:32:02 +0000 (12:32 +1200)]
Update systemd-resolved.service.8 help
Text currently refers to `/etc/nsswitch.conf` where it should refer to `/etc/resolv.conf`.
This is in the context of defining a nameserver IP and search domains.
(cherry picked from commit
e83580bfc6e74359ba242d5176d933ea1e723f89)
Eric Cook [Wed, 16 Jun 2021 19:35:12 +0000 (15:35 -0400)]
shell-completion: revert
c1072f6473bafa063cbf700c86524083d2857031
fixing https://github.com/systemd/systemd/issues/19689
(cherry picked from commit
682e043c42fe3ac0fee4ce727458aaeb0e638589)
Jan Macku [Thu, 27 May 2021 10:25:51 +0000 (12:25 +0200)]
core: Hide "Deactivated successfully" message
Show message "Deactivated successfully" in debug mode (when manager is
user) rather than in info mode. This message has low information value
for regular users and it might be a bit overwhelming on a system with
a lot of devices.
(cherry picked from commit
edf2ee22f54005d76b2fb8fdcc9c60974feb88bc)
Yu Watanabe [Wed, 16 Jun 2021 01:32:28 +0000 (10:32 +0900)]
man: fix RFC number and its title
(cherry picked from commit
f4c48492fe3dfa268b6d2457c9ae425b685ca4e0)
Lennart Poettering [Tue, 15 Jun 2021 07:17:12 +0000 (09:17 +0200)]
seccomp: drop quotactl_path() again from filter sets
In the light of https://lwn.net/Articles/859679/ let's drop
quotactl_path() again from the filter set list, as it got backed out
again in 5.13-rc3.
It's likely going to be replaced by quotactl_fd() eventually, but that
hasn't made its way into the tree yet, hence let's not replace the entry
for now.
This partially reverts
34254e599a28529bdb89f91571adeaf7c76d9f43.
(cherry picked from commit
8156422c8f0d94d3444043282f01551084271b22)