summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* pid1: set SYSTEMD_NSS_DYNAMIC_BYPASS=1 env var for dbus-daemonLennart Poettering2022-02-183-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's currently a deadlock between PID 1 and dbus-daemon: in some cases dbus-daemon will do NSS lookups (which are blocking) at the same time PID 1 synchronously blocks on some call to dbus-daemon. Let's break that by setting SYSTEMD_NSS_DYNAMIC_BYPASS=1 env var for dbus-daemon, which will disable synchronously blocking varlink calls from nss-systemd to PID 1. In the long run we should fix this differently: remove all synchronous calls to dbus-daemon from PID 1. This is not trivial however: so far we had the rule that synchronous calls from PID 1 to the dbus broker are OK as long as they only go to interfaces implemented by the broke itself rather than services reachable through it. Given that the relationship between PID 1 and dbus is kinda special anyway, this was considered acceptable for the sake of simplicity, since we quite often need metadata about bus peers from the broker, and the asynchronous logic would substantially complicate even the simplest method handlers. This mostly reworks the existing code that sets SYSTEMD_NSS_BYPASS_BUS= (which is a similar hack to deal with deadlocks between nss-systemd and dbus-daemon itself) to set SYSTEMD_NSS_DYNAMIC_BYPASS=1 instead. No code was checking SYSTEMD_NSS_BYPASS_BUS= anymore anyway, and it used to solve a similar problem, hence it's an obvious piece of code to rework like this. Issue originally tracked down by Lukas Märdian. This patch is inspired and closely based on his patch: https://github.com/systemd/systemd/pull/22038 Fixes: #15316 Co-authored-by: Lukas Märdian <slyon@ubuntu.com>
* pid1: lookup owning PID of BusName= name of services asynchronouslyLennart Poettering2022-02-182-19/+74
| | | | | | | | | | | | A first step of removing blocking calls to the D-Bus broker from PID 1. There's a lot more to got (i.e. grep src/core/ for sd_bus_creds basically), but it's a start. Removing blocking calls to D-Bus broker deals systematicallly with deadlocks caused by dbus-daemon blocking on synchronous IPC calls back to PID1 (e.g. Varlink calls through nss-systemd). Bugs such as #15316. Also-see: https://github.com/systemd/systemd/pull/22038#issuecomment-1042958390
* pid1: watch bus name always when we have itLennart Poettering2022-02-181-8/+10
| | | | | | | | | | Previously we'd only watch configured service bus names if Type=dbus was set. Let's also watch it for other types. This is useful to pick up the main PID of such a service. In fact the code to pick it up was already in place, alas it didn't do anything given the signal was never received for it. Fix that. (It's also useful for debugging)
* udev-util: add parentheses to make coverity silentYu Watanabe2022-02-181-1/+1
| | | | Fixes CID#1474365.
* Merge pull request #22545 from yuwata/network-match-kindYu Watanabe2022-02-1811-21/+57
|\ | | | | network, udev: introduce Kind= setting in [Match] section
| * network,udev/net: add Kind= settings in [Match] sectionYu Watanabe2022-02-1710-3/+36
| | | | | | | | | | | | | | This may be useful for writing .network or .link files matching with virtual interfaces. Closes #22541.
| * networkctl: show netdev kindYu Watanabe2022-02-171-18/+21
| |
* | Merge pull request #22540 from yuwata/network-call-ethtool-after-initializedYu Watanabe2022-02-174-42/+107
|\ \ | | | | | | network: call ethtool after link is initialized by udevd
| * | network: call ethtool after link is initialized by udevdYu Watanabe2022-02-171-38/+87
| | | | | | | | | | | | Fixes #22538.
| * | network: use udev_available() where applicableYu Watanabe2022-02-172-4/+3
| | |
| * | udev-util: introduce udev_available() helper functionYu Watanabe2022-02-172-0/+17
| |/
* | resolve: refuse AF_UNSPEC when resolving addressYu Watanabe2022-02-171-1/+1
|/ | | | Fixes #22480.
* Merge pull request #22535 from poettering/dbusctl-range-displayYu Watanabe2022-02-1715-51/+283
|\ | | | | userdbctl: show UID ranges in output too
| * userdbctl: add a dash of color to users of different dispositionsLennart Poettering2022-02-161-4/+37
| |
| * userdbctl: show min/max UID boundaries in userdbctl outputLennart Poettering2022-02-161-12/+198
| |
| * user-util: move homed/nspawn map UID_MIN/UID_MAX define into user-util.hLennart Poettering2022-02-163-10/+11
| | | | | | | | | | Let's have them at a common place, so that we have the ranges altogether at a minimal set of places.
| * glyph-util: add new glyphs for up/down arrowsLennart Poettering2022-02-1611-25/+37
| |
* | sd-dhcp-server: do not offer server addressYu Watanabe2022-02-171-0/+3
| | | | | | | | The server address may be in the pool.
* | logind: fix bool/int confusion for KillUserProcesses bus propertyLennart Poettering2022-02-161-1/+1
| | | | | | | | | | | | | | sd-bus for compat with old C expects "int" for booleans. Internally we prefer to use C99 "bool" however. When pointing a pointer to it, we need to handle the fact that they are typically differently sized, hence use te right accessors for it.
* | logind: fix internal types used for EnableWallMessagesLennart Poettering2022-02-162-5/+5
|/ | | | | | | | The value is used as a boolean, but stored in an unsigned. It's exposed with sd-bus default boolean handling which however expects a (signed) int. Let's clear this up, and use "bool" for this everywhere in non-local scope, and make sure that when we pass it to sd-bus we properly pass an "int".
* Merge pull request #22531 from poettering/mempcpy-cocciLennart Poettering2022-02-164-17/+10
|\ | | | | coccinelle: add semantic patch for using more mempcpy() instead of memcpy()
| * tree-wide: some coccinelle fixesLennart Poettering2022-02-162-8/+5
| |
| * coccinelle: automatically switch some uses of memcpy() → mempcpy()Lennart Poettering2022-02-162-9/+5
| | | | | | | | | | Inspired by #22520, let's add a coccinelle script that converts this automatically.
* | Revert "resolved: filter out our own stub resolvers when parsing servers"Lennart Poettering2022-02-165-34/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0ad4efb14beea9148838a0d974821e3b98cafc47. See https://github.com/systemd/systemd/pull/20559#issuecomment-1028011030 for reasoning. Quoting: > I think it should be OK to advertise extra stub listeners to local > clients, but you prohibit this now. i.e. there are two different > concepts here, and we shouldn't mix them up: > > 1. tracking configured dns servers and advertise them to local programs > 2. actually using them ourselves > > I am pretty sure that our own stubs are OK for 1 but not OK for 2, > hence we should filter at the time of use not at the time of parse.
* | Merge pull request #22498 from yuwata/cgroup-threaded-modeLuca Boccassi2022-02-164-0/+35
|\ \ | | | | | | cgroup: ignore error in attaching process when threaded mode is used
| * | core/execute: warn when threaded mode is detectedYu Watanabe2022-02-162-0/+9
| | | | | | | | | | | | Prompted by #22486.
| * | cgroup-util: introduce cg_is_threaded()Yu Watanabe2022-02-162-0/+26
| | |
* | | virt: Fix Xen Dom0 detection logic to no longer report as VMRichard Neill2022-02-161-19/+21
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes regression introduced in 599be274c13c503806c85073d7beb1a155ac27bd Moving the Xen check before the CPUID check, in order to handle the case where a Xen domain is nested within a hypervisor which can be detected by via the CPUID check, had an unintended consequence of causing Dom0 to report as a Xen VM when it is not nested. This patch stops further checks once it has been determined that Dom0 is not nested within another hypervisor, meaning that the non-nested case matches its previous logic (where it does not report as a VM). Also, tidy the conditionals for the Xen and UML checks by removing handling of a VIRTUALIZATION_VM_OTHER result, which has no code path. Fixes #22511
* | timesync: add missing setting in templateYu Watanabe2022-02-161-0/+1
| | | | | | | | Follow-up for e81a44bf5faa80ec6ca2ef835d559a65c7e27c35.
* | Merge pull request #22526 from poettering/homed-container-uid-rangeLennart Poettering2022-02-161-0/+7
|\ \ | | | | | | homed: map container UID range for homed home directories
| * | homed: when using id mapping on the home dirs, also do an identity mapping ↵Lennart Poettering2022-02-161-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | for the container UID ranges Apparently people really want to put high UIDs in their homedirs. Let's add some minimal support for that. Further discussion: https://github.com/systemd/systemd/pull/22239#issuecomment-1040421552 Inspired by, based on, and replacing #22239 by Christian Brauner.
* | Merge pull request #22502 from yuwata/udev-net-virtual-wlan-interfaceYu Watanabe2022-02-1617-78/+765
|\ \ | | | | | | network: add virtual wlan interface support
| * | network: add support to create wlan virtual interfaceYu Watanabe2022-02-156-0/+293
| | | | | | | | | | | | Closes #18977.
| * | wifi-util: introduce nl80211_iftype_from_string()Yu Watanabe2022-02-152-1/+2
| | |
| * | network: manage WLAN phyYu Watanabe2022-02-156-0/+289
| | |
| * | network: netdev: add flag to skip kind checkYu Watanabe2022-02-152-24/+30
| | | | | | | | | | | | It will be used in later commit.
| * | network: netdev: use request queue to create independent netdevsYu Watanabe2022-02-156-31/+126
| | |
| * | network: netdev: increment reference counter on requestYu Watanabe2022-02-152-2/+3
| | | | | | | | | | | | Otherwise, it may be freed on reload.
| * | network: netdev: make netdev_is_ready_to_create() return negative errno on ↵Yu Watanabe2022-02-151-3/+4
| | | | | | | | | | | | fatal error
| * | network: rename REQUEST_TYPE_STACKED_NETDEV -> REQUEST_TYPE_NETDEV_STACKEDYu Watanabe2022-02-153-10/+11
| | |
| * | meson: sort listed filesYu Watanabe2022-02-151-9/+9
| | |
* | | Merge pull request #22520 from yuwata/sd-dhcp6-client-cosmetic-follow-upsYu Watanabe2022-02-164-21/+22
|\ \ \ | | | | | | | | sd-dhcp6-client: several cosmetic follow-ups
| * | | sd-dhcp6-client: use mempcpy() or mempcpy_safe()Yu Watanabe2022-02-161-12/+5
| | | |
| * | | memory-util: introdyce mempcpy_safe()Yu Watanabe2022-02-161-2/+10
| | | |
| * | | dhcp-identifier: use offsetof()Yu Watanabe2022-02-161-5/+5
| | | | | | | | | | | | | | | | Also use appropriate place to store UUID.
| * | | sd-dhcp6-client: add comment about ia_na and ia_pdYu Watanabe2022-02-151-2/+2
| | |/ | |/|
* | | Merge pull request #22271 from keszybz/manager-reexec-freezeYu Watanabe2022-02-161-54/+65
|\ \ \ | |/ / |/| | Freeze manager if reexec fails
| * | manager: add {} around cpu sets, use range formattingZbigniew Jędrzejewski-Szmek2022-02-161-3/+3
| | | | | | | | | | | | | | | | | | | | | We would print "Setting NUMA policy to bind, with nodes .". This is not very clear, change it to "… with nodes {}.". Also use range formatting for masks to make output shorter.
| * | manager: add few ", ignoring" and adjust level in one messageZbigniew Jędrzejewski-Szmek2022-02-161-4/+4
| | |
| * | manager: if we are reexecuting, do not invoke any fallbacksZbigniew Jędrzejewski-Szmek2022-02-151-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For https://bugzilla.redhat.com/show_bug.cgi?id=1986176: if we are trying to reexecute, and this fails for any reason, we shouldn't try to execute /sbin/init or /bin/sh. It is better to just freeze. If we freeze it is easier to diagnose what happened, but if we execute one of the fallbacks, we don't really know what will happen. In particular the new init might just return, causing the machine to shut down. Or we may successfully spawn /bin/sh, which could leave the machine open.