]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoMerge pull request #21030 from DaanDeMeyer/path-skipped
Lennart Poettering [Thu, 4 Nov 2021 14:20:00 +0000 (15:20 +0100)] 
Merge pull request #21030 from DaanDeMeyer/path-skipped

core: Propagate condition failed state from service to path unit.

2 years agoupdate-helper: add missing loop over user units
Zbigniew Jędrzejewski-Szmek [Thu, 4 Nov 2021 08:49:18 +0000 (09:49 +0100)] 
update-helper: add missing loop over user units

Noticed by Luca.

shellcheck doens't catch this, and somehow it was missed in review
and testing ;(

2 years agotree-wide: always use TAKE_FD() when calling rearrange_stdio()
Lennart Poettering [Tue, 2 Nov 2021 14:50:55 +0000 (15:50 +0100)] 
tree-wide: always use TAKE_FD() when calling rearrange_stdio()

rearrange_stdio() invalidates specified fds even on failure, which means
we should always invalidate the fds we pass in no matter what. Let's
make this explicit by using TAKE_FD() for that everywhere.

Note that in many places we such invalidation doesnt get us much
behaviour-wise, since we don't use the variables anymore later. But
TAKE_FD() in a way is also documentation, it encodes explicitly that the
fds are invalidated here, so I think it's a good thing to always make
this explicit here.

2 years agocore: Propagate condition failed state to triggering units. 21030/head
Daan De Meyer [Mon, 18 Oct 2021 12:17:02 +0000 (14:17 +0200)] 
core: Propagate condition failed state to triggering units.

Alternative to https://github.com/systemd/systemd/pull/20531.

Whenever a service triggered by another unit fails condition checks,
stop the triggering unit to prevent systemd busy looping trying to
start the triggered unit.

2 years agoMerge pull request #21217 from keszybz/debug-test-process-util
Yu Watanabe [Wed, 3 Nov 2021 19:03:56 +0000 (04:03 +0900)] 
Merge pull request #21217 from keszybz/debug-test-process-util

procfs-util: fix confusion wrt. quantity limit and maximum value

2 years agoMerge pull request #21216 from poettering/take-fd-tweak
Yu Watanabe [Wed, 3 Nov 2021 19:01:45 +0000 (04:01 +0900)] 
Merge pull request #21216 from poettering/take-fd-tweak

fd-util: make TAKE_FD free of double evaluation

2 years agomacro: make TAKE_PTR() side-effect free 21216/head
Lennart Poettering [Wed, 3 Nov 2021 14:56:34 +0000 (15:56 +0100)] 
macro: make TAKE_PTR() side-effect free

2 years agotree-wide: port more code to sigkill_wait()
Lennart Poettering [Wed, 3 Nov 2021 15:35:44 +0000 (16:35 +0100)] 
tree-wide: port more code to sigkill_wait()

2 years agotree-wide: port various places to use TAKE_PID()
Lennart Poettering [Wed, 3 Nov 2021 14:56:09 +0000 (15:56 +0100)] 
tree-wide: port various places to use TAKE_PID()

2 years agoprocess-util: rework TAKE_PID() to be side-effect free
Lennart Poettering [Wed, 3 Nov 2021 14:55:14 +0000 (15:55 +0100)] 
process-util: rework TAKE_PID() to be side-effect free

2 years agoprocess-util: wait for processes we killed even if killing failed
Lennart Poettering [Wed, 3 Nov 2021 14:54:28 +0000 (15:54 +0100)] 
process-util: wait for processes we killed even if killing failed

The processes might be zombies in which case killing will fail, but
reaping them still matters.

2 years agotest: add test that ensures TAKE_FD() works as it should
Lennart Poettering [Wed, 3 Nov 2021 14:56:48 +0000 (15:56 +0100)] 
test: add test that ensures TAKE_FD() works as it should

2 years agofd-util: make TAKE_FD free of double evaluation
Lennart Poettering [Tue, 2 Nov 2021 16:52:24 +0000 (17:52 +0100)] 
fd-util: make TAKE_FD free of double evaluation

Better be safe than sorry.

2 years agotest-process-util: also add EROFS to the list of "good" errors 21217/head
Zbigniew Jędrzejewski-Szmek [Wed, 3 Nov 2021 08:39:16 +0000 (09:39 +0100)] 
test-process-util: also add EROFS to the list of "good" errors

It is only added in the one place where we actually try to set the
setting to a new value. Before we were testing if we can set to it the
existing value, which was a noop. We could still get a permission error,
but this is the first place where we would propagate EROFS.

2 years agoprocfs-util: fix confusion wrt. quantity limit and maximum value
Zbigniew Jędrzejewski-Szmek [Tue, 2 Nov 2021 17:18:21 +0000 (18:18 +0100)] 
procfs-util: fix confusion wrt. quantity limit and maximum value

From packit/rawhide-arm64 logs:
Assertion 'limit >= INT_MAX || get_process_ppid(limit+1, NULL) == -ESRCH' failed at src/test/test-process-util.c:855, function test_get_process_ppid(). Aborting.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

The kernel has a few different limits. In particular kernel.threads-max can be
set to some lower value, and kernel.pid_max can be set to a higher value. This
is nice because it reduces PID reuse, even if the number of threads that is
allowed is limited. But the tests assumed that we cannot have a thread with
PID above MIN(kernel.threads-max, kernel.pid_max-1), which is not valid.

So let's rework the whole thing: let's expose the helpers to read
kernel.threads-max and kernel.pid_max, and print what they return in tests.
procfs_tasks_get_limit() was something that is only used in tests, and wasn't
very well defined, so let's drop it.

Fixes #21193.

2 years agoMerge pull request #21210 from yuwata/network-dhcp-server-introduce-router-setting
Yu Watanabe [Wed, 3 Nov 2021 03:41:34 +0000 (12:41 +0900)] 
Merge pull request #21210 from yuwata/network-dhcp-server-introduce-router-setting

network: dhcp-server: introduce Router= setting to specify router address

2 years agopercent-util: clamp percent range before converting to 2^32 scale
Lennart Poettering [Fri, 29 Oct 2021 12:33:37 +0000 (14:33 +0200)] 
percent-util: clamp percent range before converting to 2^32 scale

Let#s better be safe than sorry and clamp the input, so that we don't
hit overflow issues.

2 years agomissing: add missing header inclusions
Lennart Poettering [Tue, 2 Nov 2021 17:15:32 +0000 (18:15 +0100)] 
missing: add missing header inclusions

These headers should work without any manual header inclusion.

2 years agotest-network: add a testcase for Router= setting 21210/head
Yu Watanabe [Tue, 2 Nov 2021 04:06:48 +0000 (13:06 +0900)] 
test-network: add a testcase for Router= setting

2 years agonetwork: dhcp-server: introduce Router= setting to specify router address
Yu Watanabe [Tue, 2 Nov 2021 03:58:50 +0000 (12:58 +0900)] 
network: dhcp-server: introduce Router= setting to specify router address

Closes #21202.

2 years agotest-keymap-util: always use kbd-model-map we ship
Franck Bui [Wed, 19 May 2021 12:14:58 +0000 (14:14 +0200)] 
test-keymap-util: always use kbd-model-map we ship

This test makes assumptions on the availability of some mappings contained in
kbd-model-map and therefore strongly relies on the version shipped by
upstream. IOW the test is likely to fail if it's installed on a system with a
more comprehensive kbd-model-map.

This patch makes the upstream kbd-model-map file available via a symlink in
test/testdata/test-keymap-util dir and makes sure that this specific version is
always used by test-keymap-util regardless of whether the test is installed and
run on a different system or directly run (optionally via meson) from the
project working dir.

2 years agoman: document cryptenroll limitations
Lennart Poettering [Tue, 2 Nov 2021 12:37:27 +0000 (13:37 +0100)] 
man: document cryptenroll limitations

Let's document this for now. We should be able to lift these limitations
sooner or later, at which point we can drop this documentation again.

These two limitations are a pitfall that people should be aware of,
before going FIDO2-only.

See: #20230 #19208

2 years agoMerge pull request #21207 from mrc0mmand/test-tweak-lvm-installation
Frantisek Sumsal [Tue, 2 Nov 2021 14:09:57 +0000 (14:09 +0000)] 
Merge pull request #21207 from mrc0mmand/test-tweak-lvm-installation

test: support the new lvm udev autoactivation

2 years agotest: support both lvm vgroup activation methods 21207/head
Frantisek Sumsal [Mon, 1 Nov 2021 22:03:26 +0000 (23:03 +0100)] 
test: support both lvm vgroup activation methods

2 years agoMerge pull request #21209 from yuwata/veth-peer-mtu
Daan De Meyer [Tue, 2 Nov 2021 09:58:39 +0000 (09:58 +0000)] 
Merge pull request #21209 from yuwata/veth-peer-mtu

network: also set MTU for veth peer interface

2 years agotest-network: add test case for MTUBytes= for veth 21209/head
Yu Watanabe [Tue, 2 Nov 2021 03:35:07 +0000 (12:35 +0900)] 
test-network: add test case for MTUBytes= for veth

2 years agonetwork/veth: also set MTU for peer interface
Yu Watanabe [Tue, 2 Nov 2021 03:25:12 +0000 (12:25 +0900)] 
network/veth: also set MTU for peer interface

Fixes #21206.

2 years agotest: support the new lvm udev autoactivation
Frantisek Sumsal [Mon, 1 Nov 2021 19:55:38 +0000 (20:55 +0100)] 
test: support the new lvm udev autoactivation

Introduced in lvm 2.03.14.
See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=67722b312390cdab29c076c912e14bd739c5c0f6

2 years agoMerge pull request #21204 from yuwata/sd-dhcp6-client-cleanups
Yu Watanabe [Mon, 1 Nov 2021 18:11:02 +0000 (03:11 +0900)] 
Merge pull request #21204 from yuwata/sd-dhcp6-client-cleanups

sd-dhcp6-client: further cleanups

2 years agosd-dhcp6-client: simplify code a bit 21204/head
Yu Watanabe [Mon, 1 Nov 2021 13:50:55 +0000 (22:50 +0900)] 
sd-dhcp6-client: simplify code a bit

Also this adds a note.

2 years agosd-dhcp6-client: do not implicitly cast to boolean
Yu Watanabe [Mon, 1 Nov 2021 13:37:26 +0000 (22:37 +0900)] 
sd-dhcp6-client: do not implicitly cast to boolean

2 years agosd-dhcp6-client: introduce dhcp6_lease_{get,set}_clientid()
Yu Watanabe [Mon, 1 Nov 2021 05:19:16 +0000 (14:19 +0900)] 
sd-dhcp6-client: introduce dhcp6_lease_{get,set}_clientid()

2 years agosd-dhcp6-client: shorten code a bit
Yu Watanabe [Mon, 1 Nov 2021 05:10:35 +0000 (14:10 +0900)] 
sd-dhcp6-client: shorten code a bit

2 years agosd-dhcp6-client: prefix variables which store results with "ret_"
Yu Watanabe [Mon, 1 Nov 2021 05:04:34 +0000 (14:04 +0900)] 
sd-dhcp6-client: prefix variables which store results with "ret_"

2 years agosd-dhcp6-client: update log messages
Yu Watanabe [Mon, 1 Nov 2021 04:57:11 +0000 (13:57 +0900)] 
sd-dhcp6-client: update log messages

2 years agoMerge pull request #21200 from yuwata/sd-dhcp6-client-server-address
Yu Watanabe [Mon, 1 Nov 2021 12:04:48 +0000 (21:04 +0900)] 
Merge pull request #21200 from yuwata/sd-dhcp6-client-server-address

sd-dhcp6-client: introduce sd_dhcp6_lease_get_server_address()

2 years agoMerge pull request #21199 from yuwata/sd-dhcp6-client-trivial-cleanups
Yu Watanabe [Mon, 1 Nov 2021 12:04:05 +0000 (21:04 +0900)] 
Merge pull request #21199 from yuwata/sd-dhcp6-client-trivial-cleanups

sd-dhcp6-client: trivial cleanups

2 years agonetwork: save server address to DHCPv6 addresses 21200/head
Yu Watanabe [Mon, 1 Nov 2021 01:35:43 +0000 (10:35 +0900)] 
network: save server address to DHCPv6 addresses

The server address will be used in later commits.

2 years agosd-dhcp6-client: introduce sd_dhcp6_lease_get_server_address()
Yu Watanabe [Mon, 1 Nov 2021 01:31:31 +0000 (10:31 +0900)] 
sd-dhcp6-client: introduce sd_dhcp6_lease_get_server_address()

2 years agosd-lldp-tx: drop unused and useless function
Yu Watanabe [Mon, 1 Nov 2021 00:34:41 +0000 (09:34 +0900)] 
sd-lldp-tx: drop unused and useless function

sd-lldp-tx does not call any callback function. So, the function is
mostly useless.

2 years agosd-dhcp6: drop unused functions
Yu Watanabe [Mon, 1 Nov 2021 00:45:29 +0000 (09:45 +0900)] 
sd-dhcp6: drop unused functions

2 years agocore: ignore failure on setting smack process label when allowed
Yu Watanabe [Mon, 1 Nov 2021 04:48:32 +0000 (13:48 +0900)] 
core: ignore failure on setting smack process label when allowed

2 years agosd-dhcp6-client: request IA_PD by default 21199/head
Yu Watanabe [Mon, 1 Nov 2021 01:02:47 +0000 (10:02 +0900)] 
sd-dhcp6-client: request IA_PD by default

For consistency with 0f5ef9b62a8f454208db69f3219c7484f87a068a.

2 years agosd-dhcp6-client: always set suitable ARP type
Yu Watanabe [Mon, 1 Nov 2021 00:51:49 +0000 (09:51 +0900)] 
sd-dhcp6-client: always set suitable ARP type

Also, drops unnecessary comparisons.

2 years agoexecute: respect selinux_context_ignore
Topi Miettinen [Sat, 30 Oct 2021 16:58:41 +0000 (19:58 +0300)] 
execute: respect selinux_context_ignore

When `SELinuxContext=` parameter is prefixed with `-`, the documentation states
that any errors determining or changing context should be ignored, but this
doesn't actually happen and the service may fail with `229/SELINUX_CONTEXT`.

Fix by adding checks to `context->selinux_context_ignore`.

Closes: #21057
2 years agomkosi: Add netcat to fedora image
Daan De Meyer [Tue, 19 Oct 2021 12:37:10 +0000 (13:37 +0100)] 
mkosi: Add netcat to fedora image

This helps with testing socket units.

2 years agocore: Delay start rate limit check when starting a unit
Daan De Meyer [Tue, 19 Oct 2021 09:45:48 +0000 (10:45 +0100)] 
core: Delay start rate limit check when starting a unit

Doing start rate limit checks before doing condition checks made
condition check failures count towards the start rate limit which
broke existing assumptions (see #21025). Run the rate limit checks
after the condition checks again to restore the previous behaviour.

2 years agocore: Move 'r' variable declaration to start of unit_start()
Daan De Meyer [Sat, 30 Oct 2021 21:12:06 +0000 (22:12 +0100)] 
core: Move 'r' variable declaration to start of unit_start()

2 years agomkosi: Install less in the mkosi Fedora image
Daan De Meyer [Sat, 30 Oct 2021 10:15:22 +0000 (11:15 +0100)] 
mkosi: Install less in the mkosi Fedora image

We're actually falling back to `more` in the mkosi image which doesn't
behave quite the same as less which is somewhat annoying. Let's make
sure `less` is installed so systemd can use it as the pager.

2 years agoMerge pull request #21175 from tohojo/dhcp-server-expire
Yu Watanabe [Fri, 29 Oct 2021 19:13:40 +0000 (04:13 +0900)] 
Merge pull request #21175 from tohojo/dhcp-server-expire

sd-dhcp-server: clear out expired leases when finding new address

2 years agoMerge pull request #21180 from yuwata/libsystemd-network-cleanups
Yu Watanabe [Fri, 29 Oct 2021 16:18:28 +0000 (01:18 +0900)] 
Merge pull request #21180 from yuwata/libsystemd-network-cleanups

libsystemd-network: drop unused functions, and _public_ attribute

2 years agosd-dhcp-server: fix address availability checks 21175/head
Toke Høiland-Jørgensen [Fri, 29 Oct 2021 10:24:33 +0000 (12:24 +0200)] 
sd-dhcp-server: fix address availability checks

The checks for finding a new available address in the pool were broken in two
ways: not using UINT32_TO_PTR() on hashmap lookups resulted in false negatives,
and the check wasn't skipping the server address if that was part of the pool.

Move the check for available addresses to a small helper function and fix both
issues, and also add a check to the REQUEST code for the server address.

2 years agosd-dhcp-server: clear out expired leases when processing requests
Toke Høiland-Jørgensen [Thu, 28 Oct 2021 20:36:51 +0000 (22:36 +0200)] 
sd-dhcp-server: clear out expired leases when processing requests

The DHCP server configuration supports setting a maximum lease time, but old
leases are never actually cleared out if the client doesn't send a RELEASE.
This causes the pool to run out of addresses on networks where clients just
disappear, which is a fairly common occurrence on wireless networks.

Fix this by cleaning up expired leases before processing client requests, so
addresses can be reused for new clients.

2 years agolibsystemd-network: drop _public_ attribute 21180/head
Yu Watanabe [Fri, 29 Oct 2021 13:13:18 +0000 (22:13 +0900)] 
libsystemd-network: drop _public_ attribute

No function in libsystemd-network is exposed yet.

2 years agosd-radv: fix implicit conversion to boolean
Yu Watanabe [Fri, 29 Oct 2021 13:10:43 +0000 (22:10 +0900)] 
sd-radv: fix implicit conversion to boolean

2 years agosd-ndisc: drop unused functions
Yu Watanabe [Fri, 29 Oct 2021 13:05:16 +0000 (22:05 +0900)] 
sd-ndisc: drop unused functions

All received information is stored in sd_ndisc_router, and we have
sd_ndisc_router_get_mtu() and sd_ndisc_router_get_hop_limit().

2 years agohome: fix use of uninitialized value
Yu Watanabe [Fri, 29 Oct 2021 07:27:50 +0000 (16:27 +0900)] 
home: fix use of uninitialized value

Fixes CID#1465077.

2 years agoMerge pull request #21172 from poettering/fix-systemctl-cgroup-tree
Lennart Poettering [Fri, 29 Oct 2021 07:17:43 +0000 (09:17 +0200)] 
Merge pull request #21172 from poettering/fix-systemctl-cgroup-tree

fix "sytemctl status" cgroup tree output

2 years agohomework,repart: turn on cryptsetup logging before we have a context
Lennart Poettering [Thu, 28 Oct 2021 17:06:52 +0000 (19:06 +0200)] 
homework,repart: turn on cryptsetup logging before we have a context

Otherwise we'll miss the log message from allocation of the context. We
already made this change in most of our tools that interface with
libcryptsetup, but we forgot two.

As suggested:

https://github.com/systemd/systemd/pull/21135#discussion_r738287504

2 years agonspawn: make sure to chown() implicit source dirs for --bind= to container root UID
Lennart Poettering [Thu, 28 Oct 2021 13:10:42 +0000 (15:10 +0200)] 
nspawn: make sure to chown() implicit source dirs for --bind= to container root UID

This makes sure that a switch like --bind=:/foo does the right thing if
user namespacing is one: the backing dir should be owned by the
container's root UID not the host's. Thus, whenever the source path is
left empty and we automatically generate a source dir as temporary
directory, ensure it's owned by the right UID.

Fixes: #20869
2 years agoMerge pull request #21163 from poettering/scope-no-pid
Yu Watanabe [Fri, 29 Oct 2021 07:14:51 +0000 (16:14 +0900)] 
Merge pull request #21163 from poettering/scope-no-pid

pid1: fail scope unit activation if all PIDs to add already died

2 years agoMerge pull request #20321 from bluca/state_dir_symlink
Lennart Poettering [Thu, 28 Oct 2021 18:52:56 +0000 (20:52 +0200)] 
Merge pull request #20321 from bluca/state_dir_symlink

core: add [State|Runtime|Cache|Logs]DirectorySymlink

2 years agoMerge pull request #20609 from DaanDeMeyer/recursive-template
Lennart Poettering [Thu, 28 Oct 2021 17:23:17 +0000 (19:23 +0200)] 
Merge pull request #20609 from DaanDeMeyer/recursive-template

core: Try to prevent infinite recursive template instantiation

2 years agonspawn: add filesystem id mapping support to --bind and --bind-ro
Andreas Valder [Sat, 5 Jun 2021 16:39:38 +0000 (18:39 +0200)] 
nspawn: add filesystem id mapping support to --bind and --bind-ro

2 years agoMerge pull request #21135 from poettering/homed-uidmap
Lennart Poettering [Thu, 28 Oct 2021 17:18:18 +0000 (19:18 +0200)] 
Merge pull request #21135 from poettering/homed-uidmap

homed: make use of uidmap'ped mounts for avoiding recursive chown()

2 years agosystemctl: make dbus PID cgroup tree output look more like systemd-cgls 21172/head
Lennart Poettering [Thu, 28 Oct 2021 16:54:52 +0000 (18:54 +0200)] 
systemctl: make dbus PID cgroup tree output look more like systemd-cgls

Let's add the same dash of color (well, grey, …) to the dbus-based
pid/cgroup tree output as systemd-cgls has.

2 years agosystemctl: make sure "systemctl -M status" shows cgroup tree of container not host
Lennart Poettering [Thu, 28 Oct 2021 14:44:29 +0000 (16:44 +0200)] 
systemctl: make sure "systemctl -M status" shows cgroup tree of container not host

This shows the cgroup tree of the root slice of the container now, by
querying the cgroup pid tree via the bus instead of going directly to
the cgroupfs.

A fallback is kept for really old systemd versions where querying the
PID tree was not available.

Fixes: #20958
2 years agosystemctl: only fall back to local cgroup display if we talk to local systemd
Lennart Poettering [Thu, 28 Oct 2021 14:47:40 +0000 (16:47 +0200)] 
systemctl: only fall back to local cgroup display if we talk to local systemd

Otherwise we likely show rubbish because even in local containers we
nowadays have cgroup namespacing, hence we likely can't access the
cgroup tree from the host at the same place as inside the container.

2 years agosystemctl: use LESS_BY where appropriate
Lennart Poettering [Thu, 28 Oct 2021 14:43:27 +0000 (16:43 +0200)] 
systemctl: use LESS_BY where appropriate

2 years agosystemctl: use empty_to_root() where appropriate
Lennart Poettering [Thu, 28 Oct 2021 14:42:22 +0000 (16:42 +0200)] 
systemctl: use empty_to_root() where appropriate

2 years agosystemctl: suppress second argument of ternary op where we can
Lennart Poettering [Thu, 28 Oct 2021 14:41:16 +0000 (16:41 +0200)] 
systemctl: suppress second argument of ternary op where we can

2 years agodocs: document what integer range we expect from JSON parsers
Lennart Poettering [Thu, 28 Oct 2021 11:38:59 +0000 (13:38 +0200)] 
docs: document what integer range we expect from JSON parsers

2 years agocore: correct SELinux label of service credential directory
Christian Göttsche [Wed, 27 Oct 2021 17:47:49 +0000 (19:47 +0200)] 
core: correct SELinux label of service credential directory

Label the service root credential directory so write_credential() will
create entries with the label of their parent directory.

Resolves: #21134

2 years agointegritysetup: Check args to prevent assert
Tony Asleson [Wed, 27 Oct 2021 17:00:59 +0000 (12:00 -0500)] 
integritysetup: Check args to prevent assert

The utility function parse_integrity_options is used to both validate
integritytab options or validate and return values.  In the case where
we are validating only and we have specific value options we will
assert.

2 years agoudev: net_id: introduce predictable names for xen-netfront
Benjamin Herrenschmidt [Wed, 20 Oct 2021 04:18:59 +0000 (15:18 +1100)] 
udev: net_id: introduce predictable names for xen-netfront

Those devices show up as /sys/devices/vif-N, let's use that number
to name them enXN.

Without this, all schemes fail and they keep the kernel names, which can
be racy.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2 years agocore: Try to prevent infinite recursive template instantiation 20609/head
Daan De Meyer [Wed, 1 Sep 2021 09:21:28 +0000 (11:21 +0200)] 
core: Try to prevent infinite recursive template instantiation

To prevent situations like in #17602 from happening, let's drop
direct recursive template dependencies. These will almost certainly
lead to infinite recursion so let's drop them immediately to avoid
instantiating potentially thousands of irrelevant units.

Example of a template that would lead to infinite recursion which
is caught by this check:

notify@.service:

```
[Unit]
Wants=notify@%n.service
```

2 years agoMerge pull request #21167 from poettering/various-doc-tweaks
Luca Boccassi [Thu, 28 Oct 2021 10:12:09 +0000 (11:12 +0100)] 
Merge pull request #21167 from poettering/various-doc-tweaks

Four documentation tweaks

2 years agocore: add [State|Runtime|Cache|Logs]Directory symlink as second parameter 20321/head
Luca Boccassi [Wed, 14 Jul 2021 17:22:21 +0000 (18:22 +0100)] 
core: add [State|Runtime|Cache|Logs]Directory symlink as second parameter

When combined with a tmpfs on /run or /var/lib, allows to create
arbitrary and ephemeral symlinks for StateDirectory or RuntimeDirectory.
This is especially useful when sharing these directories between
different services, to make the same state/runtime directory 'backend'
appear as different names to each service, so that they can be added/removed
to a sharing agreement transparently, without code changes.

An example (simplified, but real) use case:

foo.service:
StateDirectory=foo

bar.service:
StateDirectory=bar

foo.service.d/shared.conf:
StateDirectory=
StateDirectory=shared:foo

bar.service.d/shared.conf:
StateDirectory=
StateDirectory=shared:bar

foo and bar use respectively /var/lib/foo and /var/lib/bar. Then
the orchestration layer decides to stop this sharing, the drop-in
can be removed. The services won't need any update and will keep
working and being able to store state, transparently.

To keep backward compatibility, new DBUS messages are added.

2 years agoman: document that daemons can close fds they receive via sd_listen_fds() if they... 21167/head
Lennart Poettering [Thu, 28 Oct 2021 09:05:22 +0000 (11:05 +0200)] 
man: document that daemons can close fds they receive via sd_listen_fds() if they like

Fixes: #18872
2 years agoman: document how nss-resolve and systemd-resolved communicate
Lennart Poettering [Thu, 28 Oct 2021 08:53:55 +0000 (10:53 +0200)] 
man: document how nss-resolve and systemd-resolved communicate

Fixes: #20925
2 years agodocs: document $PASSWORD in ENVIRONMENT.md
Lennart Poettering [Thu, 28 Oct 2021 08:51:12 +0000 (10:51 +0200)] 
docs: document $PASSWORD in ENVIRONMENT.md

Fixes: #20955
2 years agoman: clarify the situation of unit templates regarding "systemctl list-units" + ...
Lennart Poettering [Thu, 28 Oct 2021 08:45:02 +0000 (10:45 +0200)] 
man: clarify the situation of unit templates regarding "systemctl list-units" + "systemctl list-unit-files"

Fixes: #21075
2 years agoupdate TODO 21135/head
Lennart Poettering [Tue, 26 Oct 2021 16:41:12 +0000 (18:41 +0200)] 
update TODO

2 years agohomework: teach luks backend uid mapping
Lennart Poettering [Tue, 26 Oct 2021 16:34:57 +0000 (18:34 +0200)] 
homework: teach luks backend uid mapping

This teachs the LUKS backend UID mapping, similar to the existing
logic for the "directory", "subvolume" and "fscrypt" backends: the files
will be owned by "nobody" on the fs itself, but will be mapped to
logging in user via uidmapped mounts.

This way LUKS home dirs become truly portable: no local UID info will
leak onto the images anymore, and the need to recursively chown them on
activation goes away. This means activation is always as performant as
it should be.

2 years agohomework: also move to using .image_fd field of HomeSetup in home_create_luks()
Lennart Poettering [Tue, 26 Oct 2021 15:44:14 +0000 (17:44 +0200)] 
homework: also move to using .image_fd field of HomeSetup in home_create_luks()

One last resource we can manage with HomeSetup, instead of doing that
manually.

2 years agohomework: get rid of manual error path in home_create_luks()
Lennart Poettering [Tue, 26 Oct 2021 15:40:21 +0000 (17:40 +0200)] 
homework: get rid of manual error path in home_create_luks()

Now that all objects we need to destroy are managed by the HomeSetup
object we can drop our manual destruction path and just use the normal
clean-up logic implemented for HomeSetup anyway. More unification, yay!

2 years agohomework: move destruction of temporary image file into HomeSetup
Lennart Poettering [Tue, 26 Oct 2021 15:36:36 +0000 (17:36 +0200)] 
homework: move destruction of temporary image file into HomeSetup

Let's simplify things further a bit and move the destruction of the
temporary image file we operate on when creating a LUKS home into
HomeSetup, like all our other resources.

2 years agohomework: get rid of manual clean up path in home_setup_luks()
Lennart Poettering [Tue, 26 Oct 2021 15:28:51 +0000 (17:28 +0200)] 
homework: get rid of manual clean up path in home_setup_luks()

Now that we stored all our different objects inside the HomeSetup
structure, we can get rid of our manual clean-up path, since
home_setup_done() will clean up everything stored therein anyway, in the
right order.

This is the main reason we moved everything into HomeSetup in the
previous commits: so that we can share clean-up paths for these objects
with everything else.

2 years agohomework: move image_fd field in home_setup_luks() also into HomeSetup
Lennart Poettering [Tue, 26 Oct 2021 15:27:28 +0000 (17:27 +0200)] 
homework: move image_fd field in home_setup_luks() also into HomeSetup

Let's unify even more codepaths, and let's reuse the .image_fd field we
already maintain.

2 years agohomework: rework home_setup_luks() to store its root_fd also in HomeSetup
Lennart Poettering [Tue, 26 Oct 2021 15:20:56 +0000 (17:20 +0200)] 
homework: rework home_setup_luks() to store its root_fd also in HomeSetup

2 years agohomework: always pass HomeSetup param first, PasswordCache second
Lennart Poettering [Tue, 26 Oct 2021 15:16:13 +0000 (17:16 +0200)] 
homework: always pass HomeSetup param first, PasswordCache second

Some of our operations did it one way, most the other. Let's unify on
the order that is more popular.

2 years agohomework: replace homegrown syncfs_path() reimplementation by syncfs_path()
Lennart Poettering [Tue, 26 Oct 2021 11:40:16 +0000 (13:40 +0200)] 
homework: replace homegrown syncfs_path() reimplementation by syncfs_path()

2 years agohomework: unify similar code for opening existing LUKS DM devices
Lennart Poettering [Tue, 26 Oct 2021 09:07:04 +0000 (11:07 +0200)] 
homework: unify similar code for opening existing LUKS DM devices

Let's introduce a new helper acquire_open_luks_device() that combines a
few steps we keep doing at three places into one.

2 years agohomework: move all LoopDevice handling into HomeSetup too
Lennart Poettering [Tue, 26 Oct 2021 08:52:21 +0000 (10:52 +0200)] 
homework: move all LoopDevice handling into HomeSetup too

Similar story as with the DM objects: let's maintain it all as part of
HomeSetup. We do that for  part of the operations already, let's unify
that.

2 years agohomework: move all DM detachment/freeing into HomeSetup
Lennart Poettering [Mon, 25 Oct 2021 19:33:08 +0000 (21:33 +0200)] 
homework: move all DM detachment/freeing into HomeSetup

We actually already detach/free the LUKS DM devices for most operations
via HomeSetup, let's move the creation logic to also do this, in order
to unify behaviour between operations.

2 years agohomework: teach home_lock() + home_unlock() + home_deactivate() to use HomeSetup...
Lennart Poettering [Tue, 26 Oct 2021 07:18:39 +0000 (09:18 +0200)] 
homework: teach home_lock() + home_unlock() + home_deactivate() to use HomeSetup, too

This is just some minor refactoring, to make these two operations work
like the rest.

home_lock_luks() will now use the root_fd field of HomeSetup already,
but for home_unlock_luks() + home_deactivate() this change has no effect for now. (But a
later commit will change this.)

2 years agohomework: make use of .undo_mount field of HomeSetup for LUKS backend too
Lennart Poettering [Mon, 25 Oct 2021 13:10:54 +0000 (15:10 +0200)] 
homework: make use of .undo_mount field of HomeSetup for LUKS backend too

Let's move more stuff to common infra for the backends.

2 years agohomework: use HomeSetup in home_create_luks() too
Lennart Poettering [Mon, 25 Oct 2021 13:03:34 +0000 (15:03 +0200)] 
homework: use HomeSetup in home_create_luks() too

We use it for all other LUKS operations these days, and for all
home_create_xyz() calls for other backends, let's use it for the LUKS
backend too.

2 years agoMerge pull request #21162 from poettering/homed-cifs-improvements
Lennart Poettering [Thu, 28 Oct 2021 06:17:05 +0000 (08:17 +0200)] 
Merge pull request #21162 from poettering/homed-cifs-improvements

homed: various cifs backend improvements

2 years agoMerge pull request #21161 from poettering/homed-uidmap-fscrypt
Lennart Poettering [Thu, 28 Oct 2021 06:15:44 +0000 (08:15 +0200)] 
Merge pull request #21161 from poettering/homed-uidmap-fscrypt

homed: teach the fscrypt backend uidmap too