]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoMerge pull request #18481 from keszybz/rpm-restart-post-trans
Zbigniew Jędrzejewski-Szmek [Tue, 16 Feb 2021 07:25:49 +0000 (08:25 +0100)] 
Merge pull request #18481 from keszybz/rpm-restart-post-trans

Restart units after the rpm transaction

3 years agojournalctl: rotation is not a reason to warn, but certainly noteworthy
Lennart Poettering [Mon, 15 Feb 2021 22:31:54 +0000 (23:31 +0100)] 
journalctl: rotation is not a reason to warn, but certainly noteworthy

Downgrade the phrasing, since it is a bit misleading.

Fixes: #18465
3 years agoMerge pull request #18579 from keszybz/fix-fragment-id-crash
Lennart Poettering [Mon, 15 Feb 2021 22:35:25 +0000 (23:35 +0100)] 
Merge pull request #18579 from keszybz/fix-fragment-id-crash

Fix fragment id crash

3 years agoMerge pull request #18605 from poettering/suppress-repeated-stub
Lennart Poettering [Mon, 15 Feb 2021 22:06:37 +0000 (23:06 +0100)] 
Merge pull request #18605 from poettering/suppress-repeated-stub

resolved: filter repeated stub queries

3 years agoresolved: don't redundantly switch DNS servers because of transaction failures
Lennart Poettering [Thu, 5 Nov 2020 16:00:20 +0000 (17:00 +0100)] 
resolved: don't redundantly switch DNS servers because of transaction failures

When a transaction fails and we decide to switch DNS servers, don#t do
so unconditionally. Check if the current DNS server is still the same as
when the transaction was initiated. And if not, do not do anything.

That should reduce the number of redundant DNS server switches if many
parallel transactions fail simultaneously (which is pretty likely if
DNSSEC is on).

Fixes: #17040
3 years agoresolved: reuse check for link-local IP address lookups
Lennart Poettering [Mon, 9 Nov 2020 17:37:13 +0000 (18:37 +0100)] 
resolved: reuse check for link-local IP address lookups

Let's reuse accept_link_local_reverse_lookups() at one more place, where
we check for the list of link local reverase address domains. Since we
don't actually accept the domains here (but rather the opposite, not
accept), let's rename the function a bit more generically with accept_ →
match_.

While we are at it invert the if branches, to make things more easily
understandable: filter out the unwatnted stuff and have the "all good"
state as main codepath.

3 years agoMerge pull request #18604 from poettering/resolved-minor-tweaks
Zbigniew Jędrzejewski-Szmek [Mon, 15 Feb 2021 20:18:34 +0000 (21:18 +0100)] 
Merge pull request #18604 from poettering/resolved-minor-tweaks

two minor resolved tweaks

3 years agorpm: restart services in %posttrans 18481/head
Zbigniew Jędrzejewski-Szmek [Sun, 31 Jan 2021 11:11:36 +0000 (12:11 +0100)] 
rpm: restart services in %posttrans

This fixes a long-standing issue in packaging scriptlets: daemon-reload
was moved to the end of the transaction, but restarting services was still
straightaway after package installation.

https://bugzilla.redhat.com/show_bug.cgi?id=1614751

Note that daemon-reload is called twice. This wouldn't be hardly noticable,
except that now a bunch of units (at least in Fedora) generate very verbose
warnings about deprecated features. So we get those warnings twice…

reload-or-restart --needing-restart is also called twice, but the second call
is usually a noop, because the first clears the flag for restarted units. The
second call is necessary for the case where we only uninstall packages, and the
%transfiletriggerpostun trigger fires, but not the %transfiletriggerin
scriptlet.

Also note that this assumes that units are marked only for restart if paths
under @systemunitdir@ or /etc/systemd/system have been touched. I would prefer
make the trigger that does 'restart --needing-restart' fire always, but it
seems rpm doesn't have such functionality. (Except as a %transfiletrigger that
would trigger on "/*" to catch all transactions, but that seems ineffiecient
and ugly.)

3 years agorpm: order sysctl/sysusers/tmpfiles execution before package scriptlets
Zbigniew Jędrzejewski-Szmek [Fri, 5 Feb 2021 16:03:43 +0000 (17:03 +0100)] 
rpm: order sysctl/sysusers/tmpfiles execution before package scriptlets

