]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agotest-env-util: Verify that \r is disallowed in env var values
Hans Ulrich Niedermann [Wed, 21 Oct 2020 20:40:18 +0000 (22:40 +0200)] 
test-env-util: Verify that \r is disallowed in env var values

This adds tests to make sure that basic/env-util considers environment
variables containing \r characters invalid, and that it removes such
variables during environment cleanup in strv_env_clean*().

test-env-util has not verified this behaviour before.

As \r characters can be used to hide information, disallowing them
helps with systemd's security barrier role, even when the \r
character comes as part of a DOS style (\r\n) line ending.

Prompted-by: https://github.com/systemd/systemd/issues/17378
3 years agoMerge pull request #16632 from keszybz/test-path-yet-again
Lennart Poettering [Thu, 22 Oct 2020 12:56:46 +0000 (14:56 +0200)] 
Merge pull request #16632 from keszybz/test-path-yet-again

Tighten handling of spawned services in tests that may fail

3 years agoMerge pull request #17415 from keszybz/logind-resolved-docs
Lennart Poettering [Thu, 22 Oct 2020 11:44:17 +0000 (13:44 +0200)] 
Merge pull request #17415 from keszybz/logind-resolved-docs

A bunch of updates to logind and resolved man pages

3 years agotest-path: relax test in "ci" and "release" modes 16632/head
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 08:07:23 +0000 (10:07 +0200)] 
test-path: relax test in "ci" and "release" modes

3 years agotests: add helper function to autodetect CI environments
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 09:29:00 +0000 (11:29 +0200)] 
tests: add helper function to autodetect CI environments

Sadly there is no standarized way to check if we're running in some
CI environment. So let's try to gather the heuristics in one helper function.

3 years agoresolved: add trailing newlines in generated file 17415/head
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 20:59:19 +0000 (22:59 +0200)] 
resolved: add trailing newlines in generated file

Fixup for b3ffa2b5f3aa68dc6ab15893d5eeba8906aa3a9e.

3 years agoresolved.conf: add empty DNSStubListenerExtra=
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 20:42:40 +0000 (22:42 +0200)] 
resolved.conf: add empty DNSStubListenerExtra=

3 years agoman: document differences between nss-resolve and nss-dns
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 15:52:37 +0000 (17:52 +0200)] 
man: document differences between nss-resolve and nss-dns

https://bugzilla.redhat.com/show_bug.cgi?id=1889012
https://serverfault.com/questions/626612/dns-just-started-resolving-my-server-prod-addresses-to-127-0-53-53
https://serverfault.com/questions/649352/what-are-the-security-implications-of-the-allow-dns-suffix-appending-to-unquali

3 years agoman/org.freedesktop.resolve1: briefly document a bunch of methods and properties
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 11:53:59 +0000 (13:53 +0200)] 
man/org.freedesktop.resolve1: briefly document a bunch of methods and properties

Fixes #13799.

3 years agoman/systemd-resolved: reword the description of query a bit
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2020 14:51:14 +0000 (16:51 +0200)] 
man/systemd-resolved: reword the description of query a bit

The phrase "routing domains" is used to mean both route-only domains and search
domains. Route-only domains are always called like that, and not just "route domains".

Some paragraphs are reordered to describe synthetisized records first, then
LLMNR, then various ways quries are routed.

Fixes #8928, hopefully.

3 years agoMerge pull request #13589 from williamvds/systemctl-edit-copy
Lennart Poettering [Thu, 22 Oct 2020 09:19:26 +0000 (11:19 +0200)] 
Merge pull request #13589 from williamvds/systemctl-edit-copy

systemctl: show original contents in comment when editing unit

3 years agopstore: don't enable crash_kexec_post_notifiers by default
Kairui Song [Tue, 4 Aug 2020 09:30:51 +0000 (17:30 +0800)] 
pstore: don't enable crash_kexec_post_notifiers by default

commit f00c36641a253f4ea659ec3def5d87ba1336eb3b enabled
crash_kexec_post_notifiers by default regardless of whether pstore
is enabled or not.

The original intention to enabled this option by default is that
it only affects kernel post-panic behavior, so should have no harm.
But this is not true if the user wants a reliable kdump.

crash_kexec_post_notifiers is known to cause problem with kdump,
and it's documented in kernel. It's not easy to fix the problem
because of how kdump works. Kdump expects the crashed kernel to
jump to an pre-loaded crash kernel, so doing any extra job before
the jump will increase the risk.

It depends on the user to choose between having a reliable kdump or
some other post-panic debug mechanic.

So it's better to keep this config untouched by default, or it may put
kdump at higher risk of failing silently. User should enable it by
uncommenting the config line manually if pstore is always needed.

Also add a inline comment inform user about the potential issue.

Thanks to Dave Young for finding out this issue.

