1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-08 05:57:26 +03:00

41855 Commits

Author SHA1 Message Date
Lennart Poettering
a3c1ce25a7 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)
2020-02-05 17:26:56 +01:00
Thomas Schmitt
2b9ec8384c 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)
2020-02-05 17:26:52 +01:00
Zbigniew Jędrzejewski-Szmek
ecd95c507c man: fix option name
(cherry picked from commit 95522092925ac7b3526211c9c0c35b5722b43e95)
(cherry picked from commit 7d5060d53994415bc11782cb5f679768c485a29d)
2020-02-05 17:26:48 +01:00
ezst036
0d4f06156b 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)
2020-02-05 17:26:44 +01:00
Lennart Poettering
7fba869abd 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)
2020-02-05 17:26:38 +01:00
Lennart Poettering
494c281b67 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)
2020-02-05 17:26:33 +01:00
Lennart Poettering
7271fb056a 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)
2020-02-05 17:26:29 +01:00
Lennart Poettering
852ae28e68 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)
2020-02-05 17:26:21 +01:00
Yu Watanabe
2613200370 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)
2020-02-05 17:26:06 +01:00
Yu Watanabe
46477397c1 network: lower the log-level of harmless message
Closes #14285.

(cherry picked from commit d6246fd498ab0e4a9a78bcfd4cc1625af16f4784)
(cherry picked from commit 6da978f89b48ce095905167298ade297230d4a3c)
2020-02-05 17:26:01 +01:00
Zbigniew Jędrzejewski-Szmek
7163b1fe86 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)
2020-02-05 17:25:57 +01:00
Frantisek Sumsal
92f90837dc 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)
2020-02-05 17:25:52 +01:00
Topi Miettinen
a67227cc99 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)
2020-02-05 17:25:47 +01:00
Tobias Stoeckmann
cfb4c0aca5 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)
2020-02-05 17:25:43 +01:00
Felipe Sateler
017fddd998 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)
2020-02-05 17:25:33 +01:00
Lennart Poettering
9d5e3cb774 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)
2020-02-05 17:25:22 +01:00
Lennart Poettering
252f1a5277 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)
2020-02-05 17:25:02 +01:00
Zbigniew Jędrzejewski-Szmek
20bbfac95e man: add section about user manager units
(cherry picked from commit 277519db51291c7e11b2120016c39914520f5009)
(cherry picked from commit 3dd98f1998f92f69a4159d1d254dcb3c522ec840)
2020-02-05 17:23:50 +01:00
Zbigniew Jędrzejewski-Szmek
c93ef60212 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)
2020-02-05 17:23:50 +01:00
Lennart Poettering
55e0f99689 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)
2020-02-05 17:23:39 +01:00
Anita Zhang
7afe2ecb02 [man] note which UID ranges will get user journals
Fixes #13926