P>1000000 is *before* "normal" scriptlets, P<1000000 is *after*. I think it
makes sense to do stuff like execution of sysctl/sysusers/tmpfiles configuration
before package scriptlets. I think that was the intent, but a single digit got
dropped ;(

Also, let's reorder the scriptlets in the file to match execution order, to
make it easier to see what is going on.

Most of those may happen in any order, but there are some exceptions:
tmpfiles should be after sysusers,
udevadm --reload should be after hwdb.

3 years agorpm: simplify daemon-reload trigger
Zbigniew Jędrzejewski-Szmek [Sun, 31 Jan 2021 13:24:46 +0000 (14:24 +0100)] 
rpm: simplify daemon-reload trigger

The trigger was initially written to use %transfiletriggerun instead
of %transfiletriggerpostun because the latter would not fire. It turned
out to a buffer overread in rpm that since has been long fixed:
https://bugzilla.redhat.com/show_bug.cgi?id=1284645
https://github.com/rpm-software-management/rpm/commit/f6521c50f6836374a0f7995f8f393aaf36e178ea

3 years agorpm: sync the shell version of triggers.systemd with the lua version
Zbigniew Jędrzejewski-Szmek [Sun, 31 Jan 2021 16:56:11 +0000 (17:56 +0100)] 
rpm: sync the shell version of triggers.systemd with the lua version

Note that this goes both ways: in particular the lua version had udev
scriptlets in the wrong package, fixed in
https://src.fedoraproject.org/rpms/systemd/c/3c9433d7cf4afc8d76660402f6c3d9d991596b83.

Add missing "|| :" so the scriptlets never fail.

3 years agorpm: pull in the alternative trigger implementation in sh
Zbigniew Jędrzejewski-Szmek [Sun, 31 Jan 2021 16:30:49 +0000 (17:30 +0100)] 
rpm: pull in the alternative trigger implementation in sh

From https://src.fedoraproject.org/rpms/systemd/blob/master/f/triggers.systemd.

In 12dde791d519bc80d5cca4ab6f088763cd481015 scriptlets were converted to lua.
This is not only faster and cleaner, but also avoids a nasty dependency loop:
rpm implements the lua scripting internally, so we don't need a working shell
for the scriplets. This is nice and all, but unfortunately ostree wants to
capture scriptlets and execute them at a later time and does not support lua.
So in Fedora we ended up with a revert back to a shell-based implementation
[1]. At the time I hoped this would only be a temporary workaround, but three
years later I think it's fair to assume that this will not happen any time
soon. But carrying the upstream lua version and the downstream sh version is
error prone. So let's import the other version into our tree too so that they
can be kept in sync.

[1] https://src.fedoraproject.org/rpms/systemd/c/8e6b39457b3e2660793821e0524855226e33e306

3 years agoMove rpm stuff into a separate src/rpm/ directory
Zbigniew Jędrzejewski-Szmek [Sun, 31 Jan 2021 16:16:32 +0000 (17:16 +0100)] 
Move rpm stuff into a separate src/rpm/ directory

It is only of interest to rpm-based distros, we can move it out of src/core/
which is pretty busy.

3 years agosystemctl: add "reload-or-restart --marked"
Zbigniew Jędrzejewski-Szmek [Fri, 5 Feb 2021 12:54:33 +0000 (13:54 +0100)] 
systemctl: add "reload-or-restart --marked"

This is almost equivalent to 'busctl call-method org.freedesktop.systemd1
/org/freedesktop/systemd1 org.freedesktop.systemd1.Manager EnqueueMarkedJobs',
but waits for the jobs to finish.

3 years agosystemctl: reduce scope of iterator variables
Zbigniew Jędrzejewski-Szmek [Fri, 5 Feb 2021 10:33:48 +0000 (11:33 +0100)] 
systemctl: reduce scope of iterator variables

3 years agocore: wrap long lines
Zbigniew Jędrzejewski-Szmek [Sat, 30 Jan 2021 18:53:58 +0000 (19:53 +0100)] 
core: wrap long lines

3 years agocore: add EnqueueMarkedJobs method to reload/restart marked units
Zbigniew Jędrzejewski-Szmek [Sat, 30 Jan 2021 18:44:15 +0000 (19:44 +0100)] 
core: add EnqueueMarkedJobs method to reload/restart marked units

We support two return types for methods that start jobs. EnqueueJob support the
full-monty mode with affected jobs. I didn't do this here, since it seems
unlikely to be used. In the common case there'd be a huge list of jobs and
affected jobs. EnqueueMarkedJobs() just returns a list of jobs that we can wait
upon.

The name of the method is generic in case we decide to add something other than
just reload/restart later on.

When errors occur, resource errors are treated as fatal, but for other error
types we queue up other jobs, and only return an error at the end. The
assumption is that the caller will ignore the result error anyway, so it's
better to try to reload/restart as much as possible.

3 years agocore: allow Markers to be set using set-property
Zbigniew Jędrzejewski-Szmek [Sat, 6 Feb 2021 10:39:55 +0000 (11:39 +0100)] 
core: allow Markers to be set using set-property

3 years agocore/dbus-unit: reduce scope of iterator variables
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 09:25:13 +0000 (10:25 +0100)] 
core/dbus-unit: reduce scope of iterator variables