Fixes #16661

Signed-off-by: Kairui Song <kasong@redhat.com>
3 years agoMerge pull request #17412 from mrc0mmand/ghworkflow-buildtest-improvements
Lennart Poettering [Thu, 22 Oct 2020 09:16:12 +0000 (11:16 +0200)] 
Merge pull request #17412 from mrc0mmand/ghworkflow-buildtest-improvements

ci: GH 'build test' improvements

3 years agomeson: convert developer_mode boolean to an enum
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 08:04:23 +0000 (10:04 +0200)] 
meson: convert developer_mode boolean to an enum

I initially changed this to add a third state. But even with two values having
an explicit name instead of just 0/1 is mode descriptive.

3 years agotest-path: start infinite sleep instead of a short command
Zbigniew Jędrzejewski-Szmek [Sun, 27 Sep 2020 13:33:20 +0000 (15:33 +0200)] 
test-path: start infinite sleep instead of a short command

The test sometimes fails, e.g. in bionic-s390x ci. I think it might be because
the service binary exits before we get a chance to notice that it is running:
13:59:31 --- Listing only the last 100 lines from a long log. ---
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 4639845)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 4539608)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 4439376)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 4338946)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 4238702)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 4138424)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 4038116)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3937835)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3837553)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3737250)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3636934)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3536622)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3436318)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3336021)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3235730)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3135468)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 3035158)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2934855)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2834541)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2732511)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2632255)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2532014)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2431746)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2331438)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2231213)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2130952)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 2030663)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1930428)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1830172)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1729906)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1629652)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1529368)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1429110)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1328852)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1228593)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1128320)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 1028083)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 927824)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 827564)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 724935)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 624664)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 524411)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 424124)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 323853)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 223585)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 120356)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: 18053)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 line 293: path-unit.path: state = running; result = success (left: -82385)
13:59:31 line 293: path-mycustomunit.service: state = exited; result = success
13:59:31 Test timeout when testing path-unit.path

It seems test/test-path/path-service.service wasn't actually used for anything.

3 years agotests: replace the few remaining Type=simple with Type=exec
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 07:02:36 +0000 (09:02 +0200)] 
tests: replace the few remaining Type=simple with Type=exec

Except for the places where we explicitly want to test Type=simple,
we should use Type=exec.

3 years agoxdg-autostart-generator: use Type=exec
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 07:01:48 +0000 (09:01 +0200)] 
xdg-autostart-generator: use Type=exec

We check that the binary exists before writing the service file, but
let's also not consider the service started until the fork has happened.
This is still relatively new stuff, so we're can change the implementation
details like this.

3 years agotest-path: use Type=exec
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 06:58:54 +0000 (08:58 +0200)] 
test-path: use Type=exec

In general, Type=exec is superior to Type=simple. Let's not assume that
the service is started before it was really started.

3 years agotest-path: do not fail the test if we fail to start a service because of cgroup setup
Zbigniew Jędrzejewski-Szmek [Fri, 31 Jul 2020 08:36:57 +0000 (10:36 +0200)] 
test-path: do not fail the test if we fail to start a service because of cgroup setup

The test was failing because it couldn't start the service:

path-modified.service: state = failed; result = exit-code
path-modified.path: state = waiting; result = success
path-modified.service: state = failed; result = exit-code
path-modified.path: state = waiting; result = success
path-modified.service: state = failed; result = exit-code
path-modified.path: state = waiting; result = success
path-modified.service: state = failed; result = exit-code
path-modified.path: state = waiting; result = success
path-modified.service: state = failed; result = exit-code
path-modified.path: state = waiting; result = success
path-modified.service: state = failed; result = exit-code
Failed to connect to system bus: No such file or directory
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-modified.service: Failed to create cgroup /system.slice/kojid.service/path-modified.service: Permission denied
path-modified.service: Failed to attach to cgroup /system.slice/kojid.service/path-modified.service: No such file or directory
path-modified.service: Failed at step CGROUP spawning /bin/true: No such file or directory
path-modified.service: Main process exited, code=exited, status=219/CGROUP
path-modified.service: Failed with result 'exit-code'.
Test timeout when testing path-modified.path

In fact any of the services that we try to start may fail, especially
considering that we're doing some rogue cgroup operations. See
https://github.com/systemd/systemd/pull/16603#issuecomment-679133641.

3 years agotest-path: more debugging information
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 06:56:28 +0000 (08:56 +0200)] 
test-path: more debugging information

Just to make it easier to grok what happens when test-path fails.
Change printf→log_info so that output is interleaved and not split in two
independent parts in log files.

3 years agomacro: introduce POINTER_MAX as define for (void*) -1
Lennart Poettering [Wed, 21 Oct 2020 12:31:54 +0000 (14:31 +0200)] 
macro: introduce POINTER_MAX as define for (void*) -1

