1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
Commit Graph

65693 Commits

Author SHA1 Message Date
Frantisek Sumsal
5000cea8d2 tree-wide: explicitly ignore return value in a couple more places
Resolves:
  - CID#1490777
  - CID#1498366
  - CID#1508639
  - CID#1509084
  - CID#1509086
  - CID#1509087
2023-07-02 12:22:45 +02:00
Frantisek Sumsal
85773a7fd0 unit: drop an unused assignment
Resolves: CID#1509244
2023-07-02 12:22:45 +02:00
Frantisek Sumsal
9cf7f7a82f virt: drop an unused assignment
As `v` gets overwritten by the following detect_vm_cpuid() call.

Resolves: CID#1509247
2023-07-02 12:22:41 +02:00
Frantisek Sumsal
e3747380fb test: drop an unused assignment
Unused since 788c2d9523.
Resolves: CID#1509248
2023-07-02 11:04:38 +02:00
Lennart Poettering
95dafd30da battery-check: rework unit
Let's rename the unit to systemd-battery-check.service. We usually want
to name our own unit files like our tools they wrap, in particular if
they are entirely defined by us (i.e. not just wrappers of foreign
concepts)

While we are at it, also hook this in from initrd.target, and order it
against initrd-root-device.target so that it runs before the root device
is possibly written to (i.e. mounted or fsck'ed).

This is heavily inspired by @aafeijoo-suse's PR #28208, but quite
different ;-)
2023-07-01 03:19:16 +08:00
Frantisek Sumsal
a5e478b24c test: fix test_vxlan with the latest iproute2
Some options were renamed and some options with default values are not
shown unless -d(etails) is repeated.

See: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=1215e9d3862387353d8672296cb4c6c16e8cbb72
2023-06-30 17:33:40 +00:00
Lennart Poettering
dbf7509775 README: strenghten wording regarding static libs
static versions of libsystems.so are not really supportable, and
encourages mix&match which we cannot really support. Make the wording
about this stronger in the README, since people apparently don'd read to
the last paragraph.
2023-06-30 18:22:42 +02:00
Daan De Meyer
506c1bb594 stat-util: Make sure we trigger automounts when looking for ESP/XBOOTLDR
Fixes #25417
2023-06-30 12:25:07 +01:00
Frantisek Sumsal
06afda6b38 core: reorder systemd arguments on reexec
When reexecuting system let's put our arguments carrying deserialization
info first followed by any existing arguments to make sure they get
parsed in case we get weird stuff from the kernel cmdline (like --).

See: https://github.com/systemd/systemd/issues/28184
2023-06-29 22:20:41 +01:00
Ivan Vecera
88d2bda812 udev-builtin-net_id: align VF representor names with VF names
Certain cards support to set their eswitch to switchdev mode. In this
mode for each created VF there is also created so called VF representor.
This representor is helper network interface used for configuration of
mentioned eswitch and belongs to an appropriate PF.

VF representors are identified by the specific value of phys_port_name
attribute and the value has format "pfMvfN" where M is PF function
number and N is VF number inside this PF.

As the VF representor interfaces belong to PF PCI device the naming
scheme used for them is the same like for other PCI devices. In this
case name of PF interface is used and phys_port_name suffix is appended.

E.g.
 PF=enp65s0f0np0 # phys_port_name for PF interface is 'p0'
 VF=enp65s0f0np0v0 # v0 is appended for VF0 in case of NAMING_SR_IOV_V
REP=enp65s0f0np0pf0vf0 # phys_port_name for VF0 representor is 'pf0vf0'

First as the phys_port_name for representors is long (6+ chars) then the
generated name does not fit into IFNAMSIZ so this name is used only as
alternate interface name and for the primary one is used generic one
like eth<N>. Second 'f0' and 'pf0' in REP name is redundant.

This patch fixes this issue by introducing another naming scheme for VF
representors and appending 'rN' suffix to PF interface name for them.
N is VF number so the name used for representor interface is similar to
VF interface and differs only by the suffix.

For the example above we get:
 PF=enp65s0f0np0
 VF=enp65s0f0np0v0
REP=enp65s0f0np0r0

This eases for userspace to determine which representor interface
represents particular VF.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2023-06-29 22:18:05 +01:00
Luca Boccassi
1d2b93ff89
Merge pull request #28138 from pkern/oci-dhcpv6
sd-dhcp6-lease: Ignore invalid bytes at the end of the packet
2023-06-29 22:17:02 +01:00
Luca Boccassi
3a6a93220a
Merge pull request #28191 from yuwata/network-ipv6-privacy-extensions
network: introduce global setting for IPv6 privacy extensions
2023-06-29 22:16:10 +01:00
Lennart Poettering
f56f9c6b3e mount-util: tweak flags decoding in mount_verbose_full()
Fine-tune the decoding of mount options in mount_verbose_full() to
provide more helpful log output:

