]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agobpf-firewall: close gap when updating the firewall 19851/head
Lennart Poettering [Tue, 8 Jun 2021 17:26:39 +0000 (19:26 +0200)] 
bpf-firewall: close gap when updating the firewall

If we have BPF_F_ALLOW_MULTI support we can install the new program
before we drop the old (because we can install two program at the same
time). Let's do that, and thus fully close the firewall
gap.

2 years agobpf-program: document BPFProgram a bit
Lennart Poettering [Tue, 8 Jun 2021 16:49:50 +0000 (18:49 +0200)] 
bpf-program: document BPFProgram a bit

2 years agobpf-program: serialize attached BPF programs across daemon reexec/reload
Lennart Poettering [Tue, 8 Jun 2021 16:20:02 +0000 (18:20 +0200)] 
bpf-program: serialize attached BPF programs across daemon reexec/reload

Alternative to #17495

2 years agobpf-program: export hash_ops for BPFProgam objects
Lennart Poettering [Tue, 8 Jun 2021 16:19:38 +0000 (18:19 +0200)] 
bpf-program: export hash_ops for BPFProgam objects

2 years agobpf-program: use structured initialization when allocating BPFProgram objects
Lennart Poettering [Tue, 8 Jun 2021 16:52:43 +0000 (18:52 +0200)] 
bpf-program: use structured initialization when allocating BPFProgram objects

2 years agobpf-link: prefix function names with "bpf_"
Lennart Poettering [Tue, 8 Jun 2021 15:00:48 +0000 (17:00 +0200)] 
bpf-link: prefix function names with "bpf_"

we generally do this for all bpf functions, do so here too.

2 years agocore: rename socket-bind.[ch] → bpf-socket-bind.[ch]
Lennart Poettering [Tue, 8 Jun 2021 14:30:45 +0000 (16:30 +0200)] 
core: rename socket-bind.[ch] → bpf-socket-bind.[ch]

The other BPF infra has a file name prefix of "bpf-" hence do so here
too.

2 years agobpf: various coding style fixes
Lennart Poettering [Tue, 8 Jun 2021 14:24:10 +0000 (16:24 +0200)] 
bpf: various coding style fixes

Mostly logging related: let's downgrade logging in dlopen_bpf() for
example, and remove duplicate logging at various places. Add %m to log
messages and so on.

2 years agobpf-firewall: move destruction of IP firewall objects to bpf-firewall.c
Lennart Poettering [Tue, 8 Jun 2021 13:25:28 +0000 (15:25 +0200)] 
bpf-firewall: move destruction of IP firewall objects to bpf-firewall.c

These are so many runtime objects, let's add a bpf_firewall_close()
helper that destroys them all, and call that from unit_free(), simply as
an excercise of encapsulating more BPF code in bpf-firewall.c.

This also brings the destruction order and variable declaration order in
struct Unit into the same systematic order.

No change in behaviour just some minor refactoring.

2 years agotest-libcrypt-util: print out default for password settings, run make_salt() a few...
Zbigniew Jędrzejewski-Szmek [Tue, 8 Jun 2021 11:48:10 +0000 (13:48 +0200)] 
test-libcrypt-util: print out default for password settings, run make_salt() a few times

Inspired by
https://fedoraproject.org/wiki/Changes/yescrypt_as_default_hashing_method_for_shadow.

2 years agoresolved: fix strange function recursion
Zbigniew Jędrzejewski-Szmek [Tue, 8 Jun 2021 16:17:44 +0000 (18:17 +0200)] 
resolved: fix strange function recursion

In dns_server_unlink_marked() and dns_server_mark_all() we done recursively.
People might have dozens of servers defined, and it's better to avoid recursion
when a simple loop suffices.

dns_server_unlink_marked() would only unmark the first marked server.

Fixes #19651.

2 years agojournal-file: truncate archived journals
Vito Caputo [Sat, 14 Nov 2020 22:06:48 +0000 (14:06 -0800)] 
journal-file: truncate archived journals

Journal files have space allocated in 8MiB-aligned increments.

This can add up to substantial wasted space as many archived journals
accumulate without using all the allocated space.

This commit introduces truncating to the offset a subsequent append
would get written at when archiving.

Fixes https://github.com/systemd/systemd/issues/17613

2 years agotmpfiles: extend "Age" to accept an "age-by" argument
Srinidhi Kaushik [Tue, 8 Jun 2021 10:19:48 +0000 (15:49 +0530)] 
tmpfiles: extend "Age" to accept an "age-by" argument

