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)
(cherry picked from commit
b78fe3c1b1a81435248deaffe7ee4b594b55b64b)
Sascha Dewald [Sat, 18 Jan 2020 08:17:57 +0000 (08:17 +0000)]
pkgconf: add full generator paths
(cherry picked from commit
fc57f105d9e2b2e9e95bb739d23fa7711b5fa4b3)
(cherry picked from commit
a1561a08f2d5af9ebc68916ce0cb430091a64bce)
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)
(cherry picked from commit
e5f2d11489ec4852f1ad45a1271f502d20602126)
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)
(cherry picked from commit
ea67fd42067b0c4fa9ac7e74b646e3790eccfb82)
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)
(cherry picked from commit
2f23c648bce479ed275b8f337e399880b5795711)
Wieland Hoffmann [Sat, 18 Jan 2020 07:38:29 +0000 (08:38 +0100)]
typo: "May modify to" -> "May modify"
(cherry picked from commit
287cf2d802263c909553689869b2146c67bb765f)
(cherry picked from commit
9ba11dffb09a7f4b63be8a5970fb51d600b53087)
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)
(cherry picked from commit
4c2d72b53091ed8d8e362dca052e5b9fa8325d96)
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)
(cherry picked from commit
c001a285a3a2edfd344756e636f18f226fc291c4)
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)
(cherry picked from commit
45d52c7615fdc3aefb97a13a8d8f4aa90ad7205e)
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)
(cherry picked from commit
b1a0be45b4ee20a2ca4426ff6a9d9fce0664960c)
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)
(cherry picked from commit
e6d694254fe115cc04852732172959998e051b87)
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)
(cherry picked from commit
d8fd38769c36ef9b2e5e122c345bca05ef2be88f)
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)
(cherry picked from commit
cd19bd31d8081f4a97201a20cdaee1fb1d3fafdd)
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)
(cherry picked from commit
1320aa92dc0adc0d08662684b157eb2e3d985ac0)
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)
(cherry picked from commit
14164ec6bc7779201e6ea16c8e8ccff4f98bb4cd)
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)
(cherry picked from commit
c22bf6b31a454e51c707dcd0e6993f09ea6758db)
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)
(cherry picked from commit
26f3a534f1abba5284b1cc97eadb81ece960eb1a)
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)
(cherry picked from commit
377cc5d91ea563c9b6659b7481b020ecff5619d2)
Zbigniew Jędrzejewski-Szmek [Wed, 8 Jan 2020 09:39:44 +0000 (10:39 +0100)]
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)
(cherry picked from commit
98c03090274a067806090e2974fd2091f8206457)
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)
(cherry picked from commit
e9687d09dccf7f6d5093adb280ba96d00f25fbf8)
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)
(cherry picked from commit
7057fe8630079bf778dfa7d3ba841515bcc20eab)
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)
(cherry picked from commit
f8d1df1045bebf9d8878010bcb22fd7afe7f8701)
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)
(cherry picked from commit
1faf5dde4d4a507a612e719c3a7d09d4a2dd5663)
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)
(cherry picked from commit
65d247af178678881b4a3c1ef594910ddf0654b3)
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)
(cherry picked from commit
6da978f89b48ce095905167298ade297230d4a3c)
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)
(cherry picked from commit
5d8a614f926c85ec11d66043d160c63665f0dd56)
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)
(cherry picked from commit
8b1bd17469892de5838509c6794a8a38432c01b0)
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)
(cherry picked from commit
b2f342f92b5447b68c5c61a1d078c62f26ddfd20)
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)
(cherry picked from commit
945f3a231f6fd0b5fa1dd3e11b9223b4c1dff37a)
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)
(cherry picked from commit
2c8ae283b0eebdbc92f4832fca8e46a00be5b246)
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)
(cherry picked from commit
6b48479f458257ff1769c88d46208ba56209b067)
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)
(cherry picked from commit
faba5b2ba8c9cc07e431ab02b4917fc782cb89b9)
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)
(cherry picked from commit
3dd98f1998f92f69a4159d1d254dcb3c522ec840)
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)
(cherry picked from commit
1c80a8ced006f92dc83e7ec36edd0005d4e54a76)
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)
(cherry picked from commit
9afd65f15e931f777e2ba3743560d63505c90ac7)
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)
(cherry picked from commit
56192329138370e43bdce7f9a2a069985fec2eba)
Anita Zhang [Thu, 19 Dec 2019 00:08:53 +0000 (16:08 -0800)]
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)
(cherry picked from commit
0130a03179f687c050247ee7e4367f0f4987a7f2)
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)
(cherry picked from commit
946cdba156dd385ffa86131664d808f36aaa24b7)
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)
(cherry picked from commit
c0a8a92e6027c4eb4ce6611c4910284f52029f7f)
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)
(cherry picked from commit
608d882734946f201c9db64777ef877c52b3a6b1)
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)
(cherry picked from commit
cfced59a4bd88e7d77ecf9ed40a22ec215356a83)
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)
(cherry picked from commit
dc56b94e13089bbabcf75d962a11fec26b829093)
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)
(cherry picked from commit
0757ad565573ad96ad8c3b4957ecf850fcc97042)
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)
(cherry picked from commit
d2471109d99912de5cf50fd060295d4ddf681027)
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)
Lennart Poettering [Thu, 14 Nov 2019 16:51:30 +0000 (17:51 +0100)]
seccomp: more comprehensive protection against libseccomp's __NR_xyz namespace invasion
A follow-up for
59b657296a2fe104f112b91bbf9301724067cc81, adding the
same conditioning for all cases of our __NR_xyz use.
Fixes: #14031
(cherry picked from commit
4df8fe8415eaf4abd5b93c3447452547c6ea9e5f)
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)
(cherry picked from commit
639dc9f4bfd2c09535bee079ae9bc7006b520a66)
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)
(cherry picked from commit
cbced49daaa664484ede8561f417dc767487eaf4)
cheese1 [Wed, 11 Dec 2019 09:33:13 +0000 (10:33 +0100)]
man: fix typos (#14304)
(cherry picked from commit
f32d15b0e4f5a0d2c31b22cb66f690a158ae9dfd)
(cherry picked from commit
bf4b7d07baa7e917aa4b3addc10e8c55b65771ee)
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)
(cherry picked from commit
1ba2e7a73000fedbf4b9a9af3a3e893f5f26eb9d)
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)
(cherry picked from commit
bcf0aa02bf68cfd8b55ecaa5221a246a63a9646f)
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)
(cherry picked from commit
96d7083c5499b264ecebd6a30a92e0e8fda14cd5)
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)
(cherry picked from commit
e874419902892d4bc272475b14446fe8385b0e8b)
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)
(cherry picked from commit
29c9144655de34494c424a36b6b42e2776db817e)
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)
(cherry picked from commit
9cbb8b5254378de10f6be06585cf264ab4457dac)
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)
(cherry picked from commit
c08429ae339089a04be21c65d2ecd0dd784102ba)
Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2019 11:54:52 +0000 (11:54 +0000)]
systemctl: enhance message about kexec missing kernel
Fixes #7730.
(cherry picked from commit
2fec5854baa6f1262b9cb827bc4a8eb27b376b7d)
(cherry picked from commit
65fd2fce5972d93c38986d9166dc1dd9bba346cf)
Jan Tojnar [Thu, 28 Nov 2019 11:42:01 +0000 (12:42 +0100)]
man: use mkswap@ instead of makeswap@
That is what is linked from systemd.swap(5) and also what the systemd.generator produces.
(cherry picked from commit
88eb0519722f285e5264a909f16ddf2648190681)
Lennart Poettering [Mon, 25 Nov 2019 13:08:53 +0000 (14:08 +0100)]
journald: don't ask for the machine ID if we don't need it
(cherry picked from commit
806c6a5b97a0bec371c782101a28ff706417b021)
Lennart Poettering [Tue, 26 Nov 2019 10:28:33 +0000 (11:28 +0100)]
journalctl: pager_close() calls fflush(stdout) anyway as first thing
(cherry picked from commit
3aebd9d6dd85c8d949b3b22cf6e96e98febcf157)
Lennart Poettering [Wed, 27 Nov 2019 12:03:26 +0000 (13:03 +0100)]
journald: remove unused field
(cherry picked from commit
c31469e2ee0c84007a1a901bf792a6c0841267b1)
Lennart Poettering [Mon, 25 Nov 2019 17:44:40 +0000 (18:44 +0100)]
journalctl: return EOPNOTSUPP if pcre is not enabled
(cherry picked from commit
2275b747414eed2db96d9f276aa53d9a6eaf8be6)
Lennart Poettering [Thu, 28 Nov 2019 09:36:08 +0000 (10:36 +0100)]
man: drop reference to machined, add one for journald instead
We dropped documentation from sd_journal_open_container() long ago
(since the call is obsolete), hence drop the reference to machined. But
add one in for journald instead.
(cherry picked from commit
d18df32d8229aff0bed41e9fe2a7a61598d70c89)
Zbigniew Jędrzejewski-Szmek [Wed, 27 Nov 2019 12:42:57 +0000 (13:42 +0100)]
pid1: make TimeoutAbortSec settable for transient units
It was documented to be, but implementation was missing.
(cherry picked from commit
e737017b856e9c8638a049bb0114eb7d51d6c3cc)
Zbigniew Jędrzejewski-Szmek [Wed, 27 Nov 2019 12:13:17 +0000 (13:13 +0100)]
pid1: fix setting of DefaultTimeoutAbortSec
This partially reverts
a07a7324adf504381e9374d1f1a5db6edaa46435.
We have two pieces of information: the value and a boolean.
config_parse_timeout_abort() added in the reverted commit would write
the boolean to the usec_t value, making a mess.
The code is reworked to have just one implementation and two wrappers
which pass two pointers.
(cherry picked from commit
a61d68748afef4814760774eb0458a46d4ea9922)
Kevin Kuehler [Thu, 28 Nov 2019 00:35:15 +0000 (16:35 -0800)]
shared/ask-password-api: modify keyctl break value
We can break if KEYCTL_READ return value is equal to our buffer size.
From keyctl(2):
On a successful return, the return value is always the total size of
the payload data. To determine whether the buffer was of sufficient
size, check to see that the return value is less than or equal to the
value supplied in arg4.
(cherry picked from commit
6da498c28f2598bea4d651756485f57d54e379f4)
Michal Sekletár [Wed, 27 Nov 2019 13:27:58 +0000 (14:27 +0100)]
cryptsetup: reduce the chance that we will be OOM killed
cryptsetup introduced optional locking scheme that should serialize
unlocking keyslots which use memory hard key derivation
function (argon2). Using the serialization should prevent OOM situation
in early boot while unlocking encrypted volumes.
(cherry picked from commit
408c81f62454684dfbff1c95ce3210d06f256e58)
Lennart Poettering [Wed, 27 Nov 2019 11:05:38 +0000 (12:05 +0100)]
core: write out correct field name when creating transient service units
(cherry picked from commit
f14bf013126ebcdc689995234cb15fc0b605a262)
Martin Wilck [Tue, 26 Nov 2019 17:39:09 +0000 (18:39 +0100)]
udevd: don't use monitor after manager_exit()
If udevd receives an exit signal, it releases its reference on the udev
monitor in manager_exit(). If at this time a worker is hanging, and if
the event timeout for this worker expires before udevd exits, udevd
crashes in on_sigchld()->udev_monitor_send_device(), because the monitor
has already been freed.
Fix this by testing the validity of manager->monitor in on_sigchld().
(cherry picked from commit
030f4571670537c76355c5d923468c9a61aa77e9)
Martin Wilck [Tue, 26 Nov 2019 17:36:46 +0000 (18:36 +0100)]
Revert "udevd: fix crash when workers time out after exit is signal caught"
This reverts commit
5db454b8031c58a743cc4ee3d5d1dd01dcff17e8.
See https://github.com/systemd/systemd/issues/14128
(cherry picked from commit
3cabdc2345608b01e344a52fe6f8c3c378406ebc)
Paul Menzel [Tue, 26 Nov 2019 21:52:17 +0000 (22:52 +0100)]
man/systemd.link: Add missing verb *be*
(cherry picked from commit
a19b9a382711110c99365a24bd4da2b848f2b7d5)
Zbigniew Jędrzejewski-Szmek [Sun, 24 Nov 2019 12:59:32 +0000 (13:59 +0100)]
man: document all pager variables for systemctl and systemd
In those two pages, we need to include individual entries with xi:include to
merge the list less-variables.xml with the other entries, which is obviously
error prone. All variables are supported in both tools so add them.
(cherry picked from commit
3d58bfc01c9283eded77736990ea09b0ee4f6e23)
Mike Kazantsev [Mon, 25 Nov 2019 23:29:03 +0000 (04:29 +0500)]
core.timer: fix "systemd-analyze dump" and docs syntax inconsistencies wrt OnTimezoneChange=
(cherry picked from commit
0810e396284998afef945f982304bc86d245e26d)
Zbigniew Jędrzejewski-Szmek [Fri, 22 Nov 2019 13:19:51 +0000 (14:19 +0100)]
core/service: downgrade "scheduling restart" message to debug
I see we log this during every boot, even though it is a routine expected event:
Nov 12 14:50:01 krowka systemd[1]: systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
(and for other services too). Let's downgrade this to debug level.
https://bugzilla.redhat.com/show_bug.cgi?id=
1614871
(cherry picked from commit
868f7d36cc26552cc7377a6a81913fa8803bc3bb)
Yu Watanabe [Sun, 24 Nov 2019 09:29:57 +0000 (18:29 +0900)]
travis: add missing closing quote sign
Fixes #14127.
(cherry picked from commit
8c99d40d47292e8c1be8c159943a2d8781b9d3e9)
Pascal de Bruijn [Fri, 22 Nov 2019 08:20:20 +0000 (09:20 +0100)]
systemd-tmpfiles: don't install timer when service isn't installed either
Fixes: systemd-tmpfiles-clean.timer: Refusing to start, unit
systemd-tmpfiles-clean.service to trigger not loaded.
(cherry picked from commit
b4e2236a724274887c561434468387d4945ec61e)
Lennart Poettering [Mon, 19 Aug 2019 13:15:13 +0000 (15:15 +0200)]
pam_systemd: prolong method call timeout when allocating session
Starting a session might involve starting the user@.service instance,
hence let's make the bus call timeout substantially longer.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83828
(cherry picked from commit
fbcb630045f9d13d6d4b16ba376b0cf27bf1e2d5)
Yu Watanabe [Mon, 18 Nov 2019 15:03:35 +0000 (00:03 +0900)]
man: add entry about SpeedMeter=
Closes #14002.
(cherry picked from commit
c9fdaed079524942445a1bbbb975766768ad9b04)
Yu Watanabe [Mon, 18 Nov 2019 10:28:11 +0000 (19:28 +0900)]
udev: silence warning about PROGRAM+= or IMPORT+= rules
Closes #14062.
(cherry picked from commit
f0beb6f816035e438d684cc52ae76fc4a44fc197)
Yu Watanabe [Mon, 18 Nov 2019 09:47:16 +0000 (18:47 +0900)]
udevadm: ignore EROFS and return earlier
Fixes #14060.
(cherry picked from commit
dc11d2bf6602558770e61f772d925ba8dcc71233)
Cyprien Laplace [Thu, 14 Nov 2019 14:42:14 +0000 (09:42 -0500)]
basic: add vmware hypervisor detection from device-tree
Allow ConditionVirtualization=vmware to work on ESXi on arm VMs
using device-tree.
(cherry picked from commit
4d4ac92c928fcbc60b85fcbf8370af3883ee63db)
Lennart Poettering [Fri, 15 Nov 2019 13:57:27 +0000 (14:57 +0100)]
umount: be happy if /proc/swaps doesn't exist
Kernels work without swap just fine.
Fixes: #13993
(cherry picked from commit
2cdd0d612d18732db845f2f44f217d6e00c62010)
Lennart Poettering [Fri, 15 Nov 2019 13:56:35 +0000 (14:56 +0100)]
shutdown: make logging more useful if NULL swap/mount table files are specified
Makes the error output seen in #13993 more readable.
(cherry picked from commit
f795267e3ad419c1f40dec0d3aef77cb8db3b841)
Zbigniew Jędrzejewski-Szmek [Fri, 15 Nov 2019 10:59:34 +0000 (11:59 +0100)]
man: share description of $SYSTEMD_COLORS in other tools
It was only described in systemd(1), making it hard to discover.
Fixes #13561.
The same for $SYSTEMD_URLIFY.
I think all the tools whose man pages include less-variables.xml support
those variables.
(cherry picked from commit
339bf2076b3294e5f7b59e84c59ba8c55ded3c25)
Zbigniew Jędrzejewski-Szmek [Thu, 14 Nov 2019 13:28:05 +0000 (14:28 +0100)]
core: do not propagate polkit error to caller
If we fail to start polkit, we get a message like
"org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer.",
which has no meaning for the caller of our StartUnit method. Let's just
return -EACCES.
$ systemctl start apache
Failed to start apache.service: Could not activate remote peer. (before)
Failed to start apache.service: Access denied (after)
Fixes #13865.
(cherry picked from commit
7edd8fb198f3e8a95677df8a8f5016ed40dcff54)
Lennart Poettering [Wed, 13 Nov 2019 19:07:31 +0000 (20:07 +0100)]
ask-password: don't hit assert() when we query pw which the user C-d and caching is enabled
(cherry picked from commit
e013e10d0e96917b627d54f20e3dba80a17df0d5)
Zbigniew Jędrzejewski-Szmek [Wed, 13 Nov 2019 20:55:30 +0000 (21:55 +0100)]
man: mention $RUNTIME_DIRECTORY & friends in environment list
(cherry picked from commit
1f6597a84cd3891a69a630c6c4b168da46b1c160)
Zbigniew Jędrzejewski-Szmek [Wed, 13 Nov 2019 09:32:30 +0000 (10:32 +0100)]
cryptsetup-generator: guess whether the keyfile argument is two items or one
Fixes #13615.
See the inline comment for documentation.
(cherry picked from commit
32c6237a7c2e697d2fc4f3403319db16858fb8e3)
HATAYAMA Daisuke [Wed, 13 Nov 2019 11:30:58 +0000 (06:30 -0500)]
verify: fix segmentation fault
systemd-analyze verify command now results in segmentation fault if two
consecutive non-existent unit file names are given:
# ./build/systemd-analyze a.service b.service
...<snip irrelevant part>...
Unit a.service not found.
Unit b.service not found.
Segmentation fault (core dumped)
The cause of this is a wrong handling of return value of
manager_load_startable_unit_or_warn() in verify_units() in failure case.
It looks that the current logic wants to assign the first error status
throughout verify_units() into variable r and count up variable count only when
a given unit file exists.
However, due to the wrong handling of the return value of
manager_load_startable_unit_or_warn() in verify_units(), the variable count is
unexpectedly incremented even when there is no such unit file because the
variable r already contains non-zero value in the 2nd failure, set by the 1st
failure, and then the condition k < 0 && r == 0 evaluates to false.
This commit fixes the wrong handling of return value of
manager_load_startable_unit_or_warn() in verify_units().
(cherry picked from commit
fc9de36a3b60c69a17442aabf215e2d87e697e6f)
Lennart Poettering [Wed, 13 Nov 2019 09:39:09 +0000 (10:39 +0100)]
timedated: it might be that tzinfo files are just not installed
(cherry picked from commit
5322db0651e1c29b61e2b42764b538722106522c)
Lennart Poettering [Wed, 13 Nov 2019 09:32:44 +0000 (10:32 +0100)]
timedated: handle UTC specially, when generating /etc/localtime
(cherry picked from commit
9193af0f059538f4e5ca06502a998e9cc02819a1)
Lennart Poettering [Wed, 13 Nov 2019 09:32:26 +0000 (10:32 +0100)]
time-util: treat /etc/localtime missing as UTC
(cherry picked from commit
bc9ecd484f1ebfe0de8b567c90f6cd867fbd5894)
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 12:32:36 +0000 (13:32 +0100)]
bpf: fix off-by-one in class whitelisting
We would jump one insn too many, landing in the middle of the subsequent block.
(cherry picked from commit
a72a5326a47733f057d1bea1ddb319b779165f8d)
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2019 12:13:31 +0000 (13:13 +0100)]
bpf: fix device type filter
On big endian arches, we were taking the wrong half-word, so the check
was giving bogus results.
https://bugzilla.redhat.com/show_bug.cgi?id=
1769148.
(cherry picked from commit
415fe5ec7d38db5e8e0b97c68e462734f543ad17)
Zbigniew Jędrzejewski-Szmek [Fri, 8 Nov 2019 07:55:54 +0000 (08:55 +0100)]
core: constify bpf program arrays
In cases where the programs were modified after being initially declared,
reorder operations so that the declaration is already in final form.
(cherry picked from commit
2899aac46a8d8d5cf1aa5cbf04f755ef7b9f9643)
Zbigniew Jędrzejewski-Szmek [Tue, 29 Oct 2019 17:07:07 +0000 (18:07 +0100)]
run: propagate return code/status from the child
Fixes #13756. We were returning things that didn't make much sense:
we would always use the exit_code value as the exit code. But it sometimes
contains a exit code from the process, and sometimes the number of a signal
that was used to kill the process. We would also ignore SuccessExitStatus=
and in general whether systemd thinks the service exited successfully
(hence the issue in #13756, where systemd would return success/SIGTERM,
but we'd just look at the SIGTERM part.)
If we are doing --wait, let's always propagate the exit code/status from
the child.
While at it, make the documentation useful.
(cherry picked from commit
7f3614e5479446bbd5a2bdf6aed4962e8d803e35)
Martin Wilck [Tue, 12 Nov 2019 15:43:42 +0000 (16:43 +0100)]
udevd: fix crash when workers time out after exit is signal caught
If udevd receives an exit signal, it releases its reference on the udev
monitor in manager_exit(). If at this time a worker is hanging, and if
the event timeout for this worker expires before udevd exits, udevd
crashes in on_sigchld()->udev_monitor_send_device(), because the monitor
has already been freed.
Fix this by releasing the main process's monitor ref later, in
manager_free().
(cherry picked from commit
7b6596d7489421842af854ed16333ea747879732)
Yu Watanabe [Tue, 12 Nov 2019 05:58:25 +0000 (14:58 +0900)]
udev: ignore error caused by device disconnection
During an add or change event, the device may be disconnected.
Fixes #13976.
(cherry picked from commit
b64b83d13eedfdfc616c16c4a108ef28bf6d3b33)