Just add a safer, prettier way to write (void*) -1, that doesn't rely on
two's complement, but uses the correct underlying C constructs.

3 years agosystemctl: show original contents when editing unit 13589/head
williamvds [Wed, 21 Oct 2020 16:19:05 +0000 (17:19 +0100)] 
systemctl: show original contents when editing unit

A comment indicates the start of the new contents of the override file,
and another indicates that lines following it will be discarded once
editing is finished.
The contents of the unit file and drop-ins are listed out after this
last marker.

Adds WRITE_STRING_FILE_TRUNCATE to set O_TRUNC when opening a file.

Thanks to cgzones for providing the required SELinux function calls.

Co-authored-by: Christian Göttsche <cgzones@googlemail.com>
3 years agounits: add initrd-cryptsetup.target
Jonathan Lebon [Tue, 20 Oct 2020 20:30:20 +0000 (16:30 -0400)] 
units: add initrd-cryptsetup.target

For encrypted block devices that we need to unlock from the initramfs,
we currently rely on dracut shipping `cryptsetup.target`. This works,
but doesn't cover the case where the encrypted block device requires
networking (i.e. the `remote-cryptsetup.target` version). That target
however is traditionally dynamically enabled.

Instead, let's rework things here by adding a `initrd-cryptsetup.target`
specifically for initramfs encrypted block device setup. This plays the
role of both `cryptsetup.target` and `remote-cryptsetup.target` in the
initramfs.

Then, adapt `systemd-cryptsetup-generator` to hook all generated
services to this new unit when running from the initrd. This is
analogous to `systemd-fstab-generator` hooking all mounts to
`initrd-fs.target`, regardless of whether they're network-backed or not.

3 years agoAdd WRITE_STRING_FILE_TRUNCATE to set O_TRUNC
williamvds [Wed, 21 Oct 2020 16:18:25 +0000 (17:18 +0100)] 
Add WRITE_STRING_FILE_TRUNCATE to set O_TRUNC

3 years agoAdd strv_prepend
williamvds [Wed, 21 Oct 2020 16:14:37 +0000 (17:14 +0100)] 
Add strv_prepend

Inserts a copy of the value at the head of the list.

3 years agoMerge pull request #17356 from yuwata/sd-xxx-stop
Lennart Poettering [Wed, 21 Oct 2020 16:07:38 +0000 (18:07 +0200)] 
Merge pull request #17356 from yuwata/sd-xxx-stop

network: about sd_xxx_stop()

3 years agoMerge pull request #17400 from yuwata/network-route-counter-17396
Lennart Poettering [Wed, 21 Oct 2020 16:07:12 +0000 (18:07 +0200)] 
Merge pull request #17400 from yuwata/network-route-counter-17396

network: about route message counter

3 years agohomed: remove PAM_USER_UNKNOWN test in pam_sm_acct_mgmt
Chandradeep Dey [Sun, 18 Oct 2020 09:59:40 +0000 (15:29 +0530)] 
homed: remove PAM_USER_UNKNOWN test in pam_sm_acct_mgmt

Why this change
---------------
Assumption - PAM's auth stack is properly configured.

Currently account pam_systemd_home.so returns PAM_SUCCESS for non
systemd-homed users, and a variety of return values (including
PAM_SUCCESS) for homed users.

account pam_unix returns PAM_AUTHINFO_UNAVAIL for systemd-homed
users, and a variety of return values (including PAM_AUTHINFO_UNAVAIL)
for normal users.

No possible combination in the pam stack can let us preserve the
various return values of the modules. For example, the configuration
mentioned in the manpage causes account pam_unix to never be reached
since pam_systemd_home just returns a success for ordinary users. Users
with expired passwords are allowed to log in because a check cannot be
made.

More configuration examples and why they don't work are mentioned
in #16906 and the downstream discussion linked there.

After this change
-----------------
account pam_unix will continue to return wrong value for homed users.
But we can skip the module conditionally using the return value from
account pam_systemd_home. We can already do this with the auth and
password modules.

3 years agoci: add the libfido2 dependency for better coverage 17412/head
Frantisek Sumsal [Wed, 21 Oct 2020 14:28:22 +0000 (16:28 +0200)] 
ci: add the libfido2 dependency for better coverage

3 years agoci: build with clang-11 as well
Frantisek Sumsal [Wed, 21 Oct 2020 14:18:50 +0000 (16:18 +0200)] 
ci: build with clang-11 as well

The LLVM nightly repositories now have a separate branch for clang-11,
so let's build with it as well.

3 years agoci: bump the 'build test' image to Ubuntu Focal
Frantisek Sumsal [Wed, 21 Oct 2020 14:17:29 +0000 (16:17 +0200)] 
ci: bump the 'build test' image to Ubuntu Focal