3 years agocore: add Unit.Markers property
Zbigniew Jędrzejewski-Szmek [Sat, 30 Jan 2021 15:58:19 +0000 (16:58 +0100)] 
core: add Unit.Markers property

The property is never set by systemd, only reset after a stop or restart or
reload. It may externally be set to mark the unit for a later restart/reload.

I wasn't sure whether to configure the property only for the types where this
makes sense (Service, Swap, etc). But Restart() method is defined on the unit,
and also having this always under the same property name is more convenient.

3 years agoMerge pull request #18593 from keszybz/fuzz-more-systemctl-paths
Luca Boccassi [Mon, 15 Feb 2021 19:13:58 +0000 (19:13 +0000)] 
Merge pull request #18593 from keszybz/fuzz-more-systemctl-paths

Fuzz more systemctl paths

3 years agoRevert "ci: build on Fedora ELN as well"
Frantisek Sumsal [Mon, 15 Feb 2021 18:58:31 +0000 (19:58 +0100)] 
Revert "ci: build on Fedora ELN as well"

This reverts commit 58bc1735fed62bc7426187a80d166369569e799a.

The ELN composes are quite unstable and take a while to refresh. Let's
drop them again and revisit this once they get more mature to reduce
the CI noise.

3 years agoFix micmute hotkey on HP EliteBook Folio G1
RussianNeuroMancer [Mon, 15 Feb 2021 07:57:29 +0000 (15:57 +0800)] 
Fix micmute hotkey on HP EliteBook Folio G1

Desktop environments expect f20 hotkey instead of micmute

3 years agoupdate TODO
Lennart Poettering [Mon, 15 Feb 2021 18:23:05 +0000 (19:23 +0100)] 
update TODO

3 years agoresolved: filter repeated stub queries 18605/head
Lennart Poettering [Fri, 6 Nov 2020 16:30:58 +0000 (17:30 +0100)] 
resolved: filter repeated stub queries

Let's suppress repeated stub queries coming in, to minimize resource
usage. Many DNS clients are pretty aggressive regarding repeating DNS
requests, hence let's find them and suppress the follow-ups should we
need more time to fulfill the queries.

3 years agoresolved: allow DNS_PACKET_DATA() argument to be const
Lennart Poettering [Fri, 6 Nov 2020 16:30:32 +0000 (17:30 +0100)] 
resolved: allow DNS_PACKET_DATA() argument to be const

3 years agoresolved: allow DNS_PACKET_DATA() argument to be const 18604/head
Lennart Poettering [Fri, 6 Nov 2020 16:30:32 +0000 (17:30 +0100)] 
resolved: allow DNS_PACKET_DATA() argument to be const

3 years agoresolved: move mdns event sources close to the fds
Lennart Poettering [Fri, 6 Nov 2020 13:51:55 +0000 (14:51 +0100)] 
resolved: move mdns event sources close to the fds

3 years agorlimit-util: log when falling back setting limit
Pierre Dubouilh [Sun, 14 Feb 2021 23:16:30 +0000 (00:16 +0100)] 
rlimit-util: log when falling back setting limit

3 years agoMerge pull request #18580 from keszybz/signal-list
Lennart Poettering [Mon, 15 Feb 2021 13:37:03 +0000 (14:37 +0100)] 
Merge pull request #18580 from keszybz/signal-list

Add systemctl --signal=list

3 years agotest: install binaries from local d/control file
Luca Boccassi [Sun, 14 Feb 2021 19:29:42 +0000 (19:29 +0000)] 
test: install binaries from local d/control file

The source package in the apt cache might be older than the
packaging from salsa.debian.org/systemd-team/systemd so it might not
list all the current binary packages.
This is currently the case for systemd-timesyncd, so TEST-30 fails.

Simply grep the control file rather than using apt-cache when iterating
over the packages contents.

3 years agohwdb: add resolution for Waltop/MEDION batteryless graphics tablet (v:172f p:0505)
Florian Hülsmann [Sun, 14 Feb 2021 20:05:22 +0000 (21:05 +0100)] 
hwdb: add resolution for Waltop/MEDION batteryless graphics tablet (v:172f p:0505)

3 years agotree-wide: fix typo
Yu Watanabe [Mon, 15 Feb 2021 06:47:17 +0000 (15:47 +0900)] 
tree-wide: fix typo

3 years agofuzz-systemctl-parse-argv: add argv[0] values to corpus 18593/head
Zbigniew Jędrzejewski-Szmek [Mon, 15 Feb 2021 08:58:54 +0000 (09:58 +0100)] 
fuzz-systemctl-parse-argv: add argv[0] values to corpus

