1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

63732 Commits

Author SHA1 Message Date
Lennart Poettering
45ed795f41 update TODO
As it turns out RuntimeDirectoryPreserve= already supports such a mode.
2023-04-04 21:29:22 +02:00
Lennart Poettering
d657a4d8b1 update TODO 2023-04-04 21:29:22 +02:00
Lennart Poettering
e43911a78e execute: add one more assert() 2023-04-04 21:29:22 +02:00
Zbigniew Jędrzejewski-Szmek
9f27df2938
Merge pull request #27128 from keszybz/sd-bus-docs-and-error-messages
Improvements to man pages for systemd.service, sd-bus, and better error messages
2023-04-04 21:28:15 +02:00
Yu Watanabe
bc729e81f2 man: mention -o option for systemd-journal-remote 2023-04-04 19:52:04 +01:00
Yu Watanabe
a9f48db5f6 machine-id-setup: do not read host's machine ID when root directory is specified
If a root directory is specified, and e.g. /var under the root directory
is a symlink to the host's /var, then we wrongly read host's machine ID,
even if O_NOFOLLOW is set.

Let's chase the path with CHASE_NOFOLLOW to refuse such case.

Also, refuse null ID, otherwise we may setup machine ID with NULL.
2023-04-05 00:52:56 +09:00
Yu Watanabe
c1d74108a0 machine-id-setup: use id128_get_machine() at one more place 2023-04-05 00:52:56 +09:00
Yu Watanabe
f7b5f39934 discover-image: use id128_get_machine() at one more place 2023-04-05 00:52:56 +09:00
Yu Watanabe
edd595f760 specifier: always convert missing machine-id file to EUNATCH
Then, use id128_get_machine().
2023-04-05 00:52:56 +09:00
Yu Watanabe
319477f1b6 nspawn: ignore NULL machine ID in the container
Previously, when the NULL (all zero) machine ID is configured in the
container, nspawn refused to execute.

Now id128_get_machine() is used, so NULL machine ID is refused with
-ENOMEDIUM, and fallback to specified UUID or randomly generated one.
2023-04-05 00:52:56 +09:00
Yu Watanabe
5ee37b703e repart: use id128_get_machine()
This also makes that the seed is actually randomized when the read
machine ID is NULL.
2023-04-05 00:52:56 +09:00
Yu Watanabe
1adbc2a428 test: add tests for id128_get_machine() and _at() 2023-04-05 00:52:56 +09:00
Yu Watanabe
64c8c1bf1c sd-id128: introduce id128_get_machine() and id128_get_machine_at() 2023-04-05 00:52:56 +09:00
Yu Watanabe
e212f42279 fd-util: introduce dir_fd_is_root_or_cwd() 2023-04-05 00:52:56 +09:00
Yu Watanabe
99e6d7941b test: add tests for ID128_REFUSE_NULL 2023-04-05 00:52:56 +09:00
Yu Watanabe
52673ef848 sd-id128: introduce ID128_REFUSE_NULL flag 2023-04-05 00:52:56 +09:00
Lennart Poettering
51339a9aeb service: minor modernizations 2023-04-04 22:34:18 +08:00
Zbigniew Jędrzejewski-Szmek
45f540a297 manager: remove transient unit directory during startup
I was testing transient units and user@.service crashed. I restarted it, and
tried to create a transient unit. It failed because
/run/user/1000/systemd/transient/ remained after the previous aborted run:
  Failed to start transient service unit: Unit run-u0.service was already loaded or has a fragment file.

Remove the directory during initial startup so we don't get confused by our own
files.
2023-04-04 22:33:20 +08:00
Zbigniew Jędrzejewski-Szmek
91053fc94e sd-bus: use macros for standard bus error names consistently
Also add definitions for a few names that didn't have them and update
the list in the man page.
2023-04-04 15:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
44d82df46e core: a more informative error when SetProperties/StartTransientUnit fails
I was changing how some properties are appended to the StartTransientUnit call
and messed up the message contents. When something is wrong with how the
message is structed, we would return a very generic
"Failed to start transient service unit: No such device or address".

Mention that it was property setting that failed, and translate ENXIO to a
different message. bus_unit_set_properties() or any of the children it calls
may also return other errors, in particular EBADMSG or ENOMEM, but the error
message that is generated for those is understandable, so we don't need to
"translate" them explicitly.

bus_unit_set_properties() is called from two places, so it seems nicer to
generate the message internally, rather than ask the caller to do that. Also,
now bus_unit_set_properties() always sets <error>, which is nicer for the
callers.
2023-04-04 15:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
6db00b5de1 man/sd_bus_message_open_container: mention two common errors 2023-04-04 15:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
4d7ae2557b man/systemd.service: add example for char prefixes
The prefixes can be specified for any part of the command. The docs imply this,
but it's not entirely obvious. Let's add an example.
2023-04-04 15:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
8202c01701 man: move description of command line substitution out of ExecStart=
The description was split — part was under ExecStart= and part in "Command lines".
Now the whole generic part is moved to the separate section, and under ExecStart=
only the stuff that is specific to that option is described.

