Yu Watanabe [Thu, 29 Oct 2020 07:11:40 +0000 (16:11 +0900)]
journalctl: drop format_journal_url() if gcrypt is not used
Follow-up for
f1b823596f8a4dc6b1f76206b7473bac71e3840b.
Luca Weiss [Wed, 28 Oct 2020 21:11:23 +0000 (22:11 +0100)]
Update org.freedesktop.hostname1 documentation
This documents the polkit actions for `SetDeployment()` and `SetLocation()` which previously were undocumented.
Zbigniew Jędrzejewski-Szmek [Wed, 28 Oct 2020 17:21:13 +0000 (18:21 +0100)]
Merge pull request #17435 from poettering/event-shuffle-refactor
sd-event: split up sd_event_source_set_enable() function
Zbigniew Jędrzejewski-Szmek [Wed, 28 Oct 2020 17:20:27 +0000 (18:20 +0100)]
Merge pull request #17454 from keszybz/journal-dlopen-cleanup
Journal dlopen cleanup and qrcode printing test
Zbigniew Jędrzejewski-Szmek [Wed, 28 Oct 2020 17:00:04 +0000 (18:00 +0100)]
Merge pull request #17467 from keszybz/unconditionally-pull-in-cryptsetup-remote
Unconditionally pull in cryptsetup-remote.target in the initramfs
Lennart Poettering [Wed, 28 Oct 2020 09:09:12 +0000 (10:09 +0100)]
Merge pull request #17471 from keszybz/man-update-fedora-version
Update fedora version in man pages
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 19:20:57 +0000 (20:20 +0100)]
Merge pull request #17455 from poettering/packet-auxdata
add Timestamping= to socket units and some other .socket unit tweaks
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 17:43:34 +0000 (18:43 +0100)]
Merge pull request #17438 from anitazha/systoomd_quick
Additional fix ups from #17417
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 09:19:15 +0000 (10:19 +0100)]
meson: fix setting of ENABLE_OOMD
-Doomd=auto (the default) didn't work as intended because the initial correct
value was overwritten later by logic that didn't check for 'auto'.
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2020 11:20:38 +0000 (12:20 +0100)]
test: add a simple test for the qr printing code
Ideally, we'd read back what we wrote, but that would have been
much more complicated. But just writing stuff is useful to test under
valgrind or manually.
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2020 11:11:21 +0000 (12:11 +0100)]
journal,homectl: unify implementations of libqrencode loading and fss key printing
We had two of each: both homectl and journalctl had the whole dlopen()
wrapper, and journalctl had two implementations (slightly different) of the
code to print the fss:// pattern.
print_qrcode() now returns -EOPNOTSUPP when compiled with qrcode support. Both
callers ignore the return value, so this changes nothing.
No functional change.
Timo Rothenpieler [Tue, 27 Oct 2020 09:55:41 +0000 (10:55 +0100)]
network: actually update radv mac
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:56 +0000 (16:01 +0100)]
man: update fedora version
F33 was released today!
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:16 +0000 (16:01 +0100)]
man/machinectl: fix pull-raw example
We do not allow machine names with "_", so the command would fail as written.
Share the example with the systemd-nspawn page instead.
Lennart Poettering [Mon, 26 Oct 2020 16:41:06 +0000 (17:41 +0100)]
units: turn on timestamping for journald sockets
To make things simple and robust when debugging journald, we'll leave
the SO_TIMESTAMP invocations in the C code in place, even if they are
now typically redundant, given that the sockets are already passed into
the process with SO_TIMESTAMP turned on now.
Lennart Poettering [Mon, 26 Oct 2020 16:40:55 +0000 (17:40 +0100)]
man: document the new Timestamping= option
Lennart Poettering [Mon, 26 Oct 2020 16:39:14 +0000 (17:39 +0100)]
core: add Timestamping= option for socket units
This adds a way to control SO_TIMESTAMP/SO_TIMESTAMPNS socket options
for sockets PID 1 binds to.
This is useful in journald so that we get proper timestamps even for
ingress log messages that are submitted before journald is running.
We recently turned on packet info metadata from PID 1 for these sockets,
but the timestamping info was still missing. Let's correct that.
Lennart Poettering [Mon, 26 Oct 2020 16:38:55 +0000 (17:38 +0100)]
conf-parser: add a flavour of DEFINE_CONFIG_PARSE_ENUM() that allows specifiying the precie from_string() function to call
Lennart Poettering [Mon, 26 Oct 2020 15:31:07 +0000 (16:31 +0100)]
journald: remove pointless conditionalization
Let's not have #ifdeffery both in the consumers and the providers of the
selinux glue code. Unless the code is particularly complex, let's do the
ifdeffery only in the provider of the selinux glue code, and let's keep
the consumers simple and just invoke it.
Lennart Poettering [Mon, 26 Oct 2020 15:19:24 +0000 (16:19 +0100)]
socket-util: make socket_set_recvpktinfo control PACKET_AUXDATA sockopt on AF_PACKET
Just for the sake of completness.
Lennart Poettering [Mon, 26 Oct 2020 15:19:10 +0000 (16:19 +0100)]
man: add references to fifo(7) and mq_overview(7) man pages
Lennart Poettering [Tue, 27 Oct 2020 08:55:59 +0000 (09:55 +0100)]
tree-wide: cast result of get_process_comm() to (void) where we ignore it
Lennart Poettering [Fri, 23 Oct 2020 19:21:58 +0000 (21:21 +0200)]
sd-event: split out enable and disable codepaths from sd_event_source_set_enabled()
So far half of sd_event_source_set_enabled() was doing enabling, the
other half was doing disabling. Let's split that into two separate
calls.
(This also adds a new shortcut to sd_event_source_set_enabled(): if the
caller toggles between "ON" and "ONESHOT" we'll now shortcut this, since
the event source is already enabled in that case and shall remain
enabled.)
This heavily borrows and is inspired from Michal Sekletár's #17284
refactoring.
Michal Sekletár [Fri, 23 Oct 2020 16:29:27 +0000 (18:29 +0200)]
sd-event: split out helper functions for reshuffling prioqs
We typically don't just reshuffle a single prioq at once, but always
two. Let's add two helper functions that do this, and reuse them
everywhere.
(Note that this drops one minor optimization:
sd_event_source_set_time_accuracy() previously only reshuffled the
"latest" prioq, since changing the accuracy has no effect on the
earliest time of an event source, just the latest time an event source
can run. This optimization is removed to simplify things, given that
it's not really worth the effort as prioq_reshuffle() on properly
ordered prioqs has practically zero cost O(1)).
(Slightly generalized, commented and split out of #17284 by Lennart)
Jonathan Lebon [Tue, 27 Oct 2020 12:29:38 +0000 (13:29 +0100)]
units: unconditionally pull in remote-cryptsetup.target in the initramfs
[zjs: Replaces #17149.
I took half of the patch in
https://github.com/systemd/systemd/pull/17149#issuecomment-
698399194,
hence I'm keeping Jonathan's authorship.
The original reasoning for
6c5496c492a8d74e54d22bf8824160cab1e63c10 was that we
enable remote-cryptsetup.target via presets, and since presets are not used for
the initrd, we need a different target. But since parts of the unit and target
tree are shared between the initramfs and the main system, we can't just create
a separate target for the initramfs. All the targets that depend on this one
would need to be split also. That condition is true for initrd-fs.target, but
not for sysinit.target.
So let's instead just uncoditionally pull in remote-cryptsetup.target in the
initramfs. It should normally be empty, so there should be no impact on boots
that don't have units in the target.
Jonathan's patch used initrd-root-fs.target, this version instead uses
initrd-root-device.target. initrd-root-device.target is ordered before
sysroot.mount, which means that the decrypted devices will be available earlier
too.]
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 12:26:01 +0000 (13:26 +0100)]
Revert "units: add initrd-cryptsetup.target"
This reverts commit
6c5496c492a8d74e54d22bf8824160cab1e63c10.
sysinit.target is shared between the initrd and the host system. Pulling in
initrd-cryptsetup.target into sysinit.target causes the following warning at
boot:
Oct 27 10:42:30 workstation-uefi systemd[1]: initrd-cryptsetup.target: Starting requested but asserts failed.
Oct 27 10:42:30 workstation-uefi systemd[1]: Assertion failed for initrd-cryptsetup.target.
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 09:49:11 +0000 (10:49 +0100)]
meson: simplify with_runlevels ternany op usage
Anita Zhang [Fri, 23 Oct 2020 05:44:22 +0000 (22:44 -0700)]
core: clean up inactive/failed {service|scope}'s cgroups when the last process exits
If processes remain in the unit's cgroup after the final SIGKILL is
sent and the unit has exceeded stop timeout, don't release the unit's
cgroup information. Pid1 will have failed to `rmdir` the cgroup path due
to processes remaining in the cgroup and releasing would leave the cgroup
path on the file system with no tracking for pid1 to clean it up.
Instead, keep the information around until the last process exits and pid1
sends the cgroup empty notification. The service/scope can then prune
the cgroup if the unit is inactive/failed.
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2020 12:54:20 +0000 (13:54 +0100)]
syscall-names: add process_madvise which is planned for 5.10
It was added in
v5.9-11793-gecb8ac8b1f and is still present in v5.10-rc1, so it
seems likely that it'll be in 5.10 too.
AsciiWolf [Mon, 26 Oct 2020 21:48:34 +0000 (22:48 +0100)]
l10n: update Czech Translation
Anita Zhang [Tue, 27 Oct 2020 07:16:25 +0000 (00:16 -0700)]
docs: update coding style for `return (void) func(...)`
Seems that people think it's useful for brevity so make it explicit in
the CODING_STYLE.
Josh Brobst [Mon, 26 Oct 2020 22:45:51 +0000 (18:45 -0400)]
man: correct xdg-autostart-generator path
Zbigniew Jędrzejewski-Szmek [Mon, 26 Oct 2020 19:43:18 +0000 (20:43 +0100)]
NEWS: v247-rc1
Zbigniew Jędrzejewski-Szmek [Mon, 26 Oct 2020 19:41:36 +0000 (20:41 +0100)]
NEWS: update contributors list for v247-rc1
Zbigniew Jędrzejewski-Szmek [Mon, 26 Oct 2020 19:27:41 +0000 (20:27 +0100)]
NEWS: mention IPv6PrefixDelegation→IPv6SendRA renaming
Pat Coulthard [Sun, 25 Oct 2020 21:45:13 +0000 (16:45 -0500)]
tmpfiles: Handle filesystems without ACL support in more cases.
Elias Probst [Sat, 24 Oct 2020 13:42:27 +0000 (15:42 +0200)]
NEWS: fix typo (`systemd-userdb` > `systemd-userdbd`)
Yu Watanabe [Sat, 24 Oct 2020 03:46:27 +0000 (12:46 +0900)]
test-network: add a test case for DNSSL in RA
Closes #4590.
Zbigniew Jędrzejewski-Szmek [Sat, 24 Oct 2020 11:44:10 +0000 (13:44 +0200)]
Merge pull request #17430 from yuwata/network-drop-foreign-routes-managed-by-manager
network: drop routes managed by Manager when they are not requested
Dan Streetman [Fri, 23 Oct 2020 19:50:28 +0000 (15:50 -0400)]
test: ignore ENOMEDIUM error from sd_pid_get_cgroup()
Ubuntu builds on the Launchpad infrastructure run inside a chroot that does
not have the sysfs cgroup dirs mounted, so this call will return ENOMEDIUM
from cg_unified_cached() during the build-time testing, for example when
building the package in a Launchpad PPA.
Yu Watanabe [Sat, 24 Oct 2020 03:07:19 +0000 (12:07 +0900)]
tree-wide: fix typos found by Fossies codespell report
Yu Watanabe [Tue, 13 Oct 2020 12:11:36 +0000 (21:11 +0900)]
Revert "sd-dhcp-client: use asynchronous_close()"
This effectively reverts the commit
22fc2420b2a7220addcee33c2fa17ada44d87f9c.
The function `asynchronous_close()` confuses valgrind. Before this commit,
valgrind may report the following:
```
HEAP SUMMARY:
in use at exit: 384 bytes in 1 blocks
total heap usage: 4,787 allocs, 4,786 frees, 1,379,191 bytes allocated
384 bytes in 1 blocks are possibly lost in loss record 1 of 1
at 0x483CAE9: calloc (vg_replace_malloc.c:760)
by 0x401456A: _dl_allocate_tls (in /usr/lib64/ld-2.31.so)
by 0x4BD212E: pthread_create@@GLIBC_2.2.5 (in /usr/lib64/libpthread-2.31.so)
by 0x499B662: asynchronous_job (async.c:47)
by 0x499B7DC: asynchronous_close (async.c:102)
by 0x4CFA8B: client_initialize (sd-dhcp-client.c:696)
by 0x4CFC5E: client_stop (sd-dhcp-client.c:725)
by 0x4D4589: sd_dhcp_client_stop (sd-dhcp-client.c:2134)
by 0x493C2F: link_stop_clients (networkd-link.c:620)
by 0x4126DB: manager_free (networkd-manager.c:867)
by 0x40D193: manager_freep (networkd-manager.h:97)
by 0x40DAFC: run (networkd.c:20)
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 384 bytes in 1 blocks
still reachable: 0 bytes in 0 blocks
suppressed: 0 bytes in 0 blocks
For lists of detected and suppressed errors, rerun with: -s
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```
Yu Watanabe [Sat, 24 Oct 2020 03:16:44 +0000 (12:16 +0900)]
Merge pull request #17429 from keszybz/revert-17188
Revert the change to allow arbitrary environment variable names
Anita Zhang [Fri, 23 Oct 2020 22:47:07 +0000 (15:47 -0700)]
test: make TEST-56-OOMD service unit files static
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 18:35:47 +0000 (20:35 +0200)]
shared/qrcode-util: reduce scope of iterator variables
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 18:19:05 +0000 (20:19 +0200)]
meson: sort include dirs
Our headers should have unique names, so the sort order shouldn't matter.
Lennart Poettering [Fri, 23 Oct 2020 15:50:04 +0000 (17:50 +0200)]
Merge pull request #17427 from poettering/v247-bump
preparation for v247-rc1
Yu Watanabe [Fri, 23 Oct 2020 14:06:13 +0000 (23:06 +0900)]
test-network: add tests for routes managed by Manager
Yu Watanabe [Fri, 23 Oct 2020 08:01:30 +0000 (17:01 +0900)]
network: drop routes managed by Manager when link is removed
Also, foreign routes managed by Manager are dropped in
link_drop_foreign_routes().
Yu Watanabe [Fri, 23 Oct 2020 13:40:57 +0000 (22:40 +0900)]
network: specify route type in route_remove()
This factors out the common netlink message handling in route_remote()
and route_configure() to route_set_netlink_message().
Yu Watanabe [Fri, 23 Oct 2020 13:19:16 +0000 (22:19 +0900)]
network: link may be NULL
Yu Watanabe [Fri, 23 Oct 2020 08:32:19 +0000 (17:32 +0900)]
network: ignore error in writing proxy_ndp
This partially reverts the commit
fd773a11d8e2b01e9e6d234ca5693417c0101fca.
As, IPv6 may be disabled by kernel.
Yu Watanabe [Fri, 23 Oct 2020 08:29:49 +0000 (17:29 +0900)]
network: fix typo
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 13:47:33 +0000 (15:47 +0200)]
man: document what variables are allowed
Lennart Poettering [Fri, 23 Oct 2020 13:45:17 +0000 (15:45 +0200)]
update TODO
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 12:24:32 +0000 (14:24 +0200)]
Revert "basic/env-util: (mostly) follow POSIX for what variable names are allowed"
This reverts commit
b45c068dd8fac7661a15e99e7cf699ff06010b13.
I think the idea was generally sound, but didn't take into account the
limitations of show-environment and how it is used. People expect to be able to
eval systemctl show-environment output in bash, and no escaping syntax is
defined for environment *names* (we only do escaping for *values*). We could
skip such problematic variables in 'systemctl show-environment', and only allow
them to be inherited directly. But this would be confusing and ugly.
The original motivation for this change was that various import operations
would fail.
a4ccce22d9552dc74b6916cc5ec57f2a0b686b4f changed systemctl to filter
invalid variables in import-environment.
https://gitlab.gnome.org/GNOME/gnome-session/-/issues/71 does a similar change
in GNOME. So those problematic variables should not cause failures, but just
be silently ignored.
Finally, the environment block is becoming a dumping ground. In my gnome
session 'systemctl show-environment --user' includes stuff like PWD, FPATH
(from zsh), SHLVL=0 (no idea what that is). This is not directly related to
variable names (since all those are allowed under the stricter rules too), but
I think we should start pushing people away from running import-environment and
towards importing only select variables.
https://github.com/systemd/systemd/pull/17188#issuecomment-
708676511
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 11:49:05 +0000 (13:49 +0200)]
basic/env-util: make function shorter
Lennart Poettering [Fri, 23 Oct 2020 11:39:24 +0000 (13:39 +0200)]
build-sys: prepare 247-rc1
Interestingly, the libudev so version was already bumped.
Lennart Poettering [Fri, 23 Oct 2020 11:44:16 +0000 (13:44 +0200)]
update hwdb
Lennart Poettering [Fri, 23 Oct 2020 11:15:04 +0000 (13:15 +0200)]
Merge pull request #16859 from poettering/loop-eagain
loop: handle EAGAIN on LOOP_SET_STATUS64
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 11:06:51 +0000 (13:06 +0200)]
Merge pull request #17417 from anitazha/more_systoomd
More systemd-oomd tweaks
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 06:22:09 +0000 (08:22 +0200)]
Merge pull request #17185 from yuwata/ethtool-update
ethtool: add several link modes
Yu Watanabe [Fri, 23 Oct 2020 03:57:58 +0000 (12:57 +0900)]
Merge pull request #17357 from yuwata/network-dhcp6-pd-announce-17353
network: add an option to control announcement of delegated prefix
Dan Streetman [Wed, 17 Jun 2020 20:28:39 +0000 (16:28 -0400)]
network: move set-MAC and set-nomaster operations out of link_up()
These should not be bundled into the link_up() operation, as that is
not (currently) called during interface configuration if the interface
already is IFF_UP, which is unrelated to the need to change the mac
to a user-defined value, or set 'nomaster' on the interface.
Additionally, there is no need to re-set the mac or re-assert nomaster
every time the interface is brought up; those should be only part of
normal initial interface configuration.
Fixes: #17391
Anita Zhang [Thu, 22 Oct 2020 09:03:20 +0000 (02:03 -0700)]
oomd: make start up swap check more robust
Anita Zhang [Fri, 14 Aug 2020 08:20:43 +0000 (01:20 -0700)]
test: add basic memory pressure extended test for oomd
Simple test to generate a lot of pressure in one unit and assert that
systemd-oomd kills the right one.
Lennart Poettering [Thu, 22 Oct 2020 16:20:47 +0000 (18:20 +0200)]
Merge pull request #17418 from poettering/news-247-more
more v247 preps
Lennart Poettering [Fri, 25 Sep 2020 16:26:53 +0000 (18:26 +0200)]
test: add heavy load loopback block device test
Lennart Poettering [Tue, 13 Oct 2020 12:37:39 +0000 (14:37 +0200)]
loop-util: wait a random time before trying again
Let's try to make collisions when multiple clients want to use the same
device less likely, by sleeping a random time on collision.
The loop device allocation protocol is inherently collision prone:
first, a program asks which is the next free loop device, then it tries
to acquire it, in a separate, unsynchronized setp. If many peers do this
all at the same time, they'll likely all collide when trying to
acquire the device, so that they need to ask for a free device again and
again.
Let's make this a little less prone to collisions, reducing the number
of failing attempts: whenever we notice a collision we'll now wait
short and randomized time, making it more likely another peer succeeds.
(This also adds a similar logic when retrying LOOP_SET_STATUS64, but
with a slightly altered calculation, since there we definitely want to
wait a bit, under all cases)
Lennart Poettering [Wed, 14 Oct 2020 08:52:05 +0000 (10:52 +0200)]
dissect: retrigger devices if we missed uevents
On systems that have a udev before
a7fdc6cbd399acdb1a975a7f72b9be4504a38c7c uevents would sometimes be
eaten because of device node collisions that caused the ruleset to fail.
Let's add an (ugly) work-around for this, so that we can even work with
such an older udev.
Lennart Poettering [Mon, 12 Oct 2020 16:18:33 +0000 (18:18 +0200)]
udev-util: use absolute rather than relative timeout when waiting for devices
This makes it easier to accurately wait for a overall deadline.
Lennart Poettering [Fri, 25 Sep 2020 15:12:34 +0000 (17:12 +0200)]
loop-util: if a loopback device we want to use still has partitions, do something about it
On current kernels (5.8 for example) under some conditions I don't fully
grok it might happen that a detached loopback block device still has
partition block devices around. Accessing these partition block devices
results in EIO errors (that also fill up dmesg). These devices cannot be
claned up with LOOP_CLR_FD (since the main device already is officially
detached), nor with LOOP_CTL_DELETE (returns EBUSY as long as the
partitions still exist). This is a kernel bug. But it appears to apply
to all recent kernels. I cannot really pin down what triggers this,
suffice to say our heavy-duty test can trigger it.
Either way, let's do something about it: when we notice this state we'll
attach an empty file to it, which is guaranteed to have to part table.
This makes the partitions go away. After closing/reoping the device we
hence are good to go again. ugly workaround, but I think OK enough to
use.
The net result is: with this commit, we'll guarantee that by the time we
attach a file to the loopback device we have zero kernel partitions
associated with it. Thus if we then wait for the kernel partitions we
need to appear we should have entirely reliable behaviour even if
loopback devices by the name are heavily recycled and udev events reach
us very late.
Fixes: #16858
Lennart Poettering [Tue, 29 Sep 2020 18:56:50 +0000 (20:56 +0200)]
dissect-image: rework how we wait for partitions
Previously, we'd just wait for the first moment where the kernel exposes
the same numbre of partitions as libblkid tells us. After that point we
enumerate kernel partitions and look for matching libblkid partitions.
With this change we'll instead enumerate with libblkid only, and then
wait for each kernel partition to show up with the exact parameters we
expect them to show up. Once that happens we are happy.
Care is taken to use the udev device notification messages only as hint
to recheck what the kernel actually says. That's because we are
otherwise subject to a race: we might see udev events from an earlier
use of a loopback device. After all these devices are heavily recycled.
Under the assumption that we'll get udev events for *at least* all
partitions we care about (but possibly more) we can fix the race
entirely with one more fix coming in a later commit: if we make sure
that a loopback block device has zero kernel partitions when we take
possession of it, it doesn't matter anymore if we get spurious udev
events from a previous use. All we have to do is notice when the devices
we need all popped up.
Lennart Poettering [Fri, 25 Sep 2020 16:49:13 +0000 (18:49 +0200)]
dissect-image: wait for udev device to be initialized early
If we allocate the sd_device early we can already use it as path when
looking at whole-device fs images.
Lennart Poettering [Fri, 25 Sep 2020 13:22:48 +0000 (15:22 +0200)]
loop-util: LOOP_CLR_FD is async, don't retry to reuse a device right after issuing it
When we fall back to classic LOOP_SET_FD logic in case LOOP_CONFIGURE
didn't work we issue LOOP_CLR_FD first. But that call turns out to be
potentially async in the kernel: if something else (let's say
udev/blkid) is accessing the device the ioctl just sets the autoclear
flag and exits. Hence quite often the LOOP_SET_FD will subsequently
fail. Let's avoid the trouble, and immediately exit with EBUSY if
LOOP_CONFIGURE fails, and but remember that LOOP_CONFIGURE is not
available so that on the next iteration we go directly for LOOP_SET_FD
instead.
Lennart Poettering [Wed, 26 Aug 2020 20:42:26 +0000 (22:42 +0200)]
loop-util: handle EAGAIN on LOOP_SET_STATUS64
Since
https://github.com/torvalds/linux/commit/
5db470e229e22b7eda6e23b5566e532c96fb5bc3 (i.e. kernel 5.0)
changing the .lo_offset field via LOOP_SET_STATUS64 might result in
EAGAIN. Let's handle that.
Fixes: #16858
Lennart Poettering [Thu, 22 Oct 2020 12:57:41 +0000 (14:57 +0200)]
Merge pull request #17324 from keszybz/resolvectl-compat-output
resolvectl compat output
Hans Ulrich Niedermann [Wed, 21 Oct 2020 20:40:18 +0000 (22:40 +0200)]
test-env-util: Verify that \r is disallowed in env var values
This adds tests to make sure that basic/env-util considers environment
variables containing \r characters invalid, and that it removes such
variables during environment cleanup in strv_env_clean*().
test-env-util has not verified this behaviour before.
As \r characters can be used to hide information, disallowing them
helps with systemd's security barrier role, even when the \r
character comes as part of a DOS style (\r\n) line ending.
Prompted-by: https://github.com/systemd/systemd/issues/17378
Lennart Poettering [Thu, 22 Oct 2020 12:56:46 +0000 (14:56 +0200)]
Merge pull request #16632 from keszybz/test-path-yet-again
Tighten handling of spawned services in tests that may fail
Lennart Poettering [Thu, 22 Oct 2020 12:05:13 +0000 (14:05 +0200)]
clock-util: trivial clean-ups
Lennart Poettering [Thu, 22 Oct 2020 12:03:57 +0000 (14:03 +0200)]
net_id: fix newly added naming scheme name
v246 is long released. Hence the new scheme should be named v247.
(Interesting, how we pretty systematically for the last releases changed
the scheme only every second release)
Lennart Poettering [Thu, 22 Oct 2020 12:03:38 +0000 (14:03 +0200)]
update NEWS
Lennart Poettering [Thu, 22 Oct 2020 11:44:17 +0000 (13:44 +0200)]
Merge pull request #17415 from keszybz/logind-resolved-docs
A bunch of updates to logind and resolved man pages
Zbigniew Jędrzejewski-Szmek [Tue, 20 Oct 2020 08:50:01 +0000 (10:50 +0200)]
resolvectl: wrap the extended status string too
Zbigniew Jędrzejewski-Szmek [Mon, 12 Oct 2020 13:54:57 +0000 (15:54 +0200)]
resolvect: use wrapping for various lists
dump_list() is used for DNS servers, DNS domains, fallback DNS servers.
Zbigniew Jędrzejewski-Szmek [Mon, 12 Oct 2020 11:29:46 +0000 (13:29 +0200)]
format-table: add TABLE_STRV_WRAPPED
The idea is that we have strvs like list of server names or addresses, where
the majority of strings is rather short, but some are long and there can
potentially be many strings. So formattting them either all on one line or all
in separate lines leads to output that is either hard to read or uses way too
many rows. We want to wrap them, but relying on the pager to do the wrapping is
not nice. Normal text has a lot of redundancy, so when the pager wraps a line
in the middle of a word the read can understand what is going on without any
trouble. But for a high-density zero-redundancy text like an IP address it is
much nicer to wrap between words. This also makes c&p easier.
This adds a variant of TABLE_STRV which is wrapped on output (with line breaks
inserted between different strv entries).
The change table_print() is quite ugly. A second pass is added to re-calculate
column widths. Since column size is now "soft", i.e. it can adjust based on
available columns, we need to two passes:
- first we figure out how much space we want
- in the second pass we figure out what the actual wrapped columns
widths will be.
To avoid unnessary work, the second pass is only done when we actually have
wrappable fields.
A test is added in test-format-table.
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 08:07:23 +0000 (10:07 +0200)]
test-path: relax test in "ci" and "release" modes
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 09:29:00 +0000 (11:29 +0200)]
tests: add helper function to autodetect CI environments
Sadly there is no standarized way to check if we're running in some
CI environment. So let's try to gather the heuristics in one helper function.
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 20:59:19 +0000 (22:59 +0200)]
resolved: add trailing newlines in generated file
Fixup for
b3ffa2b5f3aa68dc6ab15893d5eeba8906aa3a9e.
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 20:42:40 +0000 (22:42 +0200)]
resolved.conf: add empty DNSStubListenerExtra=
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 15:52:37 +0000 (17:52 +0200)]
man: document differences between nss-resolve and nss-dns
https://bugzilla.redhat.com/show_bug.cgi?id=
1889012
https://serverfault.com/questions/626612/dns-just-started-resolving-my-server-prod-addresses-to-127-0-53-53
https://serverfault.com/questions/649352/what-are-the-security-implications-of-the-allow-dns-suffix-appending-to-unquali
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 11:53:59 +0000 (13:53 +0200)]
man/org.freedesktop.resolve1: briefly document a bunch of methods and properties
Fixes #13799.
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2020 14:51:14 +0000 (16:51 +0200)]
man/systemd-resolved: reword the description of query a bit
The phrase "routing domains" is used to mean both route-only domains and search
domains. Route-only domains are always called like that, and not just "route domains".
Some paragraphs are reordered to describe synthetisized records first, then
LLMNR, then various ways quries are routed.
Fixes #8928, hopefully.
Lennart Poettering [Thu, 22 Oct 2020 09:19:26 +0000 (11:19 +0200)]
Merge pull request #13589 from williamvds/systemctl-edit-copy
systemctl: show original contents in comment when editing unit
Kairui Song [Tue, 4 Aug 2020 09:30:51 +0000 (17:30 +0800)]
pstore: don't enable crash_kexec_post_notifiers by default
commit
f00c36641a253f4ea659ec3def5d87ba1336eb3b enabled
crash_kexec_post_notifiers by default regardless of whether pstore
is enabled or not.
The original intention to enabled this option by default is that
it only affects kernel post-panic behavior, so should have no harm.
But this is not true if the user wants a reliable kdump.
crash_kexec_post_notifiers is known to cause problem with kdump,
and it's documented in kernel. It's not easy to fix the problem
because of how kdump works. Kdump expects the crashed kernel to
jump to an pre-loaded crash kernel, so doing any extra job before
the jump will increase the risk.
It depends on the user to choose between having a reliable kdump or
some other post-panic debug mechanic.
So it's better to keep this config untouched by default, or it may put
kdump at higher risk of failing silently. User should enable it by
uncommenting the config line manually if pstore is always needed.
Also add a inline comment inform user about the potential issue.
Thanks to Dave Young for finding out this issue.
Fixes #16661
Signed-off-by: Kairui Song <kasong@redhat.com>
Lennart Poettering [Thu, 22 Oct 2020 09:16:12 +0000 (11:16 +0200)]
Merge pull request #17412 from mrc0mmand/ghworkflow-buildtest-improvements
ci: GH 'build test' improvements
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 08:04:23 +0000 (10:04 +0200)]
meson: convert developer_mode boolean to an enum
I initially changed this to add a third state. But even with two values having
an explicit name instead of just 0/1 is mode descriptive.
Zbigniew Jędrzejewski-Szmek [Sun, 27 Sep 2020 13:33:20 +0000 (15:33 +0200)]
test-path: start infinite sleep instead of a short command
The test sometimes fails, e.g. in bionic-s390x ci. I think it might be because
the service binary exits before we get a chance to notice that it is running:
13:59:31 --- Listing only the last 100 lines from a long log. ---
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
4639845)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
4539608)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
4439376)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
4338946)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
4238702)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
4138424)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
4038116)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3937835)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3837553)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3737250)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3636934)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3536622)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3436318)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3336021)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3235730)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3135468)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
3035158)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2934855)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2834541)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2732511)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2632255)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2532014)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2431746)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2331438)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2231213)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2130952)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
2030663)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1930428)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1830172)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1729906)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1629652)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1529368)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1429110)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1328852)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1228593)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1128320)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left:
1028083)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 927824)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 827564)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 724935)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 624664)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 524411)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 424124)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 323853)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 223585)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 120356)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 18053)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: -82385)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 Test timeout when testing path-unit.path
It seems test/test-path/path-service.service wasn't actually used for anything.
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 07:02:36 +0000 (09:02 +0200)]
tests: replace the few remaining Type=simple with Type=exec
Except for the places where we explicitly want to test Type=simple,
we should use Type=exec.
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 07:01:48 +0000 (09:01 +0200)]
xdg-autostart-generator: use Type=exec
We check that the binary exists before writing the service file, but
let's also not consider the service started until the fork has happened.
This is still relatively new stuff, so we're can change the implementation
details like this.