Lennart Poettering [Fri, 14 May 2021 16:20:32 +0000 (18:20 +0200)]
systemctl: re-align colon in status output
Lennart Poettering [Wed, 19 May 2021 14:35:16 +0000 (16:35 +0200)]
Merge pull request #19608 from keszybz/resolved-pahole
Pahole optimization for resolved's DnsQuery
Yu Watanabe [Wed, 19 May 2021 14:08:18 +0000 (23:08 +0900)]
Merge pull request #19163 from sipraga/online-if-required
network: introduce an online state that respects RequiredForOnline=
Luca Boccassi [Wed, 19 May 2021 13:33:56 +0000 (14:33 +0100)]
Merge pull request #19659 from keszybz/mkosi-naming-adjustment
Mkosi dependency naming adjustment
Frantisek Sumsal [Wed, 19 May 2021 11:58:35 +0000 (13:58 +0200)]
Merge pull request #19661 from keszybz/restore-liquid-compatibility
Restore liquid compatibility
Zbigniew Jędrzejewski-Szmek [Wed, 19 May 2021 11:53:41 +0000 (13:53 +0200)]
docs: prettify two external links
Zbigniew Jędrzejewski-Szmek [Wed, 19 May 2021 11:22:25 +0000 (13:22 +0200)]
docs: use {% raw %} to wrap jinja2 tags in documentation
As reported by @mrc0mmand:
> Since https://github.com/systemd/systemd/commit/
89f52a780e54b2eb0905a6e613f6d4afcb22256b#diff-b842e6ab4a95a695d9449d106f091e6a134d9eac8d2aee1cd8b169fcb6b3a98bR109
> the GH pages fail to build, since they use the Liquid templating language,
> which coincidentally uses a very similar tags as jinja:
> https://shopify.github.io/liquid/tags/control-flow/
>
>> The tag elif on line 112 in HACKING.md is not a recognized Liquid tag.
Frantisek Sumsal [Wed, 19 May 2021 08:49:56 +0000 (10:49 +0200)]
test: reintroduce m4 dependency for TEST-06-SELINUX
m4 is required to build the test SELinux module:
```
[ 31.321789] sh[483]: /bin/sh: line 1: m4: command not found
[ 31.882668] sh[488]: Compiling targeted systemd_test module
[ 32.120862] sh[492]: /bin/sh: line 1: m4: command not found
[ 32.159897] sh[458]: make: *** [/usr/share/selinux/devel/include/Makefile:156: tmp/systemd_test.mod] Error 127
```
Zbigniew Jędrzejewski-Szmek [Wed, 19 May 2021 08:53:32 +0000 (10:53 +0200)]
mkosi: stop pulling in vi
We have 'nano' everywhere, and it's enough for a casual edit.
Zbigniew Jędrzejewski-Szmek [Wed, 19 May 2021 08:52:17 +0000 (10:52 +0200)]
mkosi/fedora: use pkgconfig virtual provides to refer to packages
... and /usr/bin/ path for a library package which provides an executable we
care about (libxslt).
This way the mkosi dependency list corresponds directly to the names which are
used in the dependency() and find_program() lines in meson.build. It also makes
the thing more resilient to package splits and renames.
Zbigniew Jędrzejewski-Szmek [Wed, 19 May 2021 08:44:45 +0000 (10:44 +0200)]
mkosi/fedora: drop python3-devel req
I think it was only used for building the python wrappers.
C.f. https://src.fedoraproject.org/rpms/systemd/c/
ec9ca01d16bf6eda50b77f64dccf1caa06d29374?branch=rawhide.
Alvin Šipraga [Tue, 27 Apr 2021 08:58:18 +0000 (10:58 +0200)]
man: describe overall online status in networkctl(1)
Alvin Šipraga [Fri, 23 Apr 2021 12:19:56 +0000 (14:19 +0200)]
networkd-test: support online state in networkctl status output
networkctl status now outputs an online state. Fix up the tests to
account for this.
Alvin Šipraga [Tue, 6 Apr 2021 13:40:46 +0000 (15:40 +0200)]
network: show online state in networkctl status output
In case the link online state is invalid, networkctl will print
"unknown", which is sufficiently neutral. The same goes for the overall
manager online state if there are no managed links, or if
RequiredForOnline=no for all managed links.
Example output:
$ networkctl status
● State: routable
Online state: partial
Address: 172.22.0.130 on wlan0
...
$ networkctl status wlan0
● 3: wlan0
Link File: /lib/systemd/network/99-default.link
Network File: /etc/systemd/network/50-wlan0.network
Type: wlan
State: routable (configured)
Online state: online
...
Alvin Šipraga [Fri, 16 Apr 2021 13:04:24 +0000 (15:04 +0200)]
man: clarify RequiredFamilyForOnline= behaviour for online state
With new "online state" semantics in networkd, make the description of
RequiredFamilyForOnline= a little more broad. Some rewording has been
done to make the passage easier to understand.
Alvin Šipraga [Tue, 6 Apr 2021 13:56:05 +0000 (15:56 +0200)]
man: clarify RequiredForOnline= behaviour for online state
With new "online state" semantics in networkd, make the description of
RequiredForOnline= a little more broad.
Alvin Šipraga [Tue, 30 Mar 2021 21:18:08 +0000 (23:18 +0200)]
network: use the overall online state in network_is_online()
Since networkd advertises a reliable online state, use it in
network_is_online(). If for some reason networkd does not know the
online state (e.g. it does not manage any of the network interfaces),
fall back to the original best-guess logic.
Alvin Šipraga [Tue, 30 Mar 2021 19:39:18 +0000 (21:39 +0200)]
network: add an online state for links and manager
Add a new state of type LinkOnlineState which indicates whether a link
is online or not. The state is also used by networkd's manager to expose
the overall online state of the system.
The possible states are:
offline the link (or system) is offline
partial at least one required link is online (see below)
online all required links are online
For links, a link is defined to be "online" if:
- it is managed; and
- its operational state is within the range defined by
RequiredForOnline=; and
- it has an IPv4 address if RequiredFamilyForOnline=ipv4 or =both; and
- it has an IPv6 address if RequiredFamilyForOnline=ipv6 or =both.
A link is defined to be "offline" if:
- it is managed; and
- it is not online, i.e. its operational state is not within the range
defined by RequiredForOnline=, and/or it is missing an IP address in
a required address family.
Otherwise, the link online state is undefined (represented internally as
_LINK_ONLINE_STATUS_INVALID or -EINVAL). Put another way, networkd will
only offer a meaningful online state for managed links where
RequiredForOnline=yes.
For the manager, the online state is a function of the online state of
all links which are requried for online, i.e. RequiredForOnline=yes. If
all required links are online, then the manager online state is defined
to be "online". If at least one of the required links is online, then
the manager online state is defined to be "partial". If none of
the required links are online, then the manager online state is defined
to be "offline". If there are no managed links, or RequiredForOnline=no
for all managed links, then the manager online state is undefined as
above.
The purpose of the "partial" state is analogous to the --any switch in
systemd-networkd-wait-online.service(8). For example, a required link
which lacks a carrier on boot will not force the overall (manager)
online state to "offline" if there is an alternative link available.
Yu Watanabe [Wed, 19 May 2021 01:29:43 +0000 (10:29 +0900)]
Merge pull request #19611 from yuwata/network-dhcp-server-introduce-server-address
network: dhcp-server: introduce ServerAddress= setting
Yu Watanabe [Wed, 19 May 2021 01:29:16 +0000 (10:29 +0900)]
Merge pull request #19631 from yuwata/network-fix-reference-counting-issues
network: fix reference counting issues
Yu Watanabe [Wed, 19 May 2021 01:27:21 +0000 (10:27 +0900)]
Merge pull request #19630 from keszybz/jinja2
Use jinja2 for templating
Zbigniew Jędrzejewski-Szmek [Mon, 17 May 2021 19:32:49 +0000 (21:32 +0200)]
docs/HACKING: add note about template engines
Zbigniew Jędrzejewski-Szmek [Mon, 17 May 2021 10:42:34 +0000 (12:42 +0200)]
meson: add workaround for old meson
Recent meson versions include the directory name in the target name,
so there is no conflict for files with the same name in different
directories. But at least with meson-0.49.2 in buster we have conflict
with sysusers.d/systemd.conf.
Zbigniew Jędrzejewski-Szmek [Mon, 17 May 2021 08:36:30 +0000 (10:36 +0200)]
ci: drop py2 lxml, pull in jinja2
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 18:13:14 +0000 (20:13 +0200)]
units: generate ReadWritePaths= in the template
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 17:34:52 +0000 (19:34 +0200)]
meson: sort conf paths alphabetically
The order was a complete mess. Let's make it a bit more tidy.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 16:54:04 +0000 (18:54 +0200)]
man: use readable names for entities
Let's use the same names as in the jinja2 substitutions.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 16:49:04 +0000 (18:49 +0200)]
meson: drop "_YES_NO" variables
We can generate the right string in the template directly.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 16:46:59 +0000 (18:46 +0200)]
meson: use jinja2 also for custom-entities.ent
This doesn't matter too much, but makes things a bit more consistent.
A minor advantage is that the file is not a configuration file for meson
anymore, so:
a) It is not built unless pulled in by another target. Since
we don't usually build man pages by default, this saves a tiny
amount of work.
b) When the .in file is updated, meson does not reconfigure everything,
but just rebuilds the dependent targets.
Now that the conversion is finished, time for benchmarking:
a full build with default settings (and -Dstandalonebinaries=true), yields
before this pull request: 1687 targets, 148.13s user 35.17s system 317% cpu 57.697 total
with the full pull request: 1714 targets, 143.07s user 27.87s system 314% cpu 54.369 total
The difference doesn't seem significant. Partial rebuilds might be faster as
mentioned before.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 16:36:44 +0000 (18:36 +0200)]
meson: drop "substs"
We had two big 'configuration_data' objects in meson config. (There are in fact
more. On is added in this series, and there's one for efi… But those others
have a handful variables only for specific purposes and don't matter). The two
sets are 'conf' and 'substs', and were inherited from the original autotools
system. In the past there was even a third set ('m4_defines'), but @yuwata
removed it in
348b44372f36010d48d9a7dda14ef67155753a71. And those two/three
systems had very similar data, but with different variable names, because of
historical reasons. They also used subtly different quoting (.set()
vs. .set10() vs. .set_quoted()), which was required because the templating
engines were not flexible enough. This meants we had more work when changing
things, and we needed to search for different variable names, etc.
With a more flexible templating engine we can do with just one
configuration_data object.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 16:34:23 +0000 (18:34 +0200)]
meson: use jinja2 in shell-completion/
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 16:06:33 +0000 (18:06 +0200)]
efi: use meson object directly instead of going through 'substs'
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 16:03:23 +0000 (18:03 +0200)]
meson: use jinja2 in src/journal-remote
One stanza had "if install_sysconfdir_samples", while the other
"if install_sysconfdir", which looks like a mistake.
install_sysconfdir_samples is now used for both.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 15:56:15 +0000 (17:56 +0200)]
meson: use jinja2 in src/libsystemd/
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 15:52:42 +0000 (17:52 +0200)]
meson: use jinja2 for various files in src/core/
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 15:33:48 +0000 (17:33 +0200)]
meson: use jinja2 for src/libudev/
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 14:55:16 +0000 (16:55 +0200)]
meson: use jinja2 for src/resolve/
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 14:44:47 +0000 (16:44 +0200)]
meson: use jinja2 for rpm templates
The naming of variables is very inconsistent. I tried to use more
modern style naming (UNDERSCORED_TITLE_CASE), but I didn't change existing
names too much. Only SYSTEM_DATA_UNIT_PATH is renamed to SYSTEM_DATA_UNIT_DIR
to match SYSTEM_CONFIG_UNIT_DIR.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 14:45:51 +0000 (16:45 +0200)]
rpm: use %_bindir not @bindir@
We were using both in various places. To keep things simple, let
rpm do the substitution.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 14:11:04 +0000 (16:11 +0200)]
meson: use jinja2 in src/timesync/
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 14:07:19 +0000 (16:07 +0200)]
meson: use jinja2 in src/udev
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 14:04:04 +0000 (16:04 +0200)]
meson: use jinja2 in src/vconsole
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 14:01:24 +0000 (16:01 +0200)]
meson: use jinja2 in sysctl.d/
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 13:57:55 +0000 (15:57 +0200)]
meson: use conf configuration_data object to generate test-sysusers.sh
I wanted to use jinja2 templating here too, but it's hard to get right:
custom_target() strips the executable bit by default (unlike configure_file
apparently). custom_target() has install_mode setting, but it was only added
in meson-0.47, so it can't be used while we support 0.46. And without the
executable bit the test is not invoked properly. For example, "root-unittests"
in the debian package calls test-* after installation, so the executable bit
there is necessary. It would be possible to adjust the file mode after the
fact, but it would make things more complicated.
So let's use the native meson substitutions here. We don't need anything more
fancy.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 13:51:17 +0000 (15:51 +0200)]
meson: use jinja2 for rules.d templates
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 13:43:41 +0000 (15:43 +0200)]
meson: use custom configuration_data() object for man/man and man/html helpers
I want to stop using 'substs'. But in this case, configure_file() is nicer
than custom_target(), because it causes meson to immediately generate the
helpers after configuration, so it's possible to do
'meson build && build/man/man ...', without building anything first.
We only substitute one variable here, so let's use a custom configuration_data()
object.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 13:20:46 +0000 (15:20 +0200)]
Drop dependency on m4
m4 was hugely popular in the past, because autotools, automake, flex, bison and
many other things used it. But nowadays it much less popular, and might not even
be installed in the buildroot. (m4 is small, so it doesn't make a big difference.)
(FWIW, Fedora dropped make from the buildroot now,
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot. I think it's
reasonable to assume that m4 will be dropped at some point too.)
The main reason to drop m4 is that the syntax is not very nice, and we should
minimize the number of different syntaxes that we use. We still have two
(configure_file() with @FOO@ and jinja2 templates with {{foo}} and the
pythonesque conditional expressions), but at least we don't need m4 (with
m4_dnl and `quotes').
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 13:05:10 +0000 (15:05 +0200)]
meson: use jinja2 for README
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 12:55:43 +0000 (14:55 +0200)]
meson: use jinja2 for the gperf template
Jinja2 inserts an empty line after the first macro body, which I don't know how
to get rid of. Only the first macro causes problems: the other ones don't have
conditional statements at the end and the issue does not occur. As a work-around
I moved ProtectHostname to the end of the first macro.
Output is identical, except for horizontal whitespace and change in position of
ProtectHostname.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 11:57:00 +0000 (13:57 +0200)]
meson: use jinja2 for src/login
{% raw %} is needed to avoid trouble with {%k, which jinja thinks
is trying to access variable 'k'.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 11:35:51 +0000 (13:35 +0200)]
meson: use jinja2 for tmpfiles.d templates
HAVE_SMACK_RUN_LABEL was dropped back in
348b44372f36010d48d9a7dda14ef67155753a71,
so one line in etc.conf was not rendered as expected ;(
Checking if names are defined is paying for itself!
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 11:02:04 +0000 (13:02 +0200)]
meson: drop unnecessary listification
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 17:08:50 +0000 (19:08 +0200)]
units: strip out the developer comment in .service unit again
The comment talks about upstream development steps and doesn't make
sense for users. We used special '## ' syntax to strip it out during
build, but it got inadvertently reformatted as a normal comment
in
3982becc92197b920d86f03c3c52ae085e26ca60.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 09:55:36 +0000 (11:55 +0200)]
meson: use jinja2 for unit templates
We don't need two (and half) templating systems anymore, yay!
I'm keeping the changes minimal, to make the diff manageable. Some enhancements
due to a better templating system might be possible in the future.
For handling of '## ' — see the next commit.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 09:55:36 +0000 (11:55 +0200)]
meson: replace some m4 templates with jinja2
m4 was nice in '85, but the syntax feels a bit dated. Since we use python for
meson, let's use a popular python templating engine to replace some m4 usage.
A little nicety is that typos are caught:
FAILED: sysusers.d/systemd-remote.conf
/usr/bin/meson --internal exe --capture sysusers.d/systemd-remote.conf -- /home/zbyszek/src/systemd/tools/meson-render-jinja2.py config.h ../sysusers.d/systemd-remote.conf.j2
Traceback (most recent call last):
File "/home/zbyszek/src/systemd/tools/meson-render-jinja2.py", line 28, in <module>
print(render(sys.argv[2], defines))
File "/home/zbyszek/src/systemd/tools/meson-render-jinja2.py", line 24, in render
return template.render(defines)
File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/lib/python3.9/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 8, in top-level template code
jinja2.exceptions.UndefinedError: 'HAVE_MICROHTTP' is undefined
This checking mirrors what
349cc4a507c4d84fcadf61f42159ea6412717896 did for C defines.
Zbigniew Jędrzejewski-Szmek [Sun, 16 May 2021 13:31:00 +0000 (15:31 +0200)]
meson, mkosi: pull in jinja2 as required
In preparation for subsequent changes.
Zbigniew Jędrzejewski-Szmek [Fri, 7 May 2021 11:24:03 +0000 (13:24 +0200)]
modules-load: inline interator variable
Zbigniew Jędrzejewski-Szmek [Tue, 18 May 2021 08:21:34 +0000 (10:21 +0200)]
test/run-unit-tests: make script compatible with python3.6
dataclasses were added in python3.7, but bionic has python3.6.
Yes, the new code is a travesty, but it does the job.
Fixes #19640.
Yu Watanabe [Fri, 14 May 2021 06:58:15 +0000 (15:58 +0900)]
network: fix Link reference counter issue
Previously, when link_new() fails, `link_unref()` was called, so,
`Manager::links` may become dirty.
This introduces `link_drop_or_unref()` and it will be called on
failure.
Yu Watanabe [Mon, 17 May 2021 06:32:57 +0000 (15:32 +0900)]
network: also drop requests when link enters linger state
Otherwise, if link is removed, several references to the link in remain
exist in requests.
Yu Watanabe [Mon, 17 May 2021 06:40:15 +0000 (15:40 +0900)]
network: merge link_drop() and link_detach_from_manager()
link_detach_from_manager() is only called by link_drop(). It is not
necessary to split such tiny function.
Yu Watanabe [Mon, 17 May 2021 06:23:57 +0000 (15:23 +0900)]
network: fix possible message counter double decrement
When after_configure() for a request fails, then the request is not
removed from the queue at that time, and the link enters to failed
state. After that, if the link is reconfigured or its carrier is lost,
then the request is dropped from the queue, and the message_counter is
decreased. However, the counter is already or will be also decreased
when the corresponding netlink reply is received.
So, the counter is decreased twice.
Yu Watanabe [Fri, 14 May 2021 11:57:10 +0000 (20:57 +0900)]
test-network: add testcases for ServerAddress=
Yu Watanabe [Fri, 14 May 2021 11:27:33 +0000 (20:27 +0900)]
network: dhcp-server: introduce ServerAddress= setting
This may be useful when the link which DHCP server running on has
multiple static addresses.
Yu Watanabe [Fri, 14 May 2021 08:33:32 +0000 (17:33 +0900)]
network: address: introduce link_get_ipv4/ipv6_address()
Yu Watanabe [Mon, 17 May 2021 10:33:02 +0000 (19:33 +0900)]
network: use UINT32_C() macro
Yu Watanabe [Mon, 17 May 2021 10:31:55 +0000 (19:31 +0900)]
network: introduce address_set_broadcast()
Yu Watanabe [Fri, 14 May 2021 07:52:42 +0000 (16:52 +0900)]
network: use config_parse_in_addr_non_null()
Yu Watanabe [Fri, 14 May 2021 07:35:34 +0000 (16:35 +0900)]
conf-parser: introduce config_parse_in_addr_non_null()
Anita Zhang [Tue, 18 May 2021 08:23:36 +0000 (01:23 -0700)]
man: only the system manager does not pass vars in ManagerEnvironment=
User managers always pass their environment on to their children.
Make that clear in the description of ManagerEnvironment= which
states that none of those args will get passed to child processes of
service managers.
Jörg Thalheim [Mon, 17 May 2021 18:14:39 +0000 (18:14 +0000)]
fix bash shebangs
Olle Lundberg [Mon, 17 May 2021 14:20:23 +0000 (16:20 +0200)]
nspawn: bring back the word `may` in error text
In the change set
6c045a999800c62368470938307951bb669f5afc the error
text for the old flag `--private-users-chown` was repurposed for the
new flag `--private-users-ownership=own` and while doing so the word
`may` was dropped leading to a grammatically incorrect error text.
Balint Reczey [Mon, 10 May 2021 18:46:37 +0000 (20:46 +0200)]
test: Allow running only a subset of integration tests by setting SELECTED_TESTS
Zbigniew Jędrzejewski-Szmek [Mon, 17 May 2021 07:59:02 +0000 (09:59 +0200)]
mkosi: stop pulling in workaround packages
libfido2 was pulled in recently [1], and the dependency on libzstd has been
present for a long time.
nano is now the default editor in Fedora [2], but we still want to pull it in
to have an editor in minimal images.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=
1949505
[2] https://fedoraproject.org/wiki/Changes/UseNanoByDefault
Frantisek Sumsal [Sun, 16 May 2021 10:42:08 +0000 (12:42 +0200)]
ci: build with gcc-11 as well
Focal builds for gcc-11 are finally available, so let's put them into
some use.
ei-ke [Sun, 16 May 2021 16:12:12 +0000 (18:12 +0200)]
Fixed a typo
Milan [Sun, 16 May 2021 09:09:34 +0000 (11:09 +0200)]
docs: Update link to journal file format codebase
Milan [Sat, 15 May 2021 21:27:23 +0000 (23:27 +0200)]
docs: Update link to journal-def.h
tramsay [Mon, 5 Apr 2021 22:12:49 +0000 (17:12 -0500)]
network:dhcp4_server_configure returns if not able to get timezone
When /etc/localtime is a symbolic link pointing to another symbolic
link, get_timezone will return -EINVAL instead of the timezone.
This issue can cause systemd-networkd DHCPServer to fail.
Instead of returning failure, log a warning indicating that that
the timezone will not be sent.
modified: networkd-dhcp-server.c
Sebastian Blunt [Sat, 15 May 2021 03:39:54 +0000 (20:39 -0700)]
Add crypttab option silent
Adds a crypttab option 'silent' that enables the AskPasswordFlag
ASK_PASSWORD_SILENT. This allows usage of systemd-cryptsetup to default
to silent mode, rather than requiring the user to press tab every time.
Dan Streetman [Fri, 30 Apr 2021 00:21:10 +0000 (20:21 -0400)]
test: combine stdout/stderr from failed test
Printing stdout and stderr from a failed test makes it harder to
interpret what the specific problem was; instead let's print out
the lines in order as we got them when the test was run
Also save failed test output to file if ARTIFACT_DIRECTORY is defined
Zbigniew Jędrzejewski-Szmek [Sat, 15 May 2021 08:49:10 +0000 (10:49 +0200)]
Merge pull request #19612 from keszybz/meson-0.58-quieting
Make meson output quiet again
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 08:49:24 +0000 (10:49 +0200)]
resolved: fix braino with reference counting and linked lists
In
0e0fd08fc832b8f42e567d722d388eba086da5ff I added reference counts to keep
track of the DnsQueryCandidate objects. Unfortunately, dns_query_unref_candidates()
was written as
while (q->candidates)
dns_query_candidate_unref(q->candidates);
i.e. it would keep dropping the reference count as many times as needed for it
to hit 0, making the patch less than fully effective.
dns_query_unref_candidates() is renamed to dns_query_detach_candidates() and
changed to drop exactly one reference from each of the linked candidates.
Example failure:
==463== Invalid read of size 8
==463== at 0x419C93: dns_query_candidate_go (resolved-dns-query.c:159)
==463== by 0x41A143: dns_query_candidate_notify (resolved-dns-query.c:304)
==463== by 0x434BD6: dns_transaction_complete (resolved-dns-transaction.c:437)
==463== by 0x436A0F: dns_transaction_process_dnssec (resolved-dns-transaction.c:976)
==463== by 0x4378C1: dns_transaction_process_reply (resolved-dns-transaction.c:1387)
==463== by 0x437CE9: on_dns_packet (resolved-dns-transaction.c:1444)
==463== by 0x4B2DC9B: source_dispatch (sd-event.c:3512)
==463== by 0x4B2FB1F: sd_event_dispatch (sd-event.c:4077)
==463== by 0x4B2FFFA: sd_event_run (sd-event.c:4138)
==463== by 0x4B301D6: sd_event_loop (sd-event.c:4159)
==463== by 0x464A24: run (resolved.c:92)
==463== by 0x464B3C: main (resolved.c:99)
==463== Address 0x5f409d0 is 32 bytes inside a block of size 72 free'd
==463== at 0x48410E4: free (vg_replace_malloc.c:755)
==463== by 0x418EDF: mfree (alloc-util.h:48)
==463== by 0x4197E8: dns_query_candidate_free (resolved-dns-query.c:67)
==463== by 0x4198B7: dns_query_candidate_unref (resolved-dns-query.c:70)
==463== by 0x41A2E3: dns_query_unref_candidates (resolved-dns-query.c:337)
==463== by 0x41C5FE: dns_query_cname_redirect (resolved-dns-query.c:1028)
==463== by 0x41CA04: dns_query_process_cname_one (resolved-dns-query.c:1128)
==463== by 0x41CA80: dns_query_process_cname_many (resolved-dns-query.c:1157)
==463== by 0x40C0BD: bus_method_resolve_hostname_complete (resolved-bus.c:198)
==463== by 0x41B312: dns_query_complete (resolved-dns-query.c:562)
==463== by 0x41C1AC: dns_query_accept (resolved-dns-query.c:922)
==463== by 0x41C2C4: dns_query_ready (resolved-dns-query.c:955)
==463== by 0x41A162: dns_query_candidate_notify (resolved-dns-query.c:314)
==463== by 0x434BD6: dns_transaction_complete (resolved-dns-transaction.c:437)
==463== by 0x438995: dns_transaction_prepare (resolved-dns-transaction.c:1728)
==463== by 0x43921D: dns_transaction_go (resolved-dns-transaction.c:1928)
==463== by 0x419C7C: dns_query_candidate_go (resolved-dns-query.c:163)
==463== by 0x41A143: dns_query_candidate_notify (resolved-dns-query.c:304)
==463== by 0x434BD6: dns_transaction_complete (resolved-dns-transaction.c:437)
==463== by 0x436A0F: dns_transaction_process_dnssec (resolved-dns-transaction.c:976)
==463== by 0x4378C1: dns_transaction_process_reply (resolved-dns-transaction.c:1387)
==463== by 0x437CE9: on_dns_packet (resolved-dns-transaction.c:1444)
==463== by 0x4B2DC9B: source_dispatch (sd-event.c:3512)
==463== by 0x4B2FB1F: sd_event_dispatch (sd-event.c:4077)
==463== by 0x4B2FFFA: sd_event_run (sd-event.c:4138)
==463== by 0x4B301D6: sd_event_loop (sd-event.c:4159)
==463== by 0x464A24: run (resolved.c:92)
==463== by 0x464B3C: main (resolved.c:99)
==463== Block was alloc'd at
==463== at 0x483E86F: malloc (vg_replace_malloc.c:380)
==463== by 0x418F81: malloc_multiply (alloc-util.h:96)
==463== by 0x419378: dns_query_candidate_new (resolved-dns-query.c:23)
==463== by 0x41B42C: dns_query_add_candidate (resolved-dns-query.c:582)
==463== by 0x41BB7A: dns_query_go (resolved-dns-query.c:762)
==463== by 0x40CE3A: bus_method_resolve_hostname (resolved-bus.c:464)
==463== by 0x4A84B86: method_callbacks_run (bus-objects.c:414)
==463== by 0x4A87961: object_find_and_run (bus-objects.c:1323)
==463== by 0x4A87FEE: bus_process_object (bus-objects.c:1443)
==463== by 0x4AA3434: process_message (sd-bus.c:2964)
==463== by 0x4AA3623: process_running (sd-bus.c:3006)
==463== by 0x4AA4110: bus_process_internal (sd-bus.c:3226)
==463== by 0x4AA41EF: sd_bus_process (sd-bus.c:3253)
==463== by 0x4AA5343: io_callback (sd-bus.c:3604)
==463== by 0x4B2DC9B: source_dispatch (sd-event.c:3512)
==463== by 0x4B2FB1F: sd_event_dispatch (sd-event.c:4077)
==463== by 0x4B2FFFA: sd_event_run (sd-event.c:4138)
==463== by 0x4B301D6: sd_event_loop (sd-event.c:4159)
==463== by 0x464A24: run (resolved.c:92)
==463== by 0x464B3C: main (resolved.c:99)
Fixes #19376.
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 15:53:31 +0000 (17:53 +0200)]
Revert "tools/make-directive-index: parallelize"
This reverts commit
a2031de849da52aa85b7e4326c0112ed7e5b5672.
The patch itself seems OK, but it exposes a bug in lxml or libxml2-2.9.12 which
was just released. This is being resolved in
https://gitlab.gnome.org/GNOME/libxml2/-/issues/255, but it might be while. So
let's revert this for now to unbreak our CI.
Fixes #19601.
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 14:12:51 +0000 (16:12 +0200)]
meson: revert the change to unquote commands in add_install_script
Old meson fails with:
Element not a string: [<Holder: <ExternalProgram 'sh' -> ['/bin/sh']>>, '-c', 'test -n "$DESTDIR" || /bin/journalctl --update-catalog']
I'm doing it as a revert so that it's easy to undo the revert when we require
newer meson. The effect is not so bad, maybe a dozen or so lines about finding
'sh'.
Yu Watanabe [Fri, 14 May 2021 16:59:23 +0000 (01:59 +0900)]
fix typo
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 15:33:54 +0000 (17:33 +0200)]
resolved: inline iterator variable declarations
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 15:32:50 +0000 (17:32 +0200)]
resolved: drop pointless bitfield on a lone bool
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 15:31:26 +0000 (17:31 +0200)]
resolved: optimize layout of DnsPacket
We obviously have lots of those, so even small savings add up.
Bitfields are dropped because they don't give any memory savings due to
alignment requirements (but would still require more complex to access).
/* size: 184, cachelines: 3, members: 28 */
/* sum members: 172, holes: 1, sum holes: 4 */
/* sum bitfield members: 4 bits (0 bytes) */
/* padding: 7 */
/* bit_padding: 4 bits */
↓
/* size: 176, cachelines: 3, members: 28 */
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 15:28:48 +0000 (17:28 +0200)]
resolved: optimize layout of DnsTransaction
/* size: 296, cachelines: 5, members: 46 */
/* sum members: 278, holes: 5, sum holes: 17 */
/* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */
↓
/* size: 280, cachelines: 5, members: 46 */
/* sum members: 278, holes: 1, sum holes: 1 */
/* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 15:15:53 +0000 (17:15 +0200)]
resolved: rearrange DnsResourceRecord for better layout
The structure is rearranged to have less holes. Also fields in the union
are rearranged not to have holes (though most variants of the union still
have some padding at the end).
The full size does not decrease a lot, but the compiler should be able to
copy less bytes when it knows the specific type of the union.
Bitfields are dropped because they don't give any memory savings due to
alignment requirements (but would still require more complex to access).
The change from the this and previous commit:
/* size: 128, cachelines: 2, members: 13 */
/* sum members: 112, holes: 3, sum holes: 15 */
/* sum bitfield members: 2 bits, bit holes: 1, sum bit holes: 6 bits */
↓
/* size: 112, cachelines: 2, members: 13 */
/* sum members: 108, holes: 1, sum holes: 4 */
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 15:03:30 +0000 (17:03 +0200)]
resolved: use narrower types for label counts in rr
Order will be adjusted later to remove holes.
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 14:47:21 +0000 (16:47 +0200)]
resolved: shorten dns_name_count_labels()
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 09:28:17 +0000 (11:28 +0200)]
resolved: pahole optimization for DnsQuery
Change from the last three commits:
/* size: 312, cachelines: 5, members: 46 */
/* sum members: 296, holes: 5, sum holes: 16 */
↓
/* size: 288, cachelines: 5, members: 46 */
/* sum members: 286, holes: 1, sum holes: 1 */
It's not a big difference, but we might have quite a few queries in flight,
so let' make this a bit more efficient.
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 09:20:18 +0000 (11:20 +0200)]
resolved: make counter for redirects smaller
It can never go above 16, so let's use a narrower type.
Order will be adjusted later to remove holes.
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 09:12:12 +0000 (11:12 +0200)]
resolved: make counter for n_auxiliary_queries smaller
It can never go above 64, so let's use a narrower type.
Order will be adjusted later to remove holes.
Lennart Poettering [Fri, 14 May 2021 14:26:18 +0000 (16:26 +0200)]
Merge pull request #19609 from keszybz/networkd-dhcp-man
Tweak man page ordering for DHCPv[46] options
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 07:04:47 +0000 (09:04 +0200)]
resolved: indent tables for readability
Some of the tables in resolved were already doing using this convention. This
makes the rest of them do so too.
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 12:20:33 +0000 (14:20 +0200)]
meson: print autodetected sbat fields
...
Message: sbat-distro (from ID): fedora
Message: sbat-distro-summary (from NAME): Fedora
Message: sbat-distro-url (from BUG_REPORT_URL): https://bugzilla.redhat.com/
...
Zbigniew Jędrzejewski-Szmek [Fri, 14 May 2021 12:16:17 +0000 (14:16 +0200)]
meson: call find_program() once and reuse the variable everywhere
Meson 0.58 has gotten quite bad with emitting a message every time
a quoted command is used:
Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program xsltproc found: YES (/usr/bin/xsltproc)
Configuring custom-entities.ent using configuration
Message: Skipping bootctl.1 because ENABLE_EFI is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false
Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Message: Skipping loader.conf.5 because ENABLE_EFI is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
...
Let's suffer one message only for each command. Hopefully we can silence
even this when https://github.com/mesonbuild/meson/issues/8642 is
resolved.