3 years agosystemctl: use argv[0] not program_invocation_short_name for arg dispatch
Zbigniew Jędrzejewski-Szmek [Mon, 15 Feb 2021 08:54:14 +0000 (09:54 +0100)] 
systemctl: use argv[0] not program_invocation_short_name for arg dispatch

The immediate motivation is to allow fuzz-systemctl-parse-argv to cover also
the other code paths. p_i_s_n is not getting set (and it probably shouldn't),
so the fuzzer would only cover the paths for ./systemctl, and not ./reboot,
etc. Looking at argv[0] instead, which is passed as part of the fuzzer data,
fixes that.

But I think in general it's more correct to look at argv[0] here: after all we
have all the information available through local variables and shouldn't go out
of our way to look at a global.

3 years agotest-parse-argument: add a test for the three parse_*_argument() functions 18580/head
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2021 12:35:32 +0000 (13:35 +0100)] 
test-parse-argument: add a test for the three parse_*_argument() functions

This mostly tests the return values and that the xsprintf
buffers are big enough.

3 years agoMove and rename parse_json_argument() function
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2021 10:45:01 +0000 (11:45 +0100)] 
Move and rename parse_json_argument() function

json.[ch] is a very generic implementation, and cmdline argument parsing
doesn't fit there.

3 years agoMove and rename parse_path_argument() function
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2021 10:39:48 +0000 (11:39 +0100)] 
Move and rename parse_path_argument() function

This fits better in shared/, and the new parse-argument.c file is a good home
for it.

3 years agobasic/signal-util: drop unneeded extra byte from buffer
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2021 15:02:47 +0000 (16:02 +0100)] 
basic/signal-util: drop unneeded extra byte from buffer

DECIMAL_STR_MAX() already returns +1 for NULL, so no need to do it
a second time.

3 years agosystemctl,loginctl,machinectl: add --signal=list
Zbigniew Jędrzejewski-Szmek [Sat, 13 Feb 2021 15:03:03 +0000 (16:03 +0100)] 
systemctl,loginctl,machinectl: add --signal=list

This lists numerical signal values:
$ systemctl --signal list
SIGNAL NAME
1      SIGHUP
2      SIGINT
3      SIGQUIT
...
62     SIGRTMIN+28
63     SIGRTMIN+29
64     SIGRTMIN+30

This is useful when trying to kill e.g. systemd with a specific signal number
using kill. kill doesn't accept our fancy signal names like RTMIN+4, so one
would have to calculate that value somehow. Doing
  systemctl --signal list | grep -F RTMIN+4
is a nice way of doing that.

3 years agoci: switch back to meson-0.56.2
Evgeny Vereshchagin [Mon, 15 Feb 2021 03:48:03 +0000 (03:48 +0000)] 
ci: switch back to meson-0.56.2

It seems there is another meson (0.57.0) regression preventing clang from
building systemd with --optimization=3 -Db_lto=true

By analogy with https://github.com/google/oss-fuzz/pull/5199 let's just switch
to 0.56.2 for the time being

3 years agoMerge pull request #18588 from poettering/refuse-loops
Yu Watanabe [Mon, 15 Feb 2021 02:10:32 +0000 (11:10 +0900)] 
Merge pull request #18588 from poettering/refuse-loops

resolved: try hard to never enter packet loops between resolved's stub and resolved's client

3 years agoMerge pull request #18587 from poettering/rr-count-workaround
Yu Watanabe [Mon, 15 Feb 2021 01:55:10 +0000 (10:55 +0900)] 
Merge pull request #18587 from poettering/rr-count-workaround

two fixes for handling misformed packets more gracefully.

3 years agoresolvectl: add support for various new flags
Lennart Poettering [Tue, 3 Nov 2020 19:08:51 +0000 (20:08 +0100)] 
resolvectl: add support for various new flags

3 years agoMerge pull request #18563 from poettering/nss-resolve-no-valid
Yu Watanabe [Mon, 15 Feb 2021 01:43:49 +0000 (10:43 +0900)] 
Merge pull request #18563 from poettering/nss-resolve-no-valid

timesyncd: for off dnssec in resolved

3 years agoresolved: refuse sending packets to our own stub listeners 18588/head
Lennart Poettering [Thu, 5 Nov 2020 15:27:55 +0000 (16:27 +0100)] 
resolved: refuse sending packets to our own stub listeners

A previous commit made sure that when one of our own packets is looped
back to us, we ignore it. But let's go one step further, and refuse
operation if we notice the server we talk to is our own. This way we
won't generate unnecessary traffic and can return a cleaner error.

Fixes: #17413
3 years agoresolved: refuse packets looped back to us
Lennart Poettering [Thu, 5 Nov 2020 14:40:53 +0000 (15:40 +0100)] 
resolved: refuse packets looped back to us