3 years agocgtop: Display cpu time in microseonds with --raw
Arian van Putten [Wed, 14 Oct 2020 11:47:17 +0000 (13:47 +0200)] 
cgtop: Display cpu time in microseonds with --raw

this makes the CPU time easily parseable; which was the goal
of --raw in the first place.

This only triggers if --raw is combined with --cpu=time

3 years agoMerge pull request #17395 from keszybz/hwdb-drop-quotes
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 09:34:39 +0000 (11:34 +0200)] 
Merge pull request #17395 from keszybz/hwdb-drop-quotes

hwdb: drop quotes from XKB_FIXED_*= properties

3 years agoMerge pull request #16444 from oniko/luks-detached-header
Lennart Poettering [Wed, 21 Oct 2020 08:41:11 +0000 (10:41 +0200)] 
Merge pull request #16444 from oniko/luks-detached-header

Add support for detached LUKS header on kernel cmd line

3 years agotest-mountpoint-util: run test in private mount namespace
Lennart Poettering [Tue, 20 Oct 2020 12:51:01 +0000 (14:51 +0200)] 
test-mountpoint-util: run test in private mount namespace

This creates a private mount namespace for test-mountpint-util, with all
propagation from the host turned off. This gives us the guarantee that
/proc/self/mountinfo remains fixed and constant while we operate,
removing potential races against other unrelated stuff running on the
system that changes the mount table.

Prompted-by: #17050
(I doubt this actually fixes 17050, this is mostly to make sure that we
aren't possibly affected by such races in our test)

3 years agoMerge pull request #17407 from keszybz/test-ipcrm
Lennart Poettering [Wed, 21 Oct 2020 07:04:12 +0000 (09:04 +0200)] 
Merge pull request #17407 from keszybz/test-ipcrm

Make test-ipcrm not fail cryptically

3 years agodhcp-server: make parameter const
Lennart Poettering [Tue, 20 Oct 2020 12:47:44 +0000 (14:47 +0200)] 
dhcp-server: make parameter const

3 years agoMerge pull request #17297 from keszybz/tmpfiles-sysusers-disable-standalone-image
Michael Biebl [Tue, 20 Oct 2020 21:07:16 +0000 (23:07 +0200)] 
Merge pull request #17297 from keszybz/tmpfiles-sysusers-disable-standalone-image

tmpfiles,sysusers: disable --image= support in standalone versions

3 years agotest-ipcrm: modernize, skip test on permission errors 17407/head
Zbigniew Jędrzejewski-Szmek [Tue, 20 Oct 2020 16:02:54 +0000 (18:02 +0200)] 
test-ipcrm: modernize, skip test on permission errors

I now get:
$ build/test-ipcrm
Failed to enter shared memory directory /dev/shm/multipath: Permission denied
test-ipcrm: No privileges, skipping tests.

3 years agoshared/clean-ipc: improve error message a bit
Zbigniew Jędrzejewski-Szmek [Tue, 20 Oct 2020 15:57:03 +0000 (17:57 +0200)] 
shared/clean-ipc: improve error message a bit

Failed to enter shared memory directory multipath: Permission denied

Failed to enter shared memory directory /dev/shm/multipath: Permission denied

When looking at nested directories, we will print only the final two elements
of the path. That is still more useful than just the last component of the
path. To print the full path, we'd have to allocate the string, and since the
error occurs so very rarely, I think the current best-effort approach is
enough.

3 years agosd-hwdb: reduce variable scope, use periods 17395/head
Zbigniew Jędrzejewski-Szmek [Tue, 20 Oct 2020 15:23:40 +0000 (17:23 +0200)] 
sd-hwdb: reduce variable scope, use periods

3 years agosd-hwdb: allow empty properties
Zbigniew Jędrzejewski-Szmek [Tue, 20 Oct 2020 15:12:42 +0000 (17:12 +0200)] 
sd-hwdb: allow empty properties

So far we didn't allow empty properties, but it makes sense to do so, for
example to distinguish empty data from lack of data. It also makes it easy to
override properties (back to the empty) value for specific cases.

3 years agobootctl: add @current/@oneshot/@default targets to set-default/set-oneshot
Дамјан Георгиевски [Tue, 13 Oct 2020 10:25:59 +0000 (12:25 +0200)] 
bootctl: add @current/@oneshot/@default targets to set-default/set-oneshot

Using `bootctl set-default @current` will set the default loader entry
to the currently booted entry as read from the `LoaderEntrySelected` EFI
variable.

Also `bootctl set-oneshot @current` will set the oneshot loader entry to
the current booted entry.

Correspondingly `@default` and `@oneshot` can be used to read from the
LoaderEntryDefault and LoaderEntryOneshot EFI variables.

3 years agoMerge pull request #17401 from mrc0mmand/sempahore-fixups
Lennart Poettering [Tue, 20 Oct 2020 13:01:11 +0000 (15:01 +0200)] 
Merge pull request #17401 from mrc0mmand/sempahore-fixups

semaphore: try to use different keyservers

3 years agoupdate TODO
Lennart Poettering [Tue, 20 Oct 2020 12:46:55 +0000 (14:46 +0200)] 
update TODO

3 years agosemaphore: temporarily explicitly use the US image mirror 17401/head
Frantisek Sumsal [Tue, 20 Oct 2020 10:39:25 +0000 (12:39 +0200)] 
semaphore: temporarily explicitly use the US image mirror

The UK one contains an incorrectly signed index file, causing the CI to
fail.

3 years agosemaphore: try to use different keyservers
Frantisek Sumsal [Tue, 20 Oct 2020 09:22:50 +0000 (11:22 +0200)] 
semaphore: try to use different keyservers

Recently the Semaphore CI started to fail pretty much constantly due to
GPG key verification fails. After a quick search this is a pretty common
issue with the Ubuntu keyserver in the last month. To make this,
hopefully, a bit more stable, let's use a few different keyservers in
case some of them fail.

3 years agoudevadm: also support alias .device units to specify devices
Yu Watanabe [Tue, 15 Sep 2020 11:27:13 +0000 (20:27 +0900)] 
udevadm: also support alias .device units to specify devices

Previously, .device units generated by SYSTEMD_ALIAS= udev properties
are not supported to specify devices for e.g. 'udevadm info'.

Before:
```
$ udevadm info sys-subsystem-net-devices-enp0s31f6.device
Unknown device "sys-subsystem-net-devices-enp0s31f6.device": No such device
```

After:
```
$ ./udevadm info sys-subsystem-net-devices-enp0s31f6.device
P: /devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
E: INTERFACE=enp0s31f6
E: IFINDEX=2
E: SUBSYSTEM=net
E: USEC_INITIALIZED=25317523
E: ID_NET_NAMING_SCHEME=v245
(snip)
```

3 years agoAdd ACCEL_LOCATION property for Dell clamshell models
Kai-Chuan Hsieh [Thu, 8 Oct 2020 02:27:18 +0000 (10:27 +0800)] 
Add ACCEL_LOCATION property for Dell clamshell models

3 years agoutil: make size macros unsigned
Lennart Poettering [Thu, 15 Oct 2020 15:33:04 +0000 (17:33 +0200)] 
util: make size macros unsigned

By making them unsigned comparing them with other sizes is less likely
to trigger compiler warnings regarding signed/unsigned comparisons.
After all sizes (i.e. size_t) are generally assumed to be unsigned, so
these should be too.

Prompted-by: https://github.com/systemd/systemd/pull/17345#issuecomment-709402332
3 years agonetwork: call netlink in the last of route_configure() 17400/head
Yu Watanabe [Tue, 20 Oct 2020 06:44:21 +0000 (15:44 +0900)] 
network: call netlink in the last of route_configure()

Otherwise, assertion will be hit when route_add() fails.

3 years agohwdb: drop quotes from XKB_FIXED_*= properties
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 16:01:20 +0000 (18:01 +0200)] 
hwdb: drop quotes from XKB_FIXED_*= properties

