1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00
Commit Graph

77305 Commits

Author SHA1 Message Date
Yu Watanabe
32d77f5df8 sd-json: use strv_env_get_merged() 2024-10-31 11:02:35 +09:00
Yu Watanabe
7633001cdd env-util: introduce strv_env_get_merged() 2024-10-31 11:02:35 +09:00
Yu Watanabe
e4d477efc6 env-util: replace 'char **' with 'char**' 2024-10-31 11:02:35 +09:00
Yu Watanabe
b1e11a252d TEST-13-NSPAWN: add test cases for listing multiple machines 2024-10-31 11:02:23 +09:00
Yu Watanabe
f0fdefc045 TEST-13-NSPAWN: trivially kill all processes in the container on termination
Follow-up for 841988f80d.

No functional change, as $PID is 0 when the trap is inserted.
2024-10-31 10:59:14 +09:00
Yu Watanabe
1856ab4503 TEST-13-NSPAWN: check returned machine list 2024-10-31 10:59:14 +09:00
Yu Watanabe
e79b58c825 TEST-13-NSPAWN: fix race between container exit and varlink call
Follow-up for 3cb72c7862.

The test container exits shortly, hence when varlinkctl is called, the
container may be already terminated. Let's make the container live
infinitely.
Also, this makes the os-release files removed after the container is started.
2024-10-31 10:59:14 +09:00
Yu Watanabe
20e1237ce1 machined: ACQUIRE_METADATA_NO is zero
Follow-ups for a94fbcaa35 and
9de215219c.
2024-10-31 10:59:14 +09:00
Yu Watanabe
f283816acb machine: use sd_json_variant_append_arraybo() and JSON_BUILD_PAIR_VARIANT_NON_NULL()
Follow-up for 45755275e5.
2024-10-31 10:59:14 +09:00
Yu Watanabe
5310cf3354 NEWS: fix typo 2024-10-31 10:58:25 +09:00
Yu Watanabe
ba63cc7448 sd-varlink: update comment 2024-10-31 09:52:15 +09:00
Lennart Poettering
d2ebf5cc1d sd-varlink: change sd_varlink_error() to always return an error
Let's make sure that sd_varlink_error() always returns an error code, so
that we can use it in a style "return sd_varlink_error(…);" everywhere,
which has two effects: return a good error reply to clients, and exit
the current stack frame with a failure code.

Interestingly sd_varlink_error_invalid_parameter() already worked like
this in some cases, but sd_varlink_error() itself didn't.

This is an alternative to the error handling tweak proposed in #34882,
but I think is a lot more generically useful, since it establishes a
pattern.