1. decode changing of propagation changes
2. discern changing of superblock flags/mount option string from mount
   flags
3. don't check secondary fields when deciding which mount op is
   executed, only the flags decide that.
2023-06-29 22:15:16 +01:00
Lennart Poettering
eb99c45914 man: add brief smbios-type-11 man page 2023-06-29 22:13:11 +01:00
Lennart Poettering
452cfd983f man: document vmm.notify_socket credential in systemd(1) man page
Let's move the long explanation to the man page of the component that
interprets the credential, and keep only a brief summary in
systemd.system-credentials(7).
2023-06-29 22:11:41 +01:00
Yu Watanabe
894f441764 test: add test for trailing invalid byte at the end 2023-06-30 01:21:42 +09:00
Philipp Kern
81b7335912 sd-dhcp6-lease: ignore invalid byte(s) at the end of the packet
Oracle Cloud sends malformed DHCPv6 replies that have an invalid
byte at the end, which cannot be parsed as an option code.

networkd currently can cope with the invalid option (it is ignored),
but the whole packet is ignored altogether because of the additional
null at the end.

It's better to be liberal in what we accept and actually assign an
address, given that the reply contains a valid IA_NA.

Fixes #28183.
2023-06-30 01:21:25 +09:00
Yu Watanabe
856a247e19 test-network: add test for global IPv6PrivacyExtensions= setting 2023-06-29 21:58:23 +09:00
Yu Watanabe
932ef6ecd4 network: add global setting for IPv6PrivacyExtensions=
Closes #28186.
2023-06-29 21:40:47 +09:00
Yu Watanabe
7cab78503a network: introduce IPV6_PRIVACY_EXTENSIONS_KERNEL enum value
No functional change. Preparation for using the _INVALID value in later
commit.
2023-06-29 21:40:47 +09:00
Joerg Behrmann
49bf8bd57a NEWS: various fixes 2023-06-29 21:37:07 +09:00
Daan De Meyer
2fe24cccde mkosi: Enable Incremental= mode by default
Since mkosi is now smart enough to drop the caches when the list of
packages changes, let's enable Incremental= mode by default to ensure
a good experience for anyone new to hacking on systemd with mkosi.
2023-06-29 13:11:39 +01:00
Frantisek Sumsal
69eeb6f15e test: use correct path for systemd-battery-check
Follow-up to #28185.
2023-06-29 13:06:42 +01:00
Lennart Poettering
1fa5f1c52b update TODO 2023-06-29 13:14:13 +02:00
Yuxiang Zhu
b67e8a4e3e
network: Add IgnoreDdontFragment= option for Fragmentation control (#28131)
From `ip-link(8)`:
> [no]ignore-df - enables/disables IPv4 DF
                      suppression on this tunnel.  Normally datagrams
                      that exceed the MTU will be fragmented; the
                      presence of the DF flag inhibits this, resulting
                      instead in an ICMP Unreachable (Fragmentation
                      Required) message.  Enabling this attribute causes
                      the DF flag to be ignored.

If this option is enabled for a GRE/GRETAP tunnel, the `DF` flag in the outer IP header
will not inherit the inner IP header's `DF` flag.

This is useful to transfer packets that exceed the MTU of the underlay
network.
2023-06-29 12:11:52 +02:00
Alexander Krabler
9d5c20657a man: Extend journalctl color information
Add sentence about colored warning messages in journalctl.
2023-06-29 10:10:09 +02:00
Yu Watanabe
be994c2640 battery-check: several follow-ups
Follow-ups for e3d4148d50.

- add reference to initrd-battery-check.service in man page, and move
  its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
  indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),

etc, etc...
2023-06-29 15:41:00 +09:00
Yu Watanabe
d625f717db meson: first try dependency(), then fallback to find_library()
This also drops the fallback for libacl, libcap, libcrypt, and libgcrypt,
as recent Ubuntu (at least, 20.04 LTS and newer) and Debian (at least, buster
and newer) have relevant .pc files.