The properties are not unquoted by udev, so the quotes effectively became part
of the value.

Even though those properties were added quite a while ago
(086c001e29a86287d7b639cb71d1fc6408920c53,
d7d31692bf7cde5dce7f4ed3cae429a5b302a9f0), they never started being used
(because of issues with having multiple layouts), see
https://gitlab.gnome.org/GNOME/mutter/-/issues/906,
https://bugzilla.gnome.org/show_bug.cgi?id=775681.

Let's remove the quotes while we still can.

From https://bugzilla.gnome.org/show_bug.cgi?id=775681#c7:
> Note to self: the values for XKB_FIXED_LAYOUT and XKB_FIXED_VARIANT are
> quoted, meaning that we need to remove the quotes before passing the values
> from udev_device_get_property_value() to xkb_keymap_new_from_names()
> otherwise the compilation of the keymap fails (please don't ask how I found
> out...)

3 years agonetwork: also compare and hash weight of the gateway
Yu Watanabe [Tue, 20 Oct 2020 06:32:36 +0000 (15:32 +0900)] 
network: also compare and hash weight of the gateway

3 years agonetwork: copy multipath route element earlier
Yu Watanabe [Tue, 20 Oct 2020 06:26:51 +0000 (15:26 +0900)] 
network: copy multipath route element earlier

`route_get()` compares input with existing routes, however previously,
the input may did not have information about gateway. So, the
comparison result might be incorrect, and the foregoing set_put() might
return -EEXIST.