For "systemd-tmpfiles --cleanup", when the "Age" parameter
is specified, the criteria for deletion is determined from
the path's last modification timestamp ("mtime"), its last
access timestamp ("atime") and its last status change
timestamp ("ctime").

For instance, if one of those paths to be cleaned up are
opened, it results in the modification of "atime", which
results file system entry to not be removed because the
default aging algorithm would skip the entry.

Add an optional "age-by" argument by extending the "Age"
parameter to restrict the clean-up for a particular type
of file timestamp, which can be specified in "tmpfiles.d"
as follows:

  [age-by:]cleanup-age, where age-by is "[abcmACBM]+"

For example:

  d /foo/bar - - - abM:1m -

Would clean-up any files that were not accessed and created,
or directories that were not modified less than a minute ago
in "/foo/bar".

Fixes: #17002
2 years agoMerge pull request #19166 from bluca/coredump_compress_on_the_fly
Lennart Poettering [Tue, 8 Jun 2021 16:24:34 +0000 (18:24 +0200)] 
Merge pull request #19166 from bluca/coredump_compress_on_the_fly

coredump: compress on the fly

2 years agoudev: make WakeOnLan= take multiple features
Yu Watanabe [Tue, 8 Jun 2021 09:09:00 +0000 (18:09 +0900)] 
udev: make WakeOnLan= take multiple features

WAKE_XXX are flag, not enum.

2 years agocore/socket: do not assign another fd to SocketPort which already has a fd on deseria...
Yu Watanabe [Tue, 8 Jun 2021 01:23:47 +0000 (10:23 +0900)] 
core/socket: do not assign another fd to SocketPort which already has a fd on deserialization

Otherwise, if a socket address is duplicated, then the previous fd is
closed.

Fixes #19843.

2 years agoMerge pull request #19817 from keszybz/switch-root-serialization
Lennart Poettering [Tue, 8 Jun 2021 16:22:58 +0000 (18:22 +0200)] 
Merge pull request #19817 from keszybz/switch-root-serialization

Drop serialization of mounts and automounts over root switch

2 years agotmpfiles: add '=' action modifier.
Allen Webb [Tue, 30 Mar 2021 14:37:11 +0000 (09:37 -0500)] 
tmpfiles: add '=' action modifier.

Add the '=' action modifier that instructs tmpfiles.d to check the file
type of a path and remove objects that do not match before trying to
open or create the path.

BUG=chromium:1186405
TEST=./test/test-systemd-tmpfiles.py "$(which systemd-tmpfiles)"

Change-Id: If807dc0db427393e9e0047aba640d0d114897c26

2 years agoman: add details on overriding top level drop-ins
Peter Morrow [Mon, 7 Jun 2021 12:05:06 +0000 (13:05 +0100)] 
man: add details on overriding top level drop-ins

When using top level drop-ins it isn't immediately obvious that one can
make use of symlinking to disable a top-level drop in for a specific
unit.

Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
2 years agocore: do not serialize mounts and automounts for switch-root 19817/head
Zbigniew Jędrzejewski-Szmek [Thu, 3 Jun 2021 17:40:01 +0000 (19:40 +0200)] 
core: do not serialize mounts and automounts for switch-root

When e.g. tmp.mount is present in the initrd, and we serialize it, switch root,
and deserialize, the new systemd is confused because it thinks /tmp is mounted.
In general, it doesn't make sense to serialize anything that refers to paths in
the old root file system.

This fixes two errors for me:

1. tmp.mount was not mounted properly before local-fs.target. It would be
mounted as some point (I guess when we re-read /proc/self/mountinfo for some
other reason). In effect systemd-tmpfiles-setup.service would see one fs, and
some other units started later a different one. In particular gdm.service would
fail because the pre-created /tmp/.X11-unix with proper permissions would not
exist at time it was started.