I checked our codebase, and this change should generally be OK without
breaking callsites, since the current callers (with exception of the
machined case from #34882) called sd_varlink_error() in the outermost
varlink method call dispatch stack frame, where this behaviour change
does not alter anything.

This is similar btw, how sd_bus_error_setf() and friends always return
error codes too, synthesized from its parameters.
2024-10-31 09:50:50 +09:00
Lennart Poettering
76a3af0630 sd-varlink: add helper VARLINK_STATE_WANTS_REPLY()
Let's add a helper that detects whether we still need to reply to a
state. This should make the logic easier to follow.
2024-10-31 09:50:50 +09:00
Lennart Poettering
aa5e67ae6f sd-varlink: don't show error code we already decoded as part of the log message 2024-10-31 09:50:50 +09:00
Lennart Poettering
0118074f85 sd-varlink: if we reply to errors without passing to callback, go through regular error path
If replying with an error fails, we should failt the whole connection,
and not leave the connection in a weird state.
2024-10-31 09:50:50 +09:00
Yu Watanabe
885691d454
firstboot: several cleanups (#34958)
Split out of #33226
2024-10-31 08:05:39 +09:00
Lennart Poettering
2ff3adeb29 sd-json: don't use C99 bool in public headers
All our public headers strive to C90 compatibility with a few
extensions, and thus avoided stdbool.h and bool.

The sd_json_format_enabled() helper seems like a poor place to start
requiring stdbool.h now.

Also drop __extension__ since we are not using it anywhere else in very
similar inline functions.

(And we probably should drop any _sd_const declarations on inline
functions. Given that the compiler has the function implementation
around always, because it's in the header there's really no reason to
specify this manually, the compiler can trivially figure this out on its
own. But that's for another time.)
2024-10-31 07:59:41 +09:00
Yu Watanabe
cb15aa7b37
network: support reconfiguring netdev (#34909)
Closes #9627
Closes #27177.
Closes #34907.
Replaces #22557.
2024-10-31 07:01:46 +09:00
Yu Watanabe
2e612ce1b7 man: update documentation for 'networkctl reload' 2024-10-31 05:33:10 +09:00
Yu Watanabe
0de5562413 test-network: test for reload of .netdev file of stacked netdev
For issue #9627, #27177, and #34907.
2024-10-31 05:30:40 +09:00
Yu Watanabe
b3ae4e8622 network/netdev: replace old NetDev object with newer one on reload
Then, when a .netdev file of a stacked netdev is modified, the netdev
can be reconfigured with the updated setting by something like the
following way:
```
ip link del vlan99
networkctl reload
```

Note, removing the vlan interface in the above example may not be necessary,
e.g. when only VLAN flags, egress mapping, or ingress mapping are updated.
But, it is necessary when VLAN ID is updated.

Closes #9627.
Closes #27177.
Closes #34907.
Replaces #22557.
2024-10-31 05:30:40 +09:00
Yu Watanabe
890bd7225a network/netdev: reconfigure netdev if possible
Some netdev configs can be modified after the interface is created.
Let's allow to reconfigure existing interfaces.
2024-10-31 05:30:40 +09:00
Yu Watanabe
933d88f756 network/netdev: move calls of netdev_attach() and netdev_request_to_create() to netdev_load()
No functional change, preparation for later commits.
2024-10-31 05:30:40 +09:00
Daan De Meyer
954dd5242b mkosi: Ensure we build with debuginfo 2024-10-30 19:48:18 +00:00
Michal Sekletar
d9fd1d3707 coredump: allow only empty messages after first "sentinel" 2024-10-30 19:45:31 +00:00
Michael Ferrari
178d80d719
firstboot: generalize prompt_loop more
Allows unifying the custom logic for the hostname and root shell. Root
password prompting remains separate as it's logic is substantially
different to the other prompts.
2024-10-30 20:13:56 +01:00
Michael Ferrari
26f9e08231
firstboot: use consistent wording for prompts 2024-10-30 20:13:53 +01:00
Michael Ferrari
f4da5ed538
firstboot: clean up welcome message 2024-10-30 20:13:47 +01:00
Michael Ferrari
d689dd88fd
firstboot: order non-interactive options last 2024-10-30 20:13:41 +01:00
Yu Watanabe
f7d5d7c593
network/tunnel: reuse existing 6rd sit tunnel (#34938)
split-out of #34909.
2024-10-31 04:04:55 +09:00
Yu Watanabe
5251cb8254
network/netdev: do not try to update several parameters if the interface already exists (#34937)
split-out of #34909.
2024-10-31 04:04:33 +09:00
Yu Watanabe
e725a91ab7
network: several cleanups for reloading .network files (#34933)
split-out of #34909.
2024-10-31 04:04:10 +09:00
Yu Watanabe
6ab12224c9
network: process queued remove requests on stop (#34871)
Fixes a regression caused by 85a6f300c1
and its later commits.
Fixes #34837.
2024-10-31 04:03:11 +09:00
Yu Watanabe
d1fd45d145
mkosi: Update packaging specs to latest (#34951) 2024-10-31 02:31:03 +09:00
Yu Watanabe
59528e55af test-network: add test case for reuse of existing 6rd SIT tunnel 2024-10-31 02:09:31 +09:00
Lennart Poettering
f2ef9f7760
Fix display of qrcodes by bsod and other related cleanups (#34914) 2024-10-30 17:44:40 +01:00
Daan De Meyer
d9f4dad986 ask-password: Allow configuring the keyring timeout via an environment variable
In mkosi, we want an easy way to set the keyring timeout for every
tool we invoke that might use systemd-ask-password to query for a
password which is then stored in the kernel keyring. Let's make this
possible via a new $SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC environment
variable.

Using an environment variable means we don't have to modify every separate
tool to add a CLI option allowing to specify the timeout. In mkosi specifically,
we'll set up a new session keyring for the mkosi process linked to the user keyring
so that any pins in the user keyring are used if available, and otherwise we'll query
for and store password in mkosi's session keyring with a zero timeout so that they stay
in the keyring until the mkosi process exits at which point they're removed from the
keyring.
2024-10-30 17:43:53 +01:00
Luca Boccassi
14b0fcdf6d logind: add BlockWeakInhibited property
Fixes https://github.com/systemd/systemd/issues/34091
Follow-up for 804874d26a
2024-10-30 17:41:52 +01:00
Łukasz Stelmach
8144537a81 core: make mount(8) and swapon(8) inherit SMACK label from systemd
By default mount(8), umount(8), swapon(8) and swapoff(8) should run with
with the SMACK label inherited from systemd rather than the default one
meant for services.

Fixes: aa5ae9711e
Follow-up-for: 20bbf5ee4c
2024-10-30 17:41:23 +01:00
Yu Watanabe
ceae9f9a38 network/ipvlan: do not try to update MAC address 2024-10-31 01:06:25 +09:00
Yu Watanabe
6804bbdaf1 network/macsec: IFLA_MACSEC_PORT attribute cannot be changed
Also, though currently not supported by networkd,
  IFLA_MACSEC_CIPHER_SUITE, IFLA_MACSEC_ICV_LEN, IFLA_MACSEC_SCI
cannot be updated.
2024-10-31 01:06:25 +09:00
Yu Watanabe
49639363ab network/vxlan: do not try to update several parameters
Currently, netdev->ifindex is always zero when this function is called.
So, this does not change any behavior. Preparation for later commits.
2024-10-31 01:06:25 +09:00
Yu Watanabe
17c5337f7b network/netdev: introduce netdev_can_set_mac/mtu() helper functions
Several netdevs cannot set IFLA_ADDRESS or IFLA_MTU attribute on update.
Currently, the vtable field is unused, as we do not support updating
existing netdevs. Preparation for later commits.
2024-10-31 01:06:25 +09:00
Yu Watanabe
00c0a94498 network: use newly loaded Network object if a referenced NetDev object is updated
Even if .network file is not updated, referenced NetDev object may be
different. In that case, let's use the newly loaded Network object.
2024-10-31 00:58:47 +09:00
Yu Watanabe
173c9f639b network: drop no-op cleanup
- network_load() is always called with an empty OrderedHashmap, renamed the output
  parameter to 'ret'.
- When netdev_load() is called on startup, the hashmap is NULL. When it is
  called on reloading, the hashmap is not cleaned up.

Hence, then these cleanups are always no-op. Let's drop them.
2024-10-31 00:58:42 +09:00
Yu Watanabe
d16083557b network/netdev: update state file when NetDev object assignment is changed 2024-10-31 00:52:28 +09:00
Yu Watanabe
525c53a95a network: swap asterisk and space 2024-10-31 00:51:50 +09:00
Yu Watanabe
f85213e8f6 github: drop workaround and use distro mold
Now, ubuntu-24.04 has mold-2.30.0+dfsg-1build1 .
See https://packages.ubuntu.com/noble/mold .
2024-10-31 00:34:48 +09:00
Yu Watanabe
58a011ba48 test-network: add test for DHCPv4 address removal on stop
For issue #34837.
2024-10-31 00:34:48 +09:00
Yu Watanabe
db68e99046 network: process queued remove requests before networkd is stopped
This makes networkd process all queued remove requests when a
terminating or restarting signal is received. Otherwise, e.g. DHCPv4
address will not be removed on stop, especially when
KeepConfiguration=no.

Fixes a bug introduced by 85a6f300c1 and
its subsequent commits.

Fixes #34837.

Co-authored-by: Will Fancher <elvishjerricco@gmail.com>
2024-10-31 00:34:44 +09:00