3 years agonetwork: make route_configure() return 0 on success
Yu Watanabe [Tue, 20 Oct 2020 05:20:19 +0000 (14:20 +0900)] 
network: make route_configure() return 0 on success

Previously, route_configure() always returns 1 on success, and never
returns 0. It is not necessary to return positive value.

3 years agoMerge pull request #16939 from Rahix/robust-first-boot-machine-id
Yu Watanabe [Tue, 20 Oct 2020 05:01:41 +0000 (14:01 +0900)] 
Merge pull request #16939 from Rahix/robust-first-boot-machine-id

Make ConditionFirstBoot safe against power failures

3 years agoMerge pull request #17352 from msekletar/ens-names-fix
Yu Watanabe [Tue, 20 Oct 2020 04:49:29 +0000 (13:49 +0900)] 
Merge pull request #17352 from msekletar/ens-names-fix

udev/net_id: don't generate slot based names if multiple devices might claim the same slot

3 years agoupdate-done: Do not fail with read-only /etc or /var
Felix Riemann [Mon, 19 Oct 2020 16:54:53 +0000 (18:54 +0200)] 
update-done: Do not fail with read-only /etc or /var

With the switch from log_debug() to log_debug_errno() in commit c413bb28df
systemd-update-done would fail without any error message if /etc
or /var were read-only. This restores the previous behaviour to
silently ignore these directories again.

3 years agoMerge pull request #17390 from keszybz/logind-notifications-and-links
Yu Watanabe [Tue, 20 Oct 2020 04:44:52 +0000 (13:44 +0900)] 
Merge pull request #17390 from keszybz/logind-notifications-and-links

Fix sd_notify() usage in various daemons and update some documentation links

3 years agoudev/net_id: don't generate slot based names if multiple devices might claim the... 17352/head
Michal Sekletár [Mon, 19 Oct 2020 09:10:31 +0000 (11:10 +0200)] 
udev/net_id: don't generate slot based names if multiple devices might claim the same slot

3 years agoMerge pull request #17344 from keszybz/bus-connect-more-logs
Lennart Poettering [Mon, 19 Oct 2020 15:39:37 +0000 (17:39 +0200)] 
Merge pull request #17344 from keszybz/bus-connect-more-logs

Add some debug logs to help diagnose bus connections

3 years agoMerge pull request #17387 from anitazha/systoomd_fixups
Lennart Poettering [Mon, 19 Oct 2020 15:29:22 +0000 (17:29 +0200)] 
Merge pull request #17387 from anitazha/systoomd_fixups

oomd fixups

3 years agoMerge pull request #17389 from poettering/bootspec-clarifications
Lennart Poettering [Mon, 19 Oct 2020 15:17:10 +0000 (17:17 +0200)] 
Merge pull request #17389 from poettering/bootspec-clarifications

bootspec entry character set clarifications

3 years agoman: Document new machine-id and first boot behavior 16939/head
Harald Seiler [Sun, 6 Sep 2020 20:57:59 +0000 (22:57 +0200)] 
man: Document new machine-id and first boot behavior

3 years agounits: order systemd-random-seed.service before first-boot-complete.target
Harald Seiler [Sun, 6 Sep 2020 19:43:57 +0000 (21:43 +0200)] 
units: order systemd-random-seed.service before first-boot-complete.target

Ensure that systemd-random-seed.service has completed before marking
a first boot as completed to guarantee that a saved seed will only be
used after it has been initialized at least once.

3 years agounits: order systemd-firstboot.service before first-boot-complete.target
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)] 
units: order systemd-firstboot.service before first-boot-complete.target

Make sure systemd-firstboot completes before reaching first-boot-complete.target
and thus marking the first boot as completed.  This way, it is
guaranteed that systemd-firstboot has a chance to complete provisioning
at least once, even in cases of the first boot getting aborted early.

3 years agounits: add first-boot-complete.target for first boot ordering
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)] 
units: add first-boot-complete.target for first boot ordering

Add a new target for synchronizing units that wish to run once during
the first boot of the system.  The machine-id will be committed to disk
only after the target has been reached, thus ensuring that all units
ordered before it had a chance to complete.

3 years agomachine-id-setup: sync before committing machine-id
Harald Seiler [Sun, 6 Sep 2020 19:35:33 +0000 (21:35 +0200)] 
machine-id-setup: sync before committing machine-id

sync() before committing a transient machine-id to disk.  This will
ensure that any filesystem changes made by first-boot units will have
been persisted before the first boot is marked as completed.

3 years agocore: keep machine-id transient until first boot completes
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)] 
core: keep machine-id transient until first boot completes

Currently, a loss of power after the machine-id was written but before
all units with ConditionFirstBoot=yes ran would lead to the next boot
finding a valid machine-id, thus not being marked first boot and not
re-running these units.

