Commit graph

47948 commits

Author SHA1 Message Date
Lennart Poettering a2b06dbe15 conf-parser: add a flavour of DEFINE_CONFIG_PARSE_ENUM() that allows specifiying the precie from_string() function to call 2020-10-27 14:12:31 +01:00
Lennart Poettering 3b719003c3 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.
2020-10-27 14:12:26 +01:00
Lennart Poettering 2d6d4136cd socket-util: make socket_set_recvpktinfo control PACKET_AUXDATA sockopt on AF_PACKET
Just for the sake of completness.
2020-10-27 14:12:10 +01:00
Lennart Poettering c758bea722 man: add references to fifo(7) and mq_overview(7) man pages 2020-10-27 14:11:48 +01:00
Lennart Poettering 74d6421da0 tree-wide: cast result of get_process_comm() to (void) where we ignore it 2020-10-27 14:06:49 +01:00
Lennart Poettering ddfde737b5 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.
2020-10-27 14:01:36 +01:00
Michal Sekletár e1951c16a8 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)
2020-10-27 14:01:14 +01:00
Jonathan Lebon e921ebb57e 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 6c5496c492 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.]
2020-10-27 13:49:01 +01:00
Zbigniew Jędrzejewski-Szmek 6bdcb72086 Revert "units: add initrd-cryptsetup.target"
This reverts commit 6c5496c492.

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.
2020-10-27 13:36:22 +01:00
Zbigniew Jędrzejewski-Szmek d5816b6138 meson: simplify with_runlevels ternany op usage 2020-10-27 13:36:22 +01:00
Anita Zhang e08dabfec7 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.
2020-10-27 13:20:40 +01:00
Zbigniew Jędrzejewski-Szmek 397cca2453 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.
2020-10-27 09:06:29 +01:00
AsciiWolf f2b5c4cf9e l10n: update Czech Translation 2020-10-27 08:31:31 +01:00
Anita Zhang 800d0802e4 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.
2020-10-27 00:20:17 -07:00
Josh Brobst c690bd0bc6 man: correct xdg-autostart-generator path 2020-10-27 15:13:20 +09:00
Zbigniew Jędrzejewski-Szmek 6706384a89 NEWS: v247-rc1 2020-10-26 20:43:18 +01:00
Zbigniew Jędrzejewski-Szmek 7fef572bae NEWS: update contributors list for v247-rc1 2020-10-26 20:41:58 +01:00
Zbigniew Jędrzejewski-Szmek cb9a48a94f NEWS: mention IPv6PrefixDelegation→IPv6SendRA renaming 2020-10-26 20:27:41 +01:00
Pat Coulthard 3045c416e1 tmpfiles: Handle filesystems without ACL support in more cases. 2020-10-26 10:20:10 +01:00
Elias Probst a0223c308e NEWS: fix typo (systemd-userdb > systemd-userdbd) 2020-10-24 22:51:00 +09:00
Yu Watanabe 80762cccdc test-network: add a test case for DNSSL in RA
Closes #4590.
2020-10-24 14:08:51 +02:00
Zbigniew Jędrzejewski-Szmek a5258a0cb0
Merge pull request #17430 from yuwata/network-drop-foreign-routes-managed-by-manager
network: drop routes managed by Manager when they are not requested
2020-10-24 13:44:10 +02:00
Dan Streetman 352ab9d740 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.
2020-10-24 13:34:01 +02:00
Yu Watanabe 377a9545e9 tree-wide: fix typos found by Fossies codespell report 2020-10-24 13:29:31 +02:00
Yu Watanabe 5a8775bb39 Revert "sd-dhcp-client: use asynchronous_close()"
This effectively reverts the commit 22fc2420b2.

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)
```
2020-10-24 13:27:37 +02:00
Yu Watanabe e149ba1b1f
Merge pull request #17429 from keszybz/revert-17188
Revert the change to allow arbitrary environment variable names
2020-10-24 12:16:44 +09:00
Anita Zhang 311e3d4637 test: make TEST-56-OOMD service unit files static 2020-10-23 15:59:00 -07:00
Zbigniew Jędrzejewski-Szmek c9e9a57fce shared/qrcode-util: reduce scope of iterator variables 2020-10-23 20:36:37 +02:00
Zbigniew Jędrzejewski-Szmek 9337945233 meson: sort include dirs
Our headers should have unique names, so the sort order shouldn't matter.
2020-10-23 20:33:28 +02:00
Lennart Poettering f6358f8931
Merge pull request #17427 from poettering/v247-bump
preparation for v247-rc1
2020-10-23 17:50:04 +02:00
Yu Watanabe 43d4bc9f56 test-network: add tests for routes managed by Manager 2020-10-23 23:07:12 +09:00
Yu Watanabe 1132a714ec network: drop routes managed by Manager when link is removed
Also, foreign routes managed by Manager are dropped in
link_drop_foreign_routes().
2020-10-23 23:07:12 +09:00
Yu Watanabe 5f4d7aa458 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().
2020-10-23 23:07:12 +09:00
Yu Watanabe bac319a795 network: link may be NULL 2020-10-23 23:07:12 +09:00
Yu Watanabe b1dc5946e2 network: ignore error in writing proxy_ndp
This partially reverts the commit fd773a11d8.

As, IPv6 may be disabled by kernel.
2020-10-23 23:07:12 +09:00
Yu Watanabe 9b3e49fc00 network: fix typo 2020-10-23 23:07:12 +09:00
Zbigniew Jędrzejewski-Szmek 0dc9fd56a5 man: document what variables are allowed 2020-10-23 15:49:03 +02:00
Lennart Poettering 3b8a216045 update TODO 2020-10-23 15:46:29 +02:00
Zbigniew Jędrzejewski-Szmek ff461576de Revert "basic/env-util: (mostly) follow POSIX for what variable names are allowed"
This reverts commit b45c068dd8.

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. a4ccce22d9 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
2020-10-23 15:07:07 +02:00
Zbigniew Jędrzejewski-Szmek 451ae5a11a basic/env-util: make function shorter 2020-10-23 13:49:05 +02:00
Lennart Poettering a53225670d build-sys: prepare 247-rc1
Interestingly, the libudev so version was already bumped.
2020-10-23 13:44:33 +02:00
Lennart Poettering b2a9e4d0ed update hwdb 2020-10-23 13:44:33 +02:00
Lennart Poettering 17d99f95c2
Merge pull request #16859 from poettering/loop-eagain
loop: handle EAGAIN on LOOP_SET_STATUS64
2020-10-23 13:15:04 +02:00
Zbigniew Jędrzejewski-Szmek 15a6c4bf8b
Merge pull request #17417 from anitazha/more_systoomd
More systemd-oomd tweaks
2020-10-23 13:06:51 +02:00
Benjamin Berg 1c2fd33d84 units: Move user tmpfiles clean service into background.slice 2020-10-23 10:32:02 +02:00
Benjamin Berg 0f7793bebd man: Document app, session and background special user slice units
Add documentation for the special slice user slice units.
2020-10-23 10:32:02 +02:00
Benjamin Berg 7f3b86a497 core: Move user units into app.slice by default
This changes the default from putting all units into the root slice to
placing them into the app slice in the user manager. The advantage is
that we get the right behaviour in most cases, and we'll need special
case handling in all other cases anyway.

Note that we have currently defined that applications *should* start
their unit names with app-, so we could also move only these by creating
a drop-in for app-.scope and app-.service.
However, that would not answer the question on how we should manage
session.slice. And we would end up placing anything that does not fit
the system (e.g. anything started by dbus-broker currently) into the
root slice.
2020-10-23 09:58:41 +02:00
Benjamin Berg 0b432bdc2e basic: Define macros for special user slices 2020-10-23 09:58:41 +02:00
Benjamin Berg a3081a7a89 units: Add special Desktop Environment user related units
This adds app.slice, session.slice and background.slice.
2020-10-23 09:58:41 +02:00
Zbigniew Jędrzejewski-Szmek 943142a97d
Merge pull request #17185 from yuwata/ethtool-update
ethtool: add several link modes
2020-10-23 08:22:09 +02:00