1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-25 23:21:33 +03:00
Commit Graph

49903 Commits

Author SHA1 Message Date
Yu Watanabe
44e1f7e3dc network: minor style fixes 2021-03-03 16:12:33 +09:00
Yu Watanabe
d23a66f274 network: use unlink_and_freep() cleanup functions
This also makes state files not removed on failure.
2021-03-03 16:11:45 +09:00
Yu Watanabe
3b5a4fc685 network: move state file related functions to networkd-state-file.[ch] 2021-03-03 16:07:45 +09:00
Lennart Poettering
725ad3b062 fstab-generator: add new root=tmpfs option
It's useful to be able to combine a regular /usr/ file system with a
tmpfs as root, for an OS that boots up in volatile mode on every single
boot.  Let's add explicit support for this via root=tmpfs.

Note the relationship to the existing systemd.volatile= option:

1. The kernel command line "root=/dev/… systemd.volatile=yes" will mount
   the specified root fs, and then hide everything at the top by
   overmounting it with a tmpfs, except for the /usr subtree.

2. The kernel command line "root=tmpfs mount.usr=/dev/…" otoh will mount
   a toot fs at the top (just like the case above), but will then mount
   the top-level dir of the fs specified in mount.usr= directly below
   it.

Or to say this differently: in the first case /usr/ from the physical
storage fs is going to become /usr/ of the hierarchy ultimately booted,
while in the second case / from the physical storage fs is going to
become /usr of the hierarchy booted.

Philosophically I figure systemd.volatile= is more an option for
"one-off" boots, while root=tmpfs is something to have as default mode
of operation for suitable images.

This is currently hard to test reasonably, since Dracut refuses to
accept root=tmpfs. This needs to be addressed separately though.
2021-03-03 12:16:32 +09:00
Lennart Poettering
ab05bee1dd time-util: simplify overflow check
And don't rely on 2s complement.
2021-03-03 12:16:21 +09:00
Luca Boccassi
294f1b40ab
Merge pull request #18834 from poettering/path-extract
Beef up path_extract_filename() a bit, and introduce path_extract_directory()
2021-03-02 19:22:53 +00:00
Lennart Poettering
312dff1760 util: add helpers for generating colored check mark glyphs from bools 2021-03-03 03:08:31 +09:00
Lennart Poettering
62a88d7a3e tmpfile: port tempfn_*() to path_extract_*() 2021-03-02 15:07:52 +01:00
Lennart Poettering
7fc607637f machinectl: make sure of path_extract_filename() returning O_DIRECTORY 2021-03-02 15:07:48 +01:00
Lennart Poettering
ee277c6bc7 path-util: return O_DIRECTORY from path_extract_filename() when path ends in slash
Let's fine-tune the path_extract_filename() interface: on succes return
O_DIRECTORY as indicator that the input path was slash-suffixed, and
regular 0 otherwise. This is useful since in many cases it is useful to
filter out paths that must refer to dirs early on.

I opted for O_DIRECTORY instead of the following other ideas:

1. return -EISDIR: I think the function should return an extracted
   filename even when referring to an obvious dir, so this is not an
   option.

2. S_ISDIR, this was a strong contender, but I think O_DIRECTORY is a
   tiny bit nicer since quite likely we will go on and open the thing,
   maybe with openat(), and hence it's quite nice to be able to OR in
   the return value into the flags argument of openat().

3. A new enum defined with two values "dont-know" and
   "definitely-directory". But I figured this was unnecessary, given we
   have other options too, that reuse existing definitions for very
   similar purposes.
2021-03-02 15:07:44 +01:00
Lennart Poettering
8dcb891c19 path-util: add path_extract_directory(), to match path_extract_filename()
These two together are a lot like dirname() + basename() but have the
benefit that they return clear errors when one passes a special case
path to them where the extraction doesn't make sense, i.e. "", "/",
"foo", "foo/" and so on.