Fixes: #17413
3 years agoresolved: rename manager_our_packet() → manager_packet_from_local_address()
Lennart Poettering [Thu, 5 Nov 2020 14:54:47 +0000 (15:54 +0100)] 
resolved: rename manager_our_packet() → manager_packet_from_local_address()

Let's be more precise in naming this function, after all this doesn#t
actually check if the packet is really ours, but just that the source IP
address is a local one. Hence name it that way.

(This is preparation to add a helper that checks if packet belongs to
local transaction later on)

3 years agoresolved: tweak answer reserve/clone logic a bit
Lennart Poettering [Thu, 5 Nov 2020 13:11:30 +0000 (14:11 +0100)] 
resolved: tweak answer reserve/clone logic a bit

Let's add some overflow checks. Also, if 0 records are reserved, use
this as indication that a copy shall be done and do not grow the answer
beyond the current size.

3 years agoresolved: gracefully handle trailing packet garbage 18587/head
Lennart Poettering [Tue, 10 Nov 2020 13:52:25 +0000 (14:52 +0100)] 
resolved: gracefully handle trailing packet garbage

Similar to the previous commit: if we see trailing garbage in a DNS
packet, let's assume EDNS is borked too, and suppress it.

3 years agoresolved: gracefully handle with packets with too large RR count
Lennart Poettering [Tue, 10 Nov 2020 13:48:13 +0000 (14:48 +0100)] 
resolved: gracefully handle with packets with too large RR count

Apparently, there are plenty routers in place that report an incorrect
RR count in the packets: they declare more RRs than are actually
included.

Let's accept these responses, but let's downgrade them to baseline, i.e.
let's suppress OPT in this case: if they don't even get the RR count
right, let's operate on the absolute baseline, and not bother with
anything fancier such as EDNS.

Prompted-by: https://github.com/systemd/systemd/issues/12841#issuecomment-724063973
Fixes: #3980
Most likely fixes: #12841

3 years agoresolved: if request on stub has AD set, respond with valid AD even if DO is not set
Lennart Poettering [Thu, 5 Nov 2020 10:30:42 +0000 (11:30 +0100)] 
resolved: if request on stub has AD set, respond with valid AD even if DO is not set

Fixes: #6434
3 years agounits: turn off DNSSEC validation when timesyncd resolves hostnames 18563/head
Lennart Poettering [Thu, 5 Nov 2020 10:20:32 +0000 (11:20 +0100)] 
units: turn off DNSSEC validation when timesyncd resolves hostnames

We have a chicken and egg problem: validation of DNSSEC signatures
doesn't work without a correct clock, but to set the correct clock we
need to contact NTP servers which requires resolving a hostname, which
would normally require DNSSEC validation.

Let's break the cycle by excluding NTP hostname resolution from
validation for now.

Of course, this leaves NTP traffic unprotected. To cover that we need
NTPSEC support, which we can add later.

Fixes: #5873 #15607
3 years agonss-resolve: allow turning off validation via env var
Lennart Poettering [Thu, 5 Nov 2020 10:18:20 +0000 (11:18 +0100)] 
nss-resolve: allow turning off validation via env var

3 years agoMerge pull request #18565 from poettering/randomize-answers
Luca Boccassi [Sun, 14 Feb 2021 19:35:54 +0000 (19:35 +0000)] 
Merge pull request #18565 from poettering/randomize-answers

resolved: randomize order in local query replies

3 years agohwdb: Add accel orientation quirk for Reeder A8iW Tablet
Ardy [Sat, 13 Feb 2021 16:13:20 +0000 (19:13 +0300)] 
hwdb: Add accel orientation quirk for Reeder A8iW Tablet

Add a quirk to fix the accelerometer orientation on the
Reeder A8iW tablet.

3 years agosystemctl,loginctl,machinectl: use a shared helper for arg_signal
Zbigniew Jędrzejewski-Szmek [Sat, 13 Feb 2021 14:55:10 +0000 (15:55 +0100)] 
systemctl,loginctl,machinectl: use a shared helper for arg_signal

I seems frivolous to yet another two -util.[ch] files, but the helper
should be in shared/ and it doesn't seem to fit anywhere else.

3 years agoresolved: randomize RR order in answers each time we get something from the cache 18565/head
Lennart Poettering [Thu, 5 Nov 2020 13:10:40 +0000 (14:10 +0100)] 
resolved: randomize RR order in answers each time we get something from the cache

This allows some minimal, crappy load balancing.

Fixes: #16297
3 years agoanswer: minor refactor – move link local check into RR code
Lennart Poettering [Thu, 5 Nov 2020 12:34:22 +0000 (13:34 +0100)] 
answer: minor refactor – move link local check into RR code