This just moves the text and removes some repetitions.
2023-04-04 15:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
3ff67ec43a core: unify two similar paths, avoid formatting of unused string
After 'if (DEBUG_LOGGING)' is added, the two call sites are almost identical,
except that we forgot LOG_UNIT_INVOCATION_ID(unit).

I removed the handling of the log_oom(). It's a debug message only after all,
and it's unlikely to fail.
2023-04-04 15:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
68ecb48b90 core: simplify unit_escape_setting()
The function had a provision for NULL input, and would return NULL, but that
looks like an error and all callers pass in a non-NULL arg and report oom on
NULL. So assert that the input is non-NULL.

All callers specifed the output buffer, so we can simplify the logic to only
make an allocation if appropriate and change the return type to 'const *'.

No functional change.
2023-04-04 15:18:00 +02:00
Zbigniew Jędrzejewski-Szmek
4a055e5a3e core: typos in comments 2023-04-04 15:18:00 +02:00
Lennart Poettering
a23d80d322 update TODO 2023-04-04 12:36:54 +02:00
Yu Watanabe
1f06ea747b sd-journal: allow to specify compression algorithm through env
Fixes RHBZ#2183546 (https://bugzilla.redhat.com/show_bug.cgi?id=2183546).

Previously, journal file is always compressed with the default algorithm
set at compile time. So, if a newer algorithm is used, journal files
cannot be read by older version of journalctl that does not support the
algorithm.

Co-authored-by: Colin Walters <walters@verbum.org>
2023-04-04 18:32:12 +09:00
Yu Watanabe
2360352ef0 sd-journal: always use the compression algorithm specified in the header
Previously, data object may be compressed with an algorithm that is not
mentioned in the header.
2023-04-04 18:32:12 +09:00
Yu Watanabe
83f3d73da8 compress: introduce compression_supported() helper function 2023-04-04 18:32:12 +09:00
Yu Watanabe
9dfbae203e sd-journal: cache results of parsing environment variables 2023-04-04 18:32:12 +09:00
Yu Watanabe
01aa59979b journald: fix log message 2023-04-04 18:32:12 +09:00
Lennart Poettering
f2eb0c508f service: dump fdstore contents also in free-form debug dump 2023-04-04 09:45:17 +02:00
Daan De Meyer
b3a3ed2d50
Merge pull request #27122 from yuwata/id128-at
undefined
2023-04-04 09:25:37 +02:00
Yu Watanabe
21eac258f8 chase: fix error handling
Fixes a bug introduced by 63bfd52f48.
2023-04-04 09:20:09 +02:00
Yu Watanabe
9853542dd3 test: add tests for id128_{read,write}_at() 2023-04-04 11:46:18 +09:00
Yu Watanabe
c227c46b8b sd-id128: introduce id128_write_at() 2023-04-04 11:46:18 +09:00
Yu Watanabe
0f44b76601 sd-id128: introduce id128_read_at() 2023-04-04 11:46:18 +09:00
Yu Watanabe
762b78dee9 sd-id128: rename Id128FormatFlag -> Id128Flag
As the flag is not only for formatting.
2023-04-04 11:46:18 +09:00
Yu Watanabe
169d91b727 sd-id128: rename argument and add missing assertion 2023-04-04 11:46:18 +09:00
Yu Watanabe
17f9d6d806 Revert "sd-id128: make id128_read() optionally take root directory"
This reverts commit 830e52caa2.
2023-04-04 11:46:18 +09:00
OMOJOLA JOSHUA DAMILOLA
de2820606d src: changed usage of basename() to path_extract_filename().
TODO.
2023-04-04 00:10:22 +01:00
Luca Boccassi
ee9fc74a4c
Merge pull request #27114 from keszybz/trivial-cleanups
Trivial cleanups
2023-04-03 18:55:49 +01:00
Lennart Poettering
a732e28436 pid1: drop two spurious empty line 2023-04-03 19:15:58 +02:00
Mike Yuan
09567df7db core/main: also check the argument terminator
For future-proof reasons, in case we will add
another option that starts with --deserialize.

Addresses 4f44d2c4f7 (r107285603)
2023-04-03 16:04:35 +01:00
Dmitry V. Levin
56df2f6f9b udev-rules: check tokens order
When invoked by udevadm verify, warn about rules that have PROGRAM
assignments specified after RESULT checks.
2023-04-03 23:44:26 +09:00
Zbigniew Jędrzejewski-Szmek
73ed4874e9 shared/exec-util: reduce scope of iterator variables 2023-04-03 15:28:53 +02:00
Zbigniew Jędrzejewski-Szmek
68e58ca95b core/service: inline one variable 2023-04-03 15:28:53 +02:00
Zbigniew Jędrzejewski-Szmek
2657d5bddc basic/fs-util: typo fix 2023-04-03 15:28:53 +02:00
Zbigniew Jędrzejewski-Szmek
0d6e0adef5 man/systemd-sysext: minor grammar optimizations 2023-04-03 15:28:44 +02:00