(cherry picked from commit a1533ad73f099ed7f2c01a69c23ad700fbf249f3)
(cherry picked from commit 56192329138370e43bdce7f9a2a069985fec2eba)
2020-02-05 17:23:33 +01:00
Anita Zhang
a43b67a4c9 [man] fix URL
(cherry picked from commit d59fc29bb742e4258dab0606ab1a95cfaa1ea473)
(cherry picked from commit 588a23ef26841c4e98dee664d2252edb00f37e83)
2020-02-05 17:23:28 +01:00
Topi Miettinen
dedb26a8d6 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)
2020-02-05 17:23:23 +01:00
Dimitri John Ledkov
714c93862a 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)
2020-02-05 17:22:49 +01:00
Lennart Poettering
8932407ae1 man: we support growing xfs too these days
(cherry picked from commit 76b73ce21c0a4063696bd7c777ae12d99cd8fb69)
(cherry picked from commit c0a8a92e6027c4eb4ce6611c4910284f52029f7f)
2020-02-05 17:22:40 +01:00
Lennart Poettering
19af11dc07 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)
2020-02-05 17:22:11 +01:00
Anita Zhang
c90229d81d [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)
2020-02-05 17:22:05 +01:00
Zbigniew Jędrzejewski-Szmek
39910328da 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)
2020-02-05 17:21:49 +01:00
Zbigniew Jędrzejewski-Szmek
fc5e6c87a4 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)
2020-02-05 17:21:32 +01:00
Zbigniew Jędrzejewski-Szmek
409c94a407 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)
2020-02-05 17:19:06 +01:00
Mike Gilbert
70e8c1978a 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)
2019-12-17 10:14:50 +01:00
Lennart Poettering
a0a1977d9a 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)
2019-12-17 09:54:34 +01:00
Dan Streetman
7f936c60d5 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)
2019-12-15 12:40:00 +01:00
Lennart Poettering
b59d88cc62 man: fix typo in net-naming-scheme man page
(cherry picked from commit 955ed5d540fe090687e085d894381f6bf0e57688)
(cherry picked from commit cbced49daaa664484ede8561f417dc767487eaf4)
2019-12-15 12:40:00 +01:00
cheese1
c5e5ac0958 man: fix typos (#14304)
(cherry picked from commit f32d15b0e4f5a0d2c31b22cb66f690a158ae9dfd)
(cherry picked from commit bf4b7d07baa7e917aa4b3addc10e8c55b65771ee)
2019-12-15 12:40:00 +01:00
AJ Bagwell
9a2f26564d 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)
2019-12-15 12:40:00 +01:00
Timo Wilken
bc9e1ebfdd 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)
2019-12-15 12:40:00 +01:00
Yu Watanabe
c6cb71b7e7 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)
2019-12-15 12:40:00 +01:00
Yu Watanabe
67dcdfd956 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)
2019-12-15 12:40:00 +01:00
Jérémy Rosen
a7938a1bc6 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)
2019-12-15 12:40:00 +01:00
Yu Watanabe
53aa44f873 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)
2019-12-15 12:40:00 +01:00
Topi Miettinen
65abf12674 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)
2019-12-15 12:40:00 +01:00
Zbigniew Jędrzejewski-Szmek
b1cf452ff5 systemctl: enhance message about kexec missing kernel
Fixes #7730.

(cherry picked from commit 2fec5854baa6f1262b9cb827bc4a8eb27b376b7d)
(cherry picked from commit 65fd2fce5972d93c38986d9166dc1dd9bba346cf)
2019-12-15 12:40:00 +01:00
Jan Tojnar
07a0e5b425 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)
2019-12-15 12:24:58 +01:00
Lennart Poettering
57dc017c6b journald: don't ask for the machine ID if we don't need it
(cherry picked from commit 806c6a5b97a0bec371c782101a28ff706417b021)
2019-12-15 12:24:48 +01:00
Lennart Poettering
ac392a57c0 journalctl: pager_close() calls fflush(stdout) anyway as first thing
(cherry picked from commit 3aebd9d6dd85c8d949b3b22cf6e96e98febcf157)
2019-12-15 12:24:37 +01:00
Lennart Poettering
ee7dfadc82 journald: remove unused field
(cherry picked from commit c31469e2ee0c84007a1a901bf792a6c0841267b1)
2019-12-15 12:24:25 +01:00
Lennart Poettering
471073f1b5 journalctl: return EOPNOTSUPP if pcre is not enabled
(cherry picked from commit 2275b747414eed2db96d9f276aa53d9a6eaf8be6)
2019-12-15 12:24:16 +01:00
Lennart Poettering
002ededb61 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)
2019-12-15 12:23:42 +01:00
Zbigniew Jędrzejewski-Szmek
fd3bd4be3b pid1: make TimeoutAbortSec settable for transient units
It was documented to be, but implementation was missing.

(cherry picked from commit e737017b856e9c8638a049bb0114eb7d51d6c3cc)
2019-12-15 12:22:54 +01:00