3 years agoanswer: add helper for randomizing RR of answers
Lennart Poettering [Thu, 5 Nov 2020 12:33:52 +0000 (13:33 +0100)] 
answer: add helper for randomizing RR of answers

3 years agorandom-util: add random_u64_range() that acquires a random number from a certain...
Lennart Poettering [Wed, 11 Nov 2020 13:44:35 +0000 (14:44 +0100)] 
random-util: add random_u64_range() that acquires a random number from a certain range, unbiased

So far we have been quite sloppy with this and ignored modulus and range
bias. Let's do something about, and add the option to do better.

3 years agoTEST-15-DROPINS: add test for linked units 18579/head
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2021 14:08:49 +0000 (15:08 +0100)] 
TEST-15-DROPINS: add test for linked units

3 years agobasic/unit-file: when loading linked unit files, use link source as "fragment path"
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2021 13:38:32 +0000 (14:38 +0100)] 
basic/unit-file: when loading linked unit files, use link source as "fragment path"

The general idea is that when a unit file is "linked" (i.e. installed by
symlinking from outside of the search paths), the *destination* name is
irrelevant. It doesn't even have to be a valid unit name, or to match the type
or instance value. The obvious collorary is that we shouldn't look at the
symlink destination name to derive the unit name, instance value, or anything
else at all.

When building the name map, when we find a linked unit (possibly at the end
of a series of alias redirects), store the *source* of the final symlink as the
fragment path. This has two effects:
- we stop looking at the *target* file name to derive unit info, i.e. actually
  implement the stuff described in the first paragraph.
- we load the unit fragment through the symlink. If someone were to remove the
  symlink, we'll not load the unit. This seems like the right thing.

Fixes #18058.
Before this change, we were generally quite confused about unit alises for
linked units. Fortunately most poeple use the same symlink source and target,
so in practice we wouldn't hit this too often.

In unit_load_fragment() a comment is added to explain what we're doing there.

3 years agosystemctl: inline iterator declarations
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2021 10:50:08 +0000 (11:50 +0100)] 
systemctl: inline iterator declarations

3 years agobasic/string-table: inline the iterator declaration
Zbigniew Jędrzejewski-Szmek [Sat, 13 Feb 2021 15:08:04 +0000 (16:08 +0100)] 
basic/string-table: inline the iterator declaration

3 years agoNEWS: add a note about no longer probind mmcblk*boot*
Luca Boccassi [Sat, 13 Feb 2021 16:05:51 +0000 (16:05 +0000)] 
NEWS: add a note about no longer probind mmcblk*boot*

3 years agoNEWS: fix typo: as → at
Ansgar Burchardt [Sat, 13 Feb 2021 15:04:55 +0000 (16:04 +0100)] 
NEWS: fix typo: as → at

3 years agono blkid for mmcblk[0-9]boot[0-9]
Alan Perry [Sat, 13 Feb 2021 03:08:28 +0000 (19:08 -0800)] 
no blkid for mmcblk[0-9]boot[0-9]

Don't run blkid on mmcblk[0-9]boot[0-9] devices because they contain
bootloaders or boot parameters, and not partitions or file systems.

3 years agoMerge pull request #18401 from anitazha/oomdxattr
Zbigniew Jędrzejewski-Szmek [Sat, 13 Feb 2021 09:00:31 +0000 (10:00 +0100)] 
Merge pull request #18401 from anitazha/oomdxattr

oomd: implement avoid/omit support for cgroups

3 years agoAdded Trekstor Yourbook C11B to 60-sensor.hwdb
Nick [Fri, 12 Feb 2021 16:57:26 +0000 (16:57 +0000)] 
Added Trekstor Yourbook C11B to 60-sensor.hwdb

Added the Trekstor Yourbook C11B which is equivalent to Trekstor Primebook C11B.

3 years agoudev: make net_setup_link builtin quiet when link vanishes while we operate on it
Lennart Poettering [Fri, 12 Feb 2021 20:16:27 +0000 (21:16 +0100)] 
udev: make net_setup_link builtin quiet when link vanishes while we operate on it

Fixes: #16175
3 years agocore: slightly improve error message on load errors
Lennart Poettering [Fri, 12 Feb 2021 22:39:49 +0000 (23:39 +0100)] 
core: slightly improve error message on load errors

Let's be a bit more helpful when refusing jobs on units that failed to
load properly. We already have explicit D-Bus errors for the error
conditions that are common and expected (such as "not found"), but for
the rest we so far generate a fairly cryptic message.

Let's try to be friendlier towards users and suggest what to do on such
errors.

Fixes: #16487
3 years agoMerge pull request #18555 from yuwata/network-address-set-flag-on-remove
Yu Watanabe [Sat, 13 Feb 2021 08:44:58 +0000 (17:44 +0900)] 
Merge pull request #18555 from yuwata/network-address-set-flag-on-remove