2. # systemd[1]: proc-sys-fs-binfmt_misc.automount: Got hangup/error on autofs pipe from kernel. Likely our automount point has been unmounted by someone or something else?
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Failed with result 'unmounted'.
   # systemd[1]: Mounting proc-sys-fs-binfmt_misc.mount...
   # systemd[1]: Mounted proc-sys-fs-binfmt_misc.mount.
   # systemd[1]: Starting systemd-binfmt.service...
   # systemd[1]: Finished systemd-binfmt.service.
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Path /proc/sys/fs/binfmt_misc is already a mount point, refusing start.
   # systemd[1]: Failed to set up automount proc-sys-fs-binfmt_misc.automount.
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Path /proc/sys/fs/binfmt_misc is already a mount point, refusing start.
   # systemd[1]: Failed to set up automount proc-sys-fs-binfmt_misc.automount.
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Path /proc/sys/fs/binfmt_misc is already a mount point, refusing start.
   # systemd[1]: Failed to set up automount proc-sys-fs-binfmt_misc.automount.
   # systemd[1]: Stopping systemd-binfmt.service...
   # systemd[1]: systemd-binfmt.service: Deactivated successfully.
   # systemd[1]: Stopped systemd-binfmt.service.

I couldn't understand the error here, but in retrospect the first line is entirely
correct: "someone or something else" was the old systemd unmounting the old root.

2 years agocoredump: check cgroups memory limit if storing on tmpfs 19166/head
Luca Boccassi [Fri, 12 Mar 2021 20:17:09 +0000 (20:17 +0000)] 
coredump: check cgroups memory limit if storing on tmpfs

When /var/lib/systemd/coredump/ is backed by a tmpfs, all disk usage
will be accounted under the systemd-coredump process cgroup memory
limit.
If MemoryMax is set, this might cause systemd-coredump to be terminated
by the kernel oom handler when writing large uncompressed core files,
even if the compressed core would fit within the limits.

Detect if a tmpfs is used, and if so check MemoryMax from the process
and slice cgroups, and do not write uncompressed core files that are
greater than half the available memory. If the limit is breached,
stop writing and compress the written chunk immediately, then delete
the uncompressed chunk to free more memory, and resume compressing
directly from STDIN.

Example debug log when this situation happens:

systemd-coredump[737455]: Setting max_size to limit writes to 51344896 bytes.
systemd-coredump[737455]: ZSTD compression finished (51344896 -> 3260 bytes, 0.0%)
systemd-coredump[737455]: ZSTD compression finished (1022786048 -> 47245 bytes, 0.0%)
systemd-coredump[737455]: Process 737445 (a.out) of user 1000 dumped core.

2 years agocompress: return uncompressed size to the caller
Luca Boccassi [Fri, 12 Mar 2021 20:16:53 +0000 (20:16 +0000)] 
compress: return uncompressed size to the caller

Useful when compressing anonymous FDs that cannot be rewund

2 years agocore: add MemoryAvailable unit property
Luca Boccassi [Wed, 26 May 2021 18:16:48 +0000 (19:16 +0100)] 
core: add MemoryAvailable unit property

Try to infer the unused memory that a unit can claim before the
memory.max limit is reached, including any limit set on any parent
slice above the unit itself.

2 years agopo: Translated using Weblate (Spanish)
Emilio Herrera [Tue, 8 Jun 2021 09:04:07 +0000 (11:04 +0200)] 
po: Translated using Weblate (Spanish)

Currently translated at 62.9% (119 of 189 strings)

Co-authored-by: Emilio Herrera <ehespinosa57@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/es/
Translation: systemd/main

2 years agoman: explain ConditionNeedsUpdate a bit more
Zbigniew Jędrzejewski-Szmek [Mon, 7 Jun 2021 10:55:55 +0000 (12:55 +0200)] 
man: explain ConditionNeedsUpdate a bit more

We were effectively doing all post-upgrade scripts twice in Fedora. We got this
wrong, so it's likely other people will get it wrong too. So let's explain
what is actually needed to make this work, but also when it's not useful.

2 years agomeson: do not share compiler flags except for emitting warnings
Yu Watanabe [Tue, 8 Jun 2021 00:23:50 +0000 (09:23 +0900)] 
meson: do not share compiler flags except for emitting warnings

Follow-up for 65267363978dbb298eb4ba9b628d028c969fa616.

Prompted by https://github.com/systemd/systemd/issues/19191#issuecomment-856312107.