To make the first boot mechanism more robust, instead of writing
/etc/machine-id very early, fill it with a marker value "uninitialized"
and overmount it with a transiently provisioned machine-id.  Then, after
the first boots completes (when systemd-machine-id-commit.service runs),
write the real machine-id to disk.

This mechanism is of course only invoked on first boot.  If a first boot
is not detected, the machine-id is handled as previously.

Fixes: #4511
3 years agodissect-image: support "uninitialized" machine-id
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)] 
dissect-image: support "uninitialized" machine-id

If the first boot was aborted, /etc/machine-id might read as
"uninitialized" in some cases.  Add a separate case for this
instead of printing a confusing error message.

3 years agorepart: correctly handle "uninitialized" machine-id
Harald Seiler [Thu, 15 Oct 2020 19:25:06 +0000 (21:25 +0200)] 
repart: correctly handle "uninitialized" machine-id

When systemd-repart runs from initramfs, it reads out /etc/machine-id
from the rootfs as a seed for partition UUIDs.  However, the machine-id
could be in an "uninitialized" state from a previous failed first boot.
In this situation the -ENOMEDIUM code-path (no machine-id set) should be
taken.

3 years agonspawn: robustly deal with "uninitialized" machine-id
Harald Seiler [Thu, 15 Oct 2020 19:22:15 +0000 (21:22 +0200)] 
nspawn: robustly deal with "uninitialized" machine-id

When nspawn starts an image, this image could be in any state, including
an aborted first boot.  For this case, it needs to correctly handle the
situation like there was no machine-id at all.

3 years agoid128: add format which treats "uninitialized" like an empty id
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)] 
id128: add format which treats "uninitialized" like an empty id

Add a new ID128_PLAIN_OR_UNINIT format which treats the string
"uninitialized" like the file was empty and return -ENOMEDIUM.  This
format should be used when reading an /etc/machine-id file from an image
that is not currently running.

3 years agodocs: some coding style updates
Lennart Poettering [Mon, 19 Oct 2020 09:39:20 +0000 (11:39 +0200)] 
docs: some coding style updates

Primarily:

1. Mention that we prefer if return parameters carry "ret_" as prefix in
   their name

2. Clarify that debug-level logging is always OK, and irrelevant to when
   deciding whether a function is logging or non-logging.

3 years agotree-wide: update web link to logind description 17390/head
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 18:49:18 +0000 (20:49 +0200)] 
tree-wide: update web link to logind description

https://www.freedesktop.org/wiki/Software/systemd/multiseat/ says that it
is obsoleted by sd-login(3), so it doesn't make much sense to link to the former.

3 years agologind: minor indentation adjustments
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 17:26:58 +0000 (19:26 +0200)] 
logind: minor indentation adjustments

3 years agologind: use notify_start/notify_on_cleanup
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 17:20:05 +0000 (19:20 +0200)] 
logind: use notify_start/notify_on_cleanup

Logging about the pid is dropped, pid1 does that better.

3 years agoshared/daemon-util: fix notify_on_cleanup()
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 17:22:21 +0000 (19:22 +0200)] 
shared/daemon-util: fix notify_on_cleanup()

p itself is never null. Because of this, we would always
call sd_notify() in cleanup, even though the intention was to only
call it if notify_start() was executed.

3 years agotmpfiles: no need to specify a synthetic error code if we don't propagate it 17389/head
Lennart Poettering [Mon, 19 Oct 2020 12:20:26 +0000 (14:20 +0200)] 
tmpfiles: no need to specify a synthetic error code if we don't propagate it

3 years agobootspec: tweak error message
Lennart Poettering [Mon, 19 Oct 2020 12:20:03 +0000 (14:20 +0200)] 
bootspec: tweak error message

Clarify that the name of the entry failed validation, not the entry
itself.

3 years agodoc: document charset to use for bootspec entry names
Lennart Poettering [Mon, 19 Oct 2020 12:19:52 +0000 (14:19 +0200)] 
doc: document charset to use for bootspec entry names

Prompted-by: https://github.com/systemd/systemd/issues/12572#issuecomment-711074702
3 years agocore: treat "uninitialized" in /etc/machine-id as first boot as well
Harald Seiler [Sun, 6 Sep 2020 19:23:35 +0000 (21:23 +0200)] 
core: treat "uninitialized" in /etc/machine-id as first boot as well

When /etc/machine-id contains the string "uninitialized" instead of
a valid machine-id, treat this like the file was missing and mark this
boot as the first (-> units with ConditionFirstBoot=yes will run).

3 years agopreset: don't enable proc-sys-fs-binfmt_misc.mount
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)] 
preset: don't enable proc-sys-fs-binfmt_misc.mount