network: address: also set IFA_FLAGS on remove

3 years agoMerge pull request #18455 from yuwata/network-change-link-state-only-when-new-address...
Yu Watanabe [Sat, 13 Feb 2021 08:43:27 +0000 (17:43 +0900)] 
Merge pull request #18455 from yuwata/network-change-link-state-only-when-new-address-or-route-will-be-assigned

network: change link state only when new address or route will be assigned

3 years agoNEWS: mention new systemctl verb and fix typo
Luca Boccassi [Fri, 12 Feb 2021 23:34:35 +0000 (23:34 +0000)] 
NEWS: mention new systemctl verb and fix typo

3 years agoman: document ManagedOOMPreference= 18401/head
Anita Zhang [Fri, 29 Jan 2021 01:35:17 +0000 (17:35 -0800)] 
man: document ManagedOOMPreference=

3 years agooom: add unit file settings for oomd avoid/omit xattrs
Anita Zhang [Thu, 28 Jan 2021 10:31:44 +0000 (02:31 -0800)] 
oom: add unit file settings for oomd avoid/omit xattrs

3 years agoMerge pull request #18568 from keszybz/v248-prep
Lennart Poettering [Fri, 12 Feb 2021 20:43:31 +0000 (21:43 +0100)] 
Merge pull request #18568 from keszybz/v248-prep

Start preparing for v238-rc1

3 years agoresolved: never route DNSSEC traffic to LLMNR/mDNS
Lennart Poettering [Tue, 3 Nov 2020 19:07:02 +0000 (20:07 +0100)] 
resolved: never route DNSSEC traffic to LLMNR/mDNS

LLMNR/mDNS don't support DNSSEC, hence there's no point in routing any
lookups asking for DNSSEC there.

This speeds up looking up DNSSEC RRs for top-level domains, since we
don't have to wait for LLMNR to complete.

3 years agoNEWS: start preparing for v248 18568/head
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 17:50:41 +0000 (18:50 +0100)] 
NEWS: start preparing for v248

3 years agohwdb: update for v248
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 15:15:53 +0000 (16:15 +0100)] 
hwdb: update for v248

As usual, it seems to be additions and updates, no major removals.

3 years agosyscall-tables: add missing preposition and fix file name path
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 15:29:26 +0000 (16:29 +0100)] 
syscall-tables: add missing preposition and fix file name path

I added an extension in 1f6f8cc8039a204609ddab79791ef22ee6340da0 but
forgot to fix the consumer script.

3 years agoMerge pull request #18558 from poettering/have-tpm2
Lennart Poettering [Fri, 12 Feb 2021 14:49:20 +0000 (15:49 +0100)] 
Merge pull request #18558 from poettering/have-tpm2

ask the uefi firmware if TPM2 support is available

3 years agotest-network: merge test_address_static and test_address_preferred_lifetime_zero_ipv6 18555/head
Yu Watanabe [Fri, 12 Feb 2021 06:01:20 +0000 (15:01 +0900)] 
test-network: merge test_address_static and test_address_preferred_lifetime_zero_ipv6

3 years agonetwork: address: do not set IFA_F_PERMANENT flag
Yu Watanabe [Fri, 12 Feb 2021 05:44:42 +0000 (14:44 +0900)] 
network: address: do not set IFA_F_PERMANENT flag

The flag is automatically set by kernel when the valid lifetime is
infinite. Note that the flag in netlink message for IPv4 address is
ignored. See set_ifa_lifetime() in kernel's net/ipv4/devinet.c.
But the flag is honored for IPv6 address. And if the flag is set with
finite valid lifetime, the address will not removed automatically by
the kernel.

3 years agonetwork: address: also set IFA_FLAGS on remove
Yu Watanabe [Thu, 11 Feb 2021 17:56:43 +0000 (02:56 +0900)] 
network: address: also set IFA_FLAGS on remove

If an address is assigned with IFA_F_MANAGETEMPADDR, then the flag must
be also set on remove. Otherwise, temporary addresses will not be
removed. See also inet6_rtm_deladdr() in kernel's net/ipv6/addrconf.c.

Fixes #13218.

3 years agonetwork: dhcp6: change link state into "configuring" only when a new address or route... 18455/head
Yu Watanabe [Wed, 3 Feb 2021 16:00:59 +0000 (01:00 +0900)] 
network: dhcp6: change link state into "configuring" only when a new address or route will be assigned

3 years agonetwork: ndisc: change link state into "configuring" only when a new address or route...
Yu Watanabe [Wed, 3 Feb 2021 16:00:42 +0000 (01:00 +0900)] 
network: ndisc: change link state into "configuring" only when a new address or route will be assigned