Fixes #28161.
2023-06-29 15:38:53 +09:00
Lennart Poettering
08423f6d30 NEWS: various fixes/additions 2023-06-28 22:40:50 +02:00
Lennart Poettering
57859ed19f
Merge pull request #28168 from poettering/xdg-state-home
properly support XDG_STATE_HOME
2023-06-28 22:30:23 +02:00
Lennart Poettering
b50aadaff2 tmpfiles: teach tmpfiles the new XDG_STATE_HOME variable too 2023-06-28 22:13:13 +02:00
Lennart Poettering
cc8fdd5d30 man: properly close XML tags 2023-06-28 22:12:03 +02:00
Lennart Poettering
fa1d34825a man: rebreak lines in file-hierarchy(7) a bit
(Does not change a single word, just rebreaks a bunch of paragraphs
matching our current line breaking rules)
2023-06-28 22:11:06 +02:00
Franklin Yu
b4d6bc63e6 man: mention the newly-added XDG_STATE_HOME
The description is copied from config-home.

Taken from: #27795
2023-06-28 22:10:18 +02:00
Lennart Poettering
580a007bb6 test: add test for new XDG_STATE_HOME handling 2023-06-28 22:09:19 +02:00
Lennart Poettering
f5bb36dcfe execute: don't bother with chowning StateDirectory= and friends in user mode 2023-06-28 22:08:35 +02:00
Lennart Poettering
b93d24e07d execute: shorten code by making use of laccess() return code properly 2023-06-28 22:07:38 +02:00
Lennart Poettering
db58f5de3d execute: shorten some code by using RET_NERRNO() 2023-06-28 22:06:49 +02:00
Lennart Poettering
59dd2bbbb6 execute: associate logs from setup_exec_directory() with the unit name 2023-06-28 22:06:07 +02:00
Lennart Poettering
f9c91932b4 execute: add support for XDG_STATE_HOME for placing service state data in --user mode
This adds support for the new XDG_STATE_HOME env var that was added to
the xdg basedir spec. Previously, because the basedir spec didn't know
the concept we'd alias the backing dir for StateDirectory= to the one
for ConfigurationDirectory= when runnin in --user mode. With this change
we'll make separate. This brings us various benefits, such as proper
"systemctl clean" support, where we can clear service state separately
from service configuration, now in user mode too.

This does not come without complications: retaining compatibility with
older setups is difficult, because we cannot possibly identitfy which
files in existing populated config dirs are actually "state" and which
one are true" configuration.

Hence let's deal with this pragmatically: if we detect that a service
that has both dirs configured only has the configuration dir existing,
then symlink the state dir to the configuration dir to retain
compatibility.

This is not great, but it's the only somewhat reasonable way out I can
see.

Fixes: #25739
2023-06-28 22:01:55 +02:00
Lennart Poettering
d5602c1632 execute: when recursively chowning StateDirectory= when spawning services, follow initial symlink
It should be OK to allow one level of symlink for the various types of
directories like StateDirectory=, LogsDirectory= and such.
2023-06-28 22:01:07 +02:00
Lennart Poettering
d9e5137185 execute: remove redundant assignment 2023-06-28 22:00:08 +02:00
Lennart Poettering
170d978b2f execude: include RuntimeScope field in ExecParameters
Let's decouple execute.c a bit from the Manager object, let's pass the
runtime scope (i.e. the enum that discern invocation for user or system
context) as part of ExecParameters. This makes the scope available in
various functions without having to pass the Manager object in.
2023-06-28 21:59:02 +02:00
Lennart Poettering
17f06e97e4 path tool: add some basic ansi highlighing 2023-06-28 21:58:17 +02:00
Lennart Poettering
4bbfc9eac5 sd-path: bring spacing in sd-path.h and systemd-path tool in sync 2023-06-28 21:57:17 +02:00
Lennart Poettering
9a653235d1 sd-path: add support for XDG_STATE_HOME 2023-06-28 21:55:33 +02:00
Luca Boccassi
1c53c3bab1
Merge pull request #28178 from mrc0mmand/nss-tests
test: add a couple of tests for nss-myhostname & nss-mymachines
2023-06-28 19:41:11 +01:00
Luca Boccassi
f18886fe17
Merge pull request #28164 from poettering/replace-env-var-fixes
pid1: warn about unset+invalid env var names when resolving ExecStart= expressions and similar
2023-06-28 19:40:51 +01:00
Lennart Poettering
d1797c42cc update TODO 2023-06-28 19:22:57 +02:00
Lennart Poettering
4d8eca03e5
Merge pull request #28146 from keszybz/ansi-seq-skip
Pass ANSI sequences through when ellipsizing output
2023-06-28 19:18:27 +02:00