The proc-sys-fs-binfmt_misc.mount unit should not be enabled by
preset-all because it should only be used as fallback in case
proc-sys-fs-binfmt_misc.automount cannot be used on a system.  In these
cases it should be enabled manually by an administrator.

3 years agoudev/net_id: parse _SUN ACPI index as a signed integer
Michal Sekletár [Mon, 19 Oct 2020 08:56:11 +0000 (10:56 +0200)] 
udev/net_id: parse _SUN ACPI index as a signed integer

Negative value means there is no match between a PCI device and any of
the slots. In the following commit we will extend this and value of 0
will indicate that there is a match between some slot and PCI device,
but that device is a PCI bridge.

3 years agounits: drop ConditionCapability from systemd-oomd.service 17387/head
Anita Zhang [Mon, 19 Oct 2020 09:18:00 +0000 (02:18 -0700)] 
units: drop ConditionCapability from systemd-oomd.service

Another suggestion from #15206

3 years agooomd: simplify if/else error check
Anita Zhang [Mon, 19 Oct 2020 09:17:07 +0000 (02:17 -0700)] 
oomd: simplify if/else error check

3 years agocore: move where we send unit change updates to oomd
Anita Zhang [Mon, 19 Oct 2020 08:44:17 +0000 (01:44 -0700)] 
core: move where we send unit change updates to oomd

Post-merge suggestion from #15206

3 years agoNEWS: fix typo
Anita Zhang [Mon, 19 Oct 2020 08:39:36 +0000 (01:39 -0700)] 
NEWS: fix typo

3 years agocore: reindent and align table in load-fragment-gperf.gperf.m4
Anita Zhang [Mon, 19 Oct 2020 08:30:07 +0000 (01:30 -0700)] 
core: reindent and align table in load-fragment-gperf.gperf.m4

3 years agocore: varlink tweaks
Anita Zhang [Mon, 19 Oct 2020 08:11:06 +0000 (01:11 -0700)] 
core: varlink tweaks

Suggested post-merge in #15206

3 years agoTranslated using Weblate (Belarusian)
Zmicer Turok [Fri, 16 Oct 2020 06:30:21 +0000 (08:30 +0200)] 
Translated using Weblate (Belarusian)

Currently translated at 100.0% (187 of 187 strings)

Co-authored-by: Zmicer Turok <nashtlumach@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/be/
Translation: systemd/master

3 years agoMerge pull request #17369 from poettering/kill-log
Zbigniew Jędrzejewski-Szmek [Mon, 19 Oct 2020 07:31:02 +0000 (09:31 +0200)] 
Merge pull request #17369 from poettering/kill-log

log about processed killed due to "systemctl kill"

3 years agoman: document that for Type=dbus services dropping bus name has consequences
Lennart Poettering [Fri, 16 Oct 2020 16:04:59 +0000 (18:04 +0200)] 
man: document that for Type=dbus services dropping bus name has consequences

Fixes: #17150
3 years agoman: document that ConditionKernelCommandLine= looks at /proc/1/environ in containers
Lennart Poettering [Fri, 16 Oct 2020 16:22:37 +0000 (18:22 +0200)] 
man: document that ConditionKernelCommandLine= looks at /proc/1/environ in containers

Fixes: #16941
3 years agoMerge pull request #17367 from bluca/fix_test_50_ubuntu
Zbigniew Jędrzejewski-Szmek [Mon, 19 Oct 2020 07:17:28 +0000 (09:17 +0200)] 
Merge pull request #17367 from bluca/fix_test_50_ubuntu

test: fix TEST-50-DISSECT build on Ubuntu CI

3 years agohwdb: Add accel orientation for AsusTek TP300LAB
Pedro Ruiz [Mon, 19 Oct 2020 00:00:27 +0000 (02:00 +0200)] 
hwdb: Add accel orientation for AsusTek TP300LAB

3 years agopo: update Polish translation
Piotr Drąg [Sun, 18 Oct 2020 11:10:47 +0000 (13:10 +0200)] 
po: update Polish translation

3 years agotest: account for non-x86-64 archs in TEST-50-DISSECT 17367/head
Luca Boccassi [Sun, 18 Oct 2020 14:41:34 +0000 (15:41 +0100)] 
test: account for non-x86-64 archs in TEST-50-DISSECT

3 years agotest: increase size of verity partition in TEST-50-DISSECT GPT image
Luca Boccassi [Sat, 17 Oct 2020 21:10:42 +0000 (22:10 +0100)] 
test: increase size of verity partition in TEST-50-DISSECT GPT image

On Ubuntu it seems there's some padding added

3 years agotree-wide: update web link to logind description
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 18:49:18 +0000 (20:49 +0200)] 
tree-wide: update web link to logind description

https://www.freedesktop.org/wiki/Software/systemd/multiseat/ says that it
is obsoleted by sd-login(3), so it doesn't make much sense to link to the former.