3 years agonetwork: dhcp6: fix condtion check
Yu Watanabe [Wed, 3 Feb 2021 15:52:28 +0000 (00:52 +0900)] 
network: dhcp6: fix condtion check

3 years agonetwork: set return value at the end of the function
Yu Watanabe [Wed, 3 Feb 2021 15:44:03 +0000 (00:44 +0900)] 
network: set return value at the end of the function

The later netlink_call_async() call may fail. We should not touch the
return value when the function failed.

3 years agonetwork: make address_configure() or friends return 1 when the address is new
Yu Watanabe [Wed, 3 Feb 2021 15:40:08 +0000 (00:40 +0900)] 
network: make address_configure() or friends return 1 when the address is new

3 years agoMerge pull request #18544 from yuwata/tree-wide-use-error-in-xxx_from_string
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 11:16:23 +0000 (12:16 +0100)] 
Merge pull request #18544 from yuwata/tree-wide-use-error-in-xxx_from_string

tree-wide: use error in xxx_from_string()

3 years agocore: pahole optimization of struct Unit
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 16:32:31 +0000 (17:32 +0100)] 
core: pahole optimization of struct Unit

We had a lone 'bool job_running_timeout_set:1', which generated a hole. Let's
move things around a bit. The structure is a tiny bit smaller and has less
holes:
        /* size: 1192, cachelines: 19, members: 149 */
        /* sum members: 1175, holes: 3, sum holes: 11 */
        /* sum bitfield members: 27 bits, bit holes: 1, sum bit holes: 7 bits */
        /* bit_padding: 14 bits */
        /* last cacheline: 40 bytes */

        /* size: 1184, cachelines: 19, members: 149 */
        /* sum members: 1175, holes: 1, sum holes: 4 */
        /* sum bitfield members: 27 bits (3 bytes) */
        /* bit_padding: 13 bits */
        /* last cacheline: 32 bytes */

3 years agomanager: remove unnecessary conditional
Zbigniew Jędrzejewski-Szmek [Sat, 30 Jan 2021 16:27:45 +0000 (17:27 +0100)] 
manager: remove unnecessary conditional

3 years agocore: add helper macros for deserialization
Zbigniew Jędrzejewski-Szmek [Sat, 30 Jan 2021 19:50:19 +0000 (20:50 +0100)] 
core: add helper macros for deserialization

A helper function would seem more natural, but there are two reasons why a
macro is needed:
- many bool fields are bitfields, so we can't take a pointer, and using a macro
  allows us to avoid taking a pointer.
- we have a few diffent types (bool, uint64_t, FreezerState), and we can have
  type safety without specifying the type by using the macro.

This also makes the error messages more informative: they print the exact field
identifier that failed, which is more useful for debugging than a description.

3 years agocore: split out a few funcs into unit-serialize.[ch]
Zbigniew Jędrzejewski-Szmek [Sat, 6 Feb 2021 07:18:42 +0000 (08:18 +0100)] 
core: split out a few funcs into unit-serialize.[ch]

Just a straightforward move and resulting include file adjustments.

3 years agosd-bus: standarize on NULL for empty signature in method calls
Zbigniew Jędrzejewski-Szmek [Fri, 5 Feb 2021 14:33:10 +0000 (15:33 +0100)] 
sd-bus: standarize on NULL for empty signature in method calls

We would use sometimes "" and sometimes NULL. They are equivalent, so let's use
NULL everywhere, except for a two places in tests.

3 years agosd-bus: extend sd_bus_message_read_strv() to paths and signatures
Zbigniew Jędrzejewski-Szmek [Fri, 5 Feb 2021 14:22:42 +0000 (15:22 +0100)] 
sd-bus: extend sd_bus_message_read_strv() to paths and signatures

It's rather convenient to be able to read all three types with this function.
Strictly speaking this change is not fully compatible, in case someone was
relying on sd_bus_message_read_strv() returning an error for anything except
"as", but I hope nobody was doing that.

3 years agoMerge pull request #18554 from yuwata/network-address-set-NLM_F_REPLACE-flag-automati...
Yu Watanabe [Fri, 12 Feb 2021 04:47:58 +0000 (13:47 +0900)] 
Merge pull request #18554 from yuwata/network-address-set-NLM_F_REPLACE-flag-automatically

network: automatically set NLM_F_REPLACE flag

3 years agocondition: if spelunking through /sys/class/tpmrm doesn't work ask EFI if TPM2 exists 18558/head
Lennart Poettering [Thu, 11 Feb 2021 22:12:46 +0000 (23:12 +0100)] 
condition: if spelunking through /sys/class/tpmrm doesn't work ask EFI if TPM2 exists

This makes ConditionSecurity=tpm2 work reliably during early boot: if
Linux doesn't know about the TPM2 then maybe the firmware does.