Sooner or later we should probably port all our uses of
dirname()/basename() over to this, to catch these special cases more
safely.
2021-03-02 15:07:11 +01:00
Luca Boccassi
7e40042b55 man: document usage of SD_BUS_CREDS_AUGMENT 2021-03-02 12:18:53 +01:00
Lennart Poettering
0498d8d74a
Merge pull request #18841 from keszybz/a-bunch-of-man-page-updates
Two minor small man page updates
2021-03-02 11:03:44 +01:00
Tom Shield
e595edf1a3
udev: add i2c to 60-persistent-input.rules for by-path (#18808)
Add the i2c subsystem to those that create by-path links.
i2c devices may not have IDs so we can't rely on the by-id links
but they (or some of them) should at least have a path that we can use.
2021-03-02 19:56:06 +10:00
Martin Wilck
d8ce385fe3 sd-device: don't use BPF filtering for kernel monitors
BPF filtering accesses fields in the netlink header that are
only filled in by libudev, never by the kernel. Therefore adding
BPF filters for kernel monitors is pointless. Even false filtering
of kernel events might be possible; at least it's hard to prove that
it can't occur.
2021-03-02 18:38:36 +09:00
Yu Watanabe
7a7d2f16c2 tree-wide: fix typo 2021-03-02 09:48:20 +01:00
Zbigniew Jędrzejewski-Szmek
33360f35a1 man: reword sentence about lone coredumps
Let's make it clear that they are not as useful as the full thing.
2021-03-02 09:37:49 +01:00
Zbigniew Jędrzejewski-Szmek
c53e8b9de6 man: add note about "SIG" prefix 2021-03-02 09:35:22 +01:00
Yu Watanabe
dbc3cf009a
Merge pull request #18832 from keszybz/resolved-stop-sources
Always stop sd-event sources in resolved when unreffing them
2021-03-02 14:15:18 +09:00
Lennart Poettering
62e10065d0 fs-util: use ERRNO_IS_NOT_SUPPORTED() at two more places where we can't be sure of the backing implementation 2021-03-02 13:16:22 +09:00
Lennart Poettering
674b04ff1b btrfs-util: add helper that abstracts "might be btrfs subvol?" check
Let#s not hardcode inode nr 256 everywhere, but abstract this check
slightly.
2021-03-02 13:11:37 +09:00
Lennart Poettering
35f4b6d8ba test-signal-util: add test for signal_is_blocked() 2021-03-02 12:41:39 +09:00
Zbigniew Jędrzejewski-Szmek
9793530228 resolved: disable event sources before unreffing them
We generally operate on the assumption that a source is "gone" as soon
as we unref it. This is generally true because we have the only reference.
But if something else holds the reference, our unref doesn't really stop
the source and it could fire again.

In particular, on_query_timeout() is called with DnsQuery* as userdata, and
it calls dns_query_stop() which invalidates that pointer. If it was ever
called again, we'd be accessing already-freed memory.

I don't see what would hold the reference. sd-event takes a temporary reference,
but on the sd_event object, not on the individual sources. And our sources
are non-floating, so there is no reference from the sd_event object to the
sources.

For #18427.
2021-03-01 23:12:51 +01:00
Zbigniew Jędrzejewski-Szmek
f2ec080ef2 resolved: unref event object after the sources
It shouldn't matter because of all the refcounting, but it looks unclean.
2021-03-01 23:12:51 +01:00
Luca Boccassi
ebf7472569
Merge pull request #18831 from keszybz/a-bunch-of-man-page-updates
A bunch of man page updates
2021-03-01 22:11:44 +00:00
Zbigniew Jędrzejewski-Szmek
1447d87a47 man: document \u and \U, say that utf-8 is allowed 2021-03-01 20:57:36 +01:00
Zbigniew Jędrzejewski-Szmek
07dc08c269 man: move two sysv-specific variables to docs
https://github.com/systemd/systemd/pull/18827#discussion_r584807684
2021-03-01 20:57:36 +01:00
Zbigniew Jędrzejewski-Szmek
40019c32d7 man: clarify what is inside/outside the container in coredump info 2021-03-01 20:57:36 +01:00
Zbigniew Jędrzejewski-Szmek
a1174b2260 man: update link to systemd-coredump-python
This got moved under the systemd umbrella a long time ago.
Github redirects from the old path, so the link worked, but it's
nicer to use the real location.
2021-03-01 20:53:57 +01:00
Zbigniew Jędrzejewski-Szmek
cd18afec16
Merge pull request #18827 from keszybz/a-bunch-of-man-page-updates
A bunch of man page updates
2021-03-01 15:14:40 +01:00
Zbigniew Jędrzejewski-Szmek
1c58006272
Merge pull request #18828 from keszybz/three-fixes
Three small fixes
2021-03-01 15:13:51 +01:00
Zbigniew Jędrzejewski-Szmek
dac05c0808 man: say that machine-info doesn't have to exist
Esp. CHASSIS is only useful as an override. Make that clear in the description.

Fixes #3496.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
aa2e348d7b man: tweak descriptions of how tmpfiles should be started
We shouldn't imply that invocation without any parameters is OK.
Also, mention that the service can be restarted.

Fixes #8684.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
e531091ba0 man: describe quoting and specifiers in Environment=
Fixes #10604.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
4d729e3796 man: move quoting description to systemd.syntax
We use very similar quoting rules in many places. Let's move this
lengthy text out of systemd.service page.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
36f57e02d7 man: explain how to invoke tmpfiles for debugging
Fixes #11914.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
5929b6b522 man: mention that != matches nonexistent keys too
Fixes #15984.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
9479d92ebc man: reorder match types in udev rules
The plural version should always be adjacent to the singular one.
And the plural should not be explained before the singular one…
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
32f82cccea man: add footnote explaining why "localhost" query is sent out to the network
I tried to make the explanation brief, but this isn't so easy. It seems better
to push this out to a footnote instead of the main text.

Fixes #16584.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
9273d8e6c9 man: move motivational explanation to footnote 2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
fc070a2574 man: describe the syntax for {Job,}{Running,}TimeoutSec=
Fixes #16644.

Also break the text into paragraphs to make it a bit easier to read.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
09d9081447 man: move description of $SYSTEMD_SYSVINIT_PATH to the only user 2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
b4c87f7d38 man: reuse common-variables in systemd(1)
This requires a bit of gimnastics, but I think it's still better than
status quo ante, and better than duplicating the text.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
969524fae2 basic/log: align tables 2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
5bd27a17ca man: describe various logging configuration variables
Fixes #17484.

This patch affects systemctl(1), as well as all man pages that include
all of common-variables.xml, i.e. most of our command line tools.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
4ef3ca3447 man: rename less-variables→common-variables
Some are not about less, e.g. $SYSTEMD_URLIFY.
2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
3a559f22c3 coredump: indent comment 2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
9d58abfa25 man: describe coredump fields
We save a wealth of information about the process, but this might not be
immediately obvious.
2021-03-01 13:40:52 +01:00
Luca Boccassi
32e868f058 udev rules: add rule to create /dev/ptp_hyperv
As for the KVM case, necessary for network cards with
PTP devices when running a guest on HyperV
2021-03-01 11:51:08 +01:00
Zbigniew Jędrzejewski-Szmek
bfc2274db7 test-socket-util: fix test for address parsing w/o IPv6 support
sockaddr_pretty() is the function that is ultimately called to print
the address, and afaics, it'll always use 0.0.0.0 if family==AF_INET.
So the test must have always been broken on systems with IPv6 support.

Fixes a failure in semaphore debian autopkgtest ci:
"65535" → ✓ 0 → "0.0.0.0:65535" (expect 0 / "[::]:65535") 15:15
Assertion 'streq(out, expected ?: in)' failed at src/test/test-socket-netlink.c:32, function test_socket_address_parse_one(). Aborting. 15:15
2021-03-01 11:27:03 +01:00