2 years agoman: update docs on systemd-system.conf logging (LogTime=) (#19846)
alexlzhu [Tue, 8 Jun 2021 06:54:07 +0000 (23:54 -0700)] 
man: update docs on systemd-system.conf logging (LogTime=) (#19846)

Updating documentation for systemd to reflect that logging is done in the console.

2 years agoMerge pull request #19639 from yuwata/network-next
Yu Watanabe [Tue, 8 Jun 2021 01:29:54 +0000 (10:29 +0900)] 
Merge pull request #19639 from yuwata/network-next

network: bunch of fixes and new features

2 years agonetwork: wait for all set-link requests are processed 19639/head
Yu Watanabe [Fri, 28 May 2021 16:24:44 +0000 (01:24 +0900)] 
network: wait for all set-link requests are processed

2 years agonetwork: drop trivial aliases of link_set_state()
Yu Watanabe [Wed, 26 May 2021 16:20:29 +0000 (01:20 +0900)] 
network: drop trivial aliases of link_set_state()

2 years agonetwork: use link_request_to_set_master() or friends
Yu Watanabe [Wed, 26 May 2021 05:52:45 +0000 (14:52 +0900)] 
network: use link_request_to_set_master() or friends

2 years agonetwork: introduce link_request_to_activate()
Yu Watanabe [Fri, 28 May 2021 15:31:37 +0000 (00:31 +0900)] 
network: introduce link_request_to_activate()

The request will be processed after all setlink requests are processed.
The function will be used in later commits.

2 years agonetwork: it is not necessary to call RTM_GETLINK when carrier is gained
Yu Watanabe [Wed, 26 May 2021 04:43:05 +0000 (13:43 +0900)] 
network: it is not necessary to call RTM_GETLINK when carrier is gained

2 years agonetwork: set bridge or bond properties after master ifindex is set
Yu Watanabe [Fri, 28 May 2021 18:33:38 +0000 (03:33 +0900)] 
network: set bridge or bond properties after master ifindex is set

2 years agonetwork: sync link information after set-link request is processed
Yu Watanabe [Fri, 28 May 2021 18:25:00 +0000 (03:25 +0900)] 
network: sync link information after set-link request is processed

Some properties do not notify their changes. See do_setlink() in
net/core/rtnetlink.c of kernel.

2 years agonetwork: use link_call_getlink() where applicable
Yu Watanabe [Wed, 26 May 2021 04:45:14 +0000 (13:45 +0900)] 
network: use link_call_getlink() where applicable

2 years agonetwork: introduce link_call_getlink()
Yu Watanabe [Wed, 26 May 2021 04:44:02 +0000 (13:44 +0900)] 
network: introduce link_call_getlink()

2 years agonetwork: split link_update() into small pieces
Yu Watanabe [Wed, 26 May 2021 04:13:13 +0000 (13:13 +0900)] 
network: split link_update() into small pieces

2 years agonetwork: shorten code a bit, and reduce indentation
Yu Watanabe [Wed, 26 May 2021 04:04:26 +0000 (13:04 +0900)] 
network: shorten code a bit, and reduce indentation

2 years agonetwork: update operational state or friends on reconfigure
Yu Watanabe [Wed, 26 May 2021 04:01:59 +0000 (13:01 +0900)] 
network: update operational state or friends on reconfigure

2 years agonetwork: make link enter failed state when link_initialized() is failed
Yu Watanabe [Wed, 26 May 2021 04:00:08 +0000 (13:00 +0900)] 
network: make link enter failed state when link_initialized() is failed

2 years agonetwork: move functions
Yu Watanabe [Wed, 26 May 2021 03:47:28 +0000 (12:47 +0900)] 
network: move functions

This changes no behavior. Preparation for later commits.

2 years agonetwork: introduce link_get_master() and use it where applicable
Yu Watanabe [Wed, 26 May 2021 03:33:28 +0000 (12:33 +0900)] 
network: introduce link_get_master() and use it where applicable

2 years agonetwork: introduce link_request_to_set_bridge_vlan()
Yu Watanabe [Tue, 25 May 2021 08:32:28 +0000 (17:32 +0900)] 
network: introduce link_request_to_set_bridge_vlan()

This will be used in later commits.

2 years agosd-netlink: add IFLA_BRIDGE_FLAGS and IFLA_BRIDGE_VLAN_INFO attributes
Yu Watanabe [Tue, 25 May 2021 08:31:01 +0000 (17:31 +0900)] 
sd-netlink: add IFLA_BRIDGE_FLAGS and IFLA_BRIDGE_VLAN_INFO attributes

2 years agonetwork: expose bridge_vlan_append_info()
Yu Watanabe [Tue, 25 May 2021 08:11:54 +0000 (17:11 +0900)] 
network: expose bridge_vlan_append_info()

2 years agonetwork: introduce network_adjust_bridge_vlan()
Yu Watanabe [Tue, 25 May 2021 08:08:27 +0000 (17:08 +0900)] 
network: introduce network_adjust_bridge_vlan()

2 years agonetwork: rebreak arguments
Yu Watanabe [Tue, 25 May 2021 08:04:11 +0000 (17:04 +0900)] 
network: rebreak arguments

2 years agonetwork: rename networkd-brvlan.[ch] -> networkd-bridge-vlan.[ch]
Yu Watanabe [Tue, 25 May 2021 08:02:06 +0000 (17:02 +0900)] 
network: rename networkd-brvlan.[ch] -> networkd-bridge-vlan.[ch]

2 years agonetwork: introduce link_request_to_set_bond()
Yu Watanabe [Tue, 25 May 2021 07:49:34 +0000 (16:49 +0900)] 
network: introduce link_request_to_set_bond()

This will be used in later commits.

2 years agonetwork: introduce link_request_to_set_bridge()
Yu Watanabe [Tue, 25 May 2021 07:37:11 +0000 (16:37 +0900)] 
network: introduce link_request_to_set_bridge()

This will be used in later commits.

2 years agonetwork: introduce link_request_to_create_stacked_netdev()
Yu Watanabe [Tue, 25 May 2021 07:02:38 +0000 (16:02 +0900)] 
network: introduce link_request_to_create_stacked_netdev()

This will be used in later commits.

2 years agonetwork: introduce link_request_to_set_master()
Yu Watanabe [Tue, 25 May 2021 06:00:33 +0000 (15:00 +0900)] 
network: introduce link_request_to_set_master()

The function will be used later.

2 years agonetwork: use request queue to set IPv6LL address generation mode
Yu Watanabe [Fri, 21 May 2021 05:43:35 +0000 (14:43 +0900)] 
network: use request queue to set IPv6LL address generation mode

2 years agonetwork: use request queue to set interface group
Yu Watanabe [Fri, 21 May 2021 05:21:09 +0000 (14:21 +0900)] 
network: use request queue to set interface group

2 years agonetwork: use request queue to set MAC address
Yu Watanabe [Fri, 21 May 2021 04:57:24 +0000 (13:57 +0900)] 
network: use request queue to set MAC address

2 years agonetwork: use request queue to set link flags
Yu Watanabe [Fri, 21 May 2021 04:50:39 +0000 (13:50 +0900)] 
network: use request queue to set link flags

2 years agonetwork: use request queue to set MTU
Yu Watanabe [Thu, 20 May 2021 19:51:07 +0000 (04:51 +0900)] 
network: use request queue to set MTU

2 years agonetwork: merge link_configure() and link_configure_continue() again
Yu Watanabe [Mon, 24 May 2021 05:59:09 +0000 (14:59 +0900)] 
network: merge link_configure() and link_configure_continue() again

It is not necessary to stop whole configuration process until MTU and
IPv6LL address generation mode are set. But it is enough just setting
IPv6 MTU again after MTU is set, and dropping IPv6LL address after
setting the address generation mode.

2 years agonetwork: drop meaningless condition about setting MTU
Yu Watanabe [Mon, 24 May 2021 05:53:05 +0000 (14:53 +0900)] 
network: drop meaningless condition about setting MTU

The condition does not fix infinite loop of interface reset, as the
interface is reset after netlink reply is received, thus setting_mtu is
false.

See also #18738.

2 years agonetwork: introduces link_drop_ipv6ll_addresses()
Yu Watanabe [Sun, 23 May 2021 14:47:19 +0000 (23:47 +0900)] 
network: introduces link_drop_ipv6ll_addresses()

It is not necessary to parse whole message and store the address in
Link::addresses_foreign, as the address will be removed soon later.

2 years agonetwork: make link enter failed state on failure in link_update() and link_reset_carr...
Yu Watanabe [Tue, 18 May 2021 05:59:10 +0000 (14:59 +0900)] 
network: make link enter failed state on failure in link_update() and link_reset_carrier()

Previously, several failures in link_carrier_gained() make link enter
failed state, and other errors are ignored. Now, all failures in
link_carrier_gained(), moreover, link_update() are critical.

2 years agonetwork: rename link_acquire_conf() -> link_acquire_dynamic_conf()
Yu Watanabe [Tue, 18 May 2021 05:46:22 +0000 (14:46 +0900)] 
network: rename link_acquire_conf() -> link_acquire_dynamic_conf()

To clarify it starts dynamic configuration engines e.g. DHCP clients.

2 years agonetwork: request to configure static settings earlier
Yu Watanabe [Tue, 18 May 2021 05:42:47 +0000 (14:42 +0900)] 
network: request to configure static settings earlier

Now, all static configs should be ordered after the link gains its carrier.
So, it is not necessary to wait for that before queuing requests.

2 years agonetwork: introduce request_hash_ops to dedup requests
Yu Watanabe [Wed, 19 May 2021 02:30:35 +0000 (11:30 +0900)] 
network: introduce request_hash_ops to dedup requests

If KeepConfiguration= or ConfigureWithoutCarrier= is set, then the same
requests may be queued.

2 years agonetwork: expose hash and compare functions
Yu Watanabe [Wed, 19 May 2021 01:49:05 +0000 (10:49 +0900)] 
network: expose hash and compare functions

2 years agonetwork: use request queue to configure IPv6 proxy NDP addresses
Yu Watanabe [Tue, 18 May 2021 05:21:42 +0000 (14:21 +0900)] 
network: use request queue to configure IPv6 proxy NDP addresses

2 years agonetwork: move logic for setting proxy_ndp sysctl to networkd-sysctl.c
Yu Watanabe [Tue, 18 May 2021 05:00:48 +0000 (14:00 +0900)] 
network: move logic for setting proxy_ndp sysctl to networkd-sysctl.c

2 years agonetwork: introduce network_adjust_ipv6_proxy_ndp()
Yu Watanabe [Tue, 18 May 2021 04:59:49 +0000 (13:59 +0900)] 
network: introduce network_adjust_ipv6_proxy_ndp()

2 years agonetwork: address label: use request queue to configure address labels
Yu Watanabe [Tue, 18 May 2021 04:24:32 +0000 (13:24 +0900)] 
network: address label: use request queue to configure address labels

2 years agonetwork: address label: use struct in6_addr instead
Yu Watanabe [Tue, 18 May 2021 04:05:31 +0000 (13:05 +0900)] 
network: address label: use struct in6_addr instead

Address label is for IPv6.

2 years agonetwork: address label: refuse IPv4 mapped address with large prefix length
Yu Watanabe [Tue, 18 May 2021 04:02:16 +0000 (13:02 +0900)] 
network: address label: refuse IPv4 mapped address with large prefix length

See ip6addrlbl_alloc() in net/ipv6/addrlabel.c of kernel.

2 years agoin-addr-util: introduce in6_addr_is_ipv4_mapped_address()
Yu Watanabe [Tue, 18 May 2021 03:56:23 +0000 (12:56 +0900)] 
in-addr-util: introduce in6_addr_is_ipv4_mapped_address()

2 years agonetwork: use request queue to configure bridge MDB
Yu Watanabe [Mon, 17 May 2021 20:45:28 +0000 (05:45 +0900)] 
network: use request queue to configure bridge MDB

2 years agonetwork: rename MdbEntry -> BridgeMDB
Yu Watanabe [Mon, 17 May 2021 20:09:59 +0000 (05:09 +0900)] 
network: rename MdbEntry -> BridgeMDB

2 years agotest-network: fix setting name
Yu Watanabe [Thu, 27 May 2021 17:19:38 +0000 (02:19 +0900)] 
test-network: fix setting name

This fixes an issue introduced by 72ffb9133d686bef6d9d79e9d2899571651d5c1b.

2 years agotest-network: add a testcase for UplinkInterface= for DHCP server
Yu Watanabe [Mon, 17 May 2021 18:50:04 +0000 (03:50 +0900)] 
test-network: add a testcase for UplinkInterface= for DHCP server

2 years agonetwork: introduce UplinkInterface= setting for DHCP server
Yu Watanabe [Mon, 17 May 2021 18:42:19 +0000 (03:42 +0900)] 
network: introduce UplinkInterface= setting for DHCP server

2 years agonetwork: make manager_find_uplink() uses stored route information
Yu Watanabe [Mon, 17 May 2021 18:01:58 +0000 (03:01 +0900)] 
network: make manager_find_uplink() uses stored route information

networkd already has all information about routes. It is not necessary
to re-read them by using local_gateways().

This also makes manager_find_uplink() take family.

2 years agonetwork: restart DHCP server on carrier gain
Yu Watanabe [Tue, 18 May 2021 07:12:40 +0000 (16:12 +0900)] 
network: restart DHCP server on carrier gain

2 years agosd-dhcp-server: make sd_dhcp_server_start() no-op if it is already running
Yu Watanabe [Tue, 18 May 2021 07:12:02 +0000 (16:12 +0900)] 
sd-dhcp-server: make sd_dhcp_server_start() no-op if it is already running

2 years agonetwork: use request queue to configure DHCP server
Yu Watanabe [Mon, 17 May 2021 16:55:42 +0000 (01:55 +0900)] 
network: use request queue to configure DHCP server

2 years agocryptsetup-pkcs11: use erase_and_free for decrypted key cleanup.
Ondrej Kozina [Thu, 27 May 2021 06:50:01 +0000 (08:50 +0200)] 
cryptsetup-pkcs11: use erase_and_free for decrypted key cleanup.

It's hard to hit but it could leave decrypted key in memory on error
path.

2 years agocryptsetup: Fix misplaced assert.
Ondrej Kozina [Mon, 31 May 2021 17:08:14 +0000 (19:08 +0200)] 
cryptsetup: Fix misplaced assert.

Seems the assert should be placed in-before decrypted_key
pointer is passed to libcryptsetup API.

Original placement would trigger abort in case tpm2
hw was not present in the system while required
to activate crypt devices.

2 years agoMerge pull request #19839 from yuwata/network-address-fix-flags-handling
Yu Watanabe [Mon, 7 Jun 2021 18:38:15 +0000 (03:38 +0900)] 
Merge pull request #19839 from yuwata/network-address-fix-flags-handling

network: fix address flag handling

2 years agoinstall: allow adding plain templates to .wants/ or .requires/
Zbigniew Jędrzejewski-Szmek [Fri, 4 Jun 2021 13:26:37 +0000 (15:26 +0200)] 
install: allow adding plain templates to .wants/ or .requires/

Fixes #19437.

As reported in the bug:

> # drkonqi-coredump-processor@.service
>  ...
> [Install]
> WantedBy=systemd-coredump@.service
>
> The plan here is to have a systemd-coredump@ instance start the same %i for
> drkonqi-coredump-processor@. Works perfectly when creating the symlink manually
> ln -sv /usr/lib/systemd/system/drkonqi-coredump-processor@.service
> /etc/systemd/system/systemd-coredump@.service.wants/.

When DefaultInstance is set, we replace template references with
template@default-inst. But in this case we want to create a symlink for the
template name, so that systemd will fill in the instance from the
wanting/requiring unit. This is only possible for those units that actually
have an instance set, so we create the symlink only from .requires/ or .wants
of an instantiated unit (then this specific instance will be used), or a
template (than some instance will be inherited later).

Specifically:
...
[Install]
WantedBy=other@.service, fixed.service
DefaultInstance=inst

→ enable foo@.service creates other@.service.wants/foo@inst.service, and
other@a.service will want foo@inst.service, and other@b.service will want foo@inst.service,
and fixed.service will want foo@inst.service.

Without DefaultInstance,
→ enable foo@.service creates other@.service.wants/foo@.service, and
other@a.service would want foo@a.service, and other@b.service would want foo@b.service,
but enablement fails because no dependency can be created for fixed.service:

  Failed to enable unit, unit fixed.service is a non-template unit.

2 years agoMerge pull request #19835 from keszybz/user-manager-bpf-errors
Yu Watanabe [Mon, 7 Jun 2021 16:50:57 +0000 (01:50 +0900)] 
Merge pull request #19835 from keszybz/user-manager-bpf-errors

Silence errors about BPF object permissions in user manager

2 years agoudevadm: fix --tag-match help + description
Lennart Poettering [Mon, 7 Jun 2021 14:08:45 +0000 (16:08 +0200)] 
udevadm: fix --tag-match help + description

2 years agoMerge pull request #19837 from keszybz/disable-more-units
Yu Watanabe [Mon, 7 Jun 2021 16:46:15 +0000 (01:46 +0900)] 
Merge pull request #19837 from keszybz/disable-more-units

Disable more units

2 years agoMerge pull request #19815 from yuwata/sd-device-clone
Yu Watanabe [Mon, 7 Jun 2021 16:45:45 +0000 (01:45 +0900)] 
Merge pull request #19815 from yuwata/sd-device-clone

sd-device: make cloned sd_device object can read udev database without uevent file

2 years agoMerge pull request #19820 from yuwata/udev-node-fix-hashed-path
Lennart Poettering [Mon, 7 Jun 2021 15:19:38 +0000 (17:19 +0200)] 
Merge pull request #19820 from yuwata/udev-node-fix-hashed-path

udev: fix conflict of hashed string

2 years agonetwork: address: always read address flag from IFA_FLAGS attribute 19839/head
Yu Watanabe [Mon, 7 Jun 2021 12:53:35 +0000 (21:53 +0900)] 
network: address: always read address flag from IFA_FLAGS attribute

Otherwise, update flag become incomplete and the IFA_F_MANAGETEMPADDR flag
will not be stored, thus no temporary addresses will be removed when
networkd requests to remove the main address.

Follow-up for a8481354f0cd2c0855472193d0f57c7a77674969.
Fixes #13218.
Fixes #19838.

2 years agonetwork: show address flag in debugging logs
Yu Watanabe [Mon, 7 Jun 2021 13:12:59 +0000 (22:12 +0900)] 
network: show address flag in debugging logs

2 years agopid1: only add a Wants= type dependency on /tmp when PrivateTmp=yes
Franck Bui [Fri, 28 Aug 2020 14:03:06 +0000 (16:03 +0200)] 
pid1: only add a Wants= type dependency on /tmp when PrivateTmp=yes

We support that tmp.mount being masked, and this should not be considered an
error.

2 years agocore: disable "update" units in the initramfs 19837/head
Zbigniew Jędrzejewski-Szmek [Mon, 7 Jun 2021 11:29:19 +0000 (13:29 +0200)] 
core: disable "update" units in the initramfs

Initially I wanted to add ConditionPathExists=!/etc/initrd-release in various
units (ldconfig.service, systemd-sysusers.service, systemd-hwdb-update.service,
systemd-journal-catalog-update, systemd-update-done.service), but I think it's
better to just disable the mechanism in the initrd altogether. Initrd images
are put together in a very particular way, and there is not need to do
post-update steps on them. If a unit from some other package winds up in the
initrd, we wouldn't want to invoke it either.

Also, any modifications are ephemeral, so any update would happen on every
use. And finally, initrd images are all about speed, and we shouldn't invoke
any unneeded services.

2 years agounits: stop automount unit when shutting down
Zbigniew Jędrzejewski-Szmek [Tue, 1 Jun 2021 06:05:03 +0000 (08:05 +0200)] 
units: stop automount unit when shutting down

This is currently our only .automount unit. We wouldn't want to trigger it
accidentally during shutdown, so let's stop it too.

2 years agoRename crypttab opt silent to password-echo
Sebastian Blunt [Thu, 3 Jun 2021 07:10:38 +0000 (00:10 -0700)] 
Rename crypttab opt silent to password-echo

Use the option name 'password-echo' instead of the generic term
'silent'.

Make the option take an argument for better control over echoing
behavior.

Related discussion in https://github.com/systemd/systemd/pull/19619

2 years agocore: downgrade errors about BPF loading when called from socket_bind_supported() 19835/head
Zbigniew Jędrzejewski-Szmek [Mon, 7 Jun 2021 08:20:30 +0000 (10:20 +0200)] 
core: downgrade errors about BPF loading when called from socket_bind_supported()

prepare_socket_bind_bpf() is called from two sites: socket_bind_supported() and
socket_bind_install_impl(). For the latter, when errors occur we certainly want
to log, since they'll be fatal for the unit.  But for the former, we should be
quiet, at least on the "expected" errors like lack of permissions. I kept error
on map resizing and such, which should not fail, at log_warning(). They are not
fatal when called from socket_bind_suppported(), but still a sign that
something is off.

Currently BPF filters can only be used by privileged users. Thus each systemd
--user will fail in socket_bind_supported(). With the patch, we only log this
at debug level.

https://lwn.net/ml/bpf/cover.1620499942.git.yifeifz2@illinois.edu/ gives some
hope that unprivileged access will be possible, so let's keep the code trying.
We might get lucky and get support for filters in user mode without any changes
on our side.

2 years agocore/bpf: add forgotten %m
Zbigniew Jędrzejewski-Szmek [Sun, 6 Jun 2021 11:12:18 +0000 (13:12 +0200)] 
core/bpf: add forgotten %m

2 years agoMerge pull request #19793 from keszybz/tmpfiles-autofs-and-globs
Luca Boccassi [Mon, 7 Jun 2021 08:14:27 +0000 (09:14 +0100)] 
Merge pull request #19793 from keszybz/tmpfiles-autofs-and-globs

tmpfiles: better handling of autofs and globs