]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest-64: add tests for compat devlinks for NVMe drive 27169/head
Yu Watanabe [Fri, 7 Apr 2023 18:33:32 +0000 (03:33 +0900)] 
test-64: add tests for compat devlinks for NVMe drive

2 years agorules: drop doubled space
Yu Watanabe [Fri, 7 Apr 2023 18:36:44 +0000 (03:36 +0900)] 
rules: drop doubled space

2 years agoudev: restore compat symlink for nvme devices
Zbigniew Jędrzejewski-Szmek [Thu, 6 Apr 2023 10:28:14 +0000 (12:28 +0200)] 
udev: restore compat symlink for nvme devices

In 5118e8e71dda211d20e34ec8d3012186ba27d3d3, the rules were changed to add
OPTIONS="string_escape=replace" to creation of
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", so that "/" would be
escaped. But this also changes how the symlink looks for devices that do not
have "/". This adds back the old symlink for compat, except when a slash
is present.

In the meantime, we changed the symlink format to include ${ND_NSID}. Since
the symlink with unescaped characters are older than that, for compat we
only need to cover the older type. (Symlinks without escaping and with ${ND_NSID}
were never created.)  This makes it slightly easier on users: the non-deprecated
symlinks are with "_${ND_NSID}", so they are easier to distinguish.

Fixes #27155.

Mostly untested :(  I only have a boring nvme device with no special characters
in the id, and the symlinks are unchanged for it by this patch.

2 years agosd-device: manage cached sysattr values with path_hash_ops
Yu Watanabe [Thu, 6 Apr 2023 23:50:54 +0000 (08:50 +0900)] 
sd-device: manage cached sysattr values with path_hash_ops

As here keys are relative paths to sysattrs.

2 years agosd-device,udev: tag must be a valid filename
Yu Watanabe [Thu, 6 Apr 2023 23:45:35 +0000 (08:45 +0900)] 
sd-device,udev: tag must be a valid filename

All tags are managed under /run/udev/tags, and the directories there are
named with tags. Hence, each tag must be a valid filename.

This also makes all validity check moved to sd-device side, and
makes failure caused by setting invalid tags non-critical.

With this change, an empty string cannot be assigned to TAG=, hence the
test cases are adjusted.

2 years agosd-device,udev: refuse invalid devlink and store in normalized form
Yu Watanabe [Thu, 6 Apr 2023 23:44:00 +0000 (08:44 +0900)] 
sd-device,udev: refuse invalid devlink and store in normalized form

This is especially for the case that the path contains "..".
Prompted by https://github.com/systemd/systemd/pull/27164#issuecomment-1498863858.

This also makes SYMLINK= gracefully handle paths prefixed with "/dev/",
and manage devlink paths with path_hash_ops.

2 years agoudev-rules: replace ingrowing word extractor with extract_first_word()
Yu Watanabe [Thu, 6 Apr 2023 18:31:01 +0000 (03:31 +0900)] 
udev-rules: replace ingrowing word extractor with extract_first_word()

No functional change, just refactoring.

2 years agoudev-rules: rename variable "filename" -> "path"
Yu Watanabe [Thu, 6 Apr 2023 23:36:15 +0000 (08:36 +0900)] 
udev-rules: rename variable "filename" -> "path"

2 years agoudev-rules: add/update comments
Yu Watanabe [Thu, 6 Apr 2023 18:33:15 +0000 (03:33 +0900)] 
udev-rules: add/update comments

2 years agoudev-rules: add missing paren
Yu Watanabe [Thu, 6 Apr 2023 18:37:03 +0000 (03:37 +0900)] 
udev-rules: add missing paren

2 years agolocaled: fix invalid free after shifting pointers using strstrip
Olivier Gayot [Fri, 7 Apr 2023 08:32:07 +0000 (10:32 +0200)] 
localed: fix invalid free after shifting pointers using strstrip

After manually editing /etc/locale.gen, calling localectl set-locale
sometimes fails. When it fails, the systemd journal shows:
systemd-localed: free() / invalid pointer.

It turned out that it only fails if some of the uncommented lines in
/etc/locale.gen have leading spaces, as in:

  * C.UTF-8       <= OK
  * en_US.UTF-8   <= OK
  *  fr_FR.UTF-8  <= NOK

After parsing a line from /etc/locale.gen, we use strstrip() to obtain
the "trimmed" line (without leading or trailing spaces).

However, we store the result of strstrip() in the original pointer
containing the untrimmed line. This pointer is later passed to free
(this is done automatically using _cleanup_free_).

This is a problem because if any leading space is present, the pointer
will essentially be shifted from its original value. This will result in
an invalid free upon cleanup.

The same issue is present in the locale_gen_locale_supported function.

Fixed by storing the result of strstrip() in a different pointer.

2 years agoman/systemd-mount: Clearify documentation about --bind-device
Uwe Kleine-König [Wed, 5 Apr 2023 16:23:40 +0000 (18:23 +0200)] 
man/systemd-mount: Clearify documentation about --bind-device

The documentation suggests that the mount point (i.e. the directory
where the device is mounted) is removed when the device vanishes.
However only stopping of the automount unit is implemented.

So adapt the documentation to reality.

2 years agomkosi: Update to latest
Daan De Meyer [Fri, 7 Apr 2023 11:50:06 +0000 (13:50 +0200)] 
mkosi: Update to latest

This contains the recently merged fixes to config parsing ordering
and overrides.

2 years agohwdb: Add support for "Passion Model P612F"
Dmitrii Fomchenkov [Fri, 7 Apr 2023 06:44:36 +0000 (09:44 +0300)] 
hwdb: Add support for "Passion Model P612F"

Add hwdb sensor entry for device Passion with accelerometer "MXC6655".

2 years agoMerge pull request #26887 from yuwata/proc-cmdline-filter-arguments
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2023 08:55:30 +0000 (10:55 +0200)] 
Merge pull request #26887 from yuwata/proc-cmdline-filter-arguments

proc-cmdline: filter PID1 arguments on container

2 years agoMerge pull request #27161 from pothos/sysext-refresh
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2023 08:40:18 +0000 (10:40 +0200)] 
Merge pull request #27161 from pothos/sysext-refresh

systemd-sysext/confext.service: Refresh on start/reload

2 years agobootctl: Gracefully handle missing bootloader directory
Daan De Meyer [Thu, 6 Apr 2023 10:17:18 +0000 (12:17 +0200)] 
bootctl: Gracefully handle missing bootloader directory

When --graceful is specified, let's gracefully deal with a missing
bootloader directory.

2 years agobootctl: show report state and type in json output
Ludwig Nussel [Thu, 6 Apr 2023 09:45:23 +0000 (11:45 +0200)] 
bootctl: show report state and type in json output

2 years agoresolve: change DNS_PACKET_UNICAST_SIZE_LARGE_MAX to 1232 (#27171)
Cristian Rodríguez [Fri, 7 Apr 2023 07:52:52 +0000 (03:52 -0400)] 
resolve: change DNS_PACKET_UNICAST_SIZE_LARGE_MAX to 1232 (#27171)

The old common default was 4096, until 2020 on which all DNS servers (verified
on BIND9, NSD, Unbound, dnsmasq) switched to 1232 as an agreed max size [1].

[1] https://www.dnsflagday.net/2020/#message-size-considerations

2 years agoMerge pull request #27126 from yuwata/journal-compress
Zbigniew Jędrzejewski-Szmek [Fri, 7 Apr 2023 07:28:27 +0000 (09:28 +0200)] 
Merge pull request #27126 from yuwata/journal-compress

sd-journal: allow to specify compression algorithm through env

2 years agoman: netdev: Clarify wireguard IPv6 endpoint format
Sorah Fukumori [Thu, 6 Apr 2023 19:15:43 +0000 (04:15 +0900)] 
man: netdev: Clarify wireguard IPv6 endpoint format

2 years agomkosi: Update to latest
Daan De Meyer [Thu, 6 Apr 2023 19:41:14 +0000 (21:41 +0200)] 
mkosi: Update to latest

This also migrates the configuration to the new format that was
just merged in mkosi. Specifically, we make use of the new [Match]
sections to only include specific config snippets per distro.

2 years agoMerge pull request #27158 from mrc0mmand/more-tests
Yu Watanabe [Thu, 6 Apr 2023 22:53:37 +0000 (07:53 +0900)] 
Merge pull request #27158 from mrc0mmand/more-tests

test: introduce TEST-81-GENERATORS

2 years agotest: check if we skip the full setup on daemon-reexec
Frantisek Sumsal [Thu, 6 Apr 2023 17:14:12 +0000 (19:14 +0200)] 
test: check if we skip the full setup on daemon-reexec

A simple test case for issue #27106.

Resolves: #27139

2 years agotest: add test case that journal file is created with the requested compression algorithm 27126/head
Yu Watanabe [Tue, 4 Apr 2023 06:03:35 +0000 (15:03 +0900)] 
test: add test case that journal file is created with the requested compression algorithm

2 years agosystemd-sysext/confext.service: Refresh on start/reload 27161/head
Kai Lueke [Thu, 6 Apr 2023 08:32:33 +0000 (17:32 +0900)] 
systemd-sysext/confext.service: Refresh on start/reload

When adding a sysext image to the system and manuall merging it, a
later "systemctl (re)start systemd-sysext" won't work because "merge"
refuses to work when something is merged already. Another problem with
"merge" at start plus "unmerge" at stop is that a service restart can't
make use of the new MOVE_MOUNT_BENEATH in the future even which would
only be available in "refresh". It also prepares us for setting up the
merged overlay for the sysroot from the initrd already, which also
would lead to the mentioned start problem of the service (One
optimization could be to skip the loading but only if we are sure that
all images were loaded and weren't modified since - this assumption is
hard because early services could want to inject a sysext, too).

Use "refresh" on service start to fix the problem that the service
can't start as soon as a manual merge was done. Also add a reload
action that allows to issue "systemctl reload systemd-sysext" and it
will make use of MOVE_MOUNT_BENEATH once we implement this in
systemd-sysext refresh (and it's available from the kernel).

2 years agoman/systemd-dissect.xml: Remove old sysext path, add confext path
Kai Lueke [Thu, 6 Apr 2023 08:30:34 +0000 (17:30 +0900)] 
man/systemd-dissect.xml: Remove old sysext path, add confext path

The /usr/lib/extensions/ location for systemd-sysext images is not
supported anymore. In https://github.com/systemd/systemd/pull/26013
systemd-confext images got introduced and we can list its path under
/usr instead.

2 years agotest: introduce TEST-81-GENERATORS 27158/head
Frantisek Sumsal [Mon, 3 Apr 2023 20:38:37 +0000 (22:38 +0200)] 
test: introduce TEST-81-GENERATORS

Add some explicit tests for various generators we ship, e.g.:
    - systemd-debug-generator
    - systemd-environment-d-generator
    - systemd-fstab-generator

2 years agoMerge pull request #26013 from goenkam/maanya/syscfg-feature
Luca Boccassi [Thu, 6 Apr 2023 09:59:18 +0000 (10:59 +0100)] 
Merge pull request #26013 from goenkam/maanya/syscfg-feature

confext: extension of sysext

2 years agotest: add a couple of tests for systemd-modules-load
Frantisek Sumsal [Mon, 3 Apr 2023 16:32:58 +0000 (18:32 +0200)] 
test: add a couple of tests for systemd-modules-load

2 years agofstab-generator: don't propagate ignored errno
Frantisek Sumsal [Wed, 5 Apr 2023 18:14:53 +0000 (20:14 +0200)] 
fstab-generator: don't propagate ignored errno

With certain fstabs we may propagate ENXIO from the $SYSTEMD_SYSFS_CHECK
check all the way up, making fstab-generator exit with a non-zero EC and
without any helpful message, which is really confusing.

2 years agorepart: Add more logging
Daan De Meyer [Wed, 5 Apr 2023 17:36:05 +0000 (19:36 +0200)] 
repart: Add more logging

2 years agoconfext: shell completion for systemd-confext 26013/head
maanyagoenka [Fri, 24 Feb 2023 08:44:36 +0000 (08:44 +0000)] 
confext: shell completion for systemd-confext

2 years agoconfext: documentation and man page updates for confext
maanyagoenka [Fri, 24 Feb 2023 08:42:45 +0000 (08:42 +0000)] 
confext: documentation and man page updates for confext

2 years agotest-os-util: add tests for sysext and confext release files
maanyagoenka [Fri, 31 Mar 2023 17:33:00 +0000 (17:33 +0000)] 
test-os-util: add tests for sysext and confext release files

2 years agoconfext: add tests for systemd-confext
maanyagoenka [Fri, 24 Feb 2023 08:35:38 +0000 (08:35 +0000)] 
confext: add tests for systemd-confext

2 years agoconfext: add the systemd-confext.service file
maanyagoenka [Fri, 24 Feb 2023 08:33:15 +0000 (08:33 +0000)] 
confext: add the systemd-confext.service file

2 years agoconfext: add multi call functionality to sysext
maanyagoenka [Wed, 29 Mar 2023 20:35:18 +0000 (20:35 +0000)] 
confext: add multi call functionality to sysext

The confext concept is an extension of the existing sysext concept and
allows to extend the host's filesystem or a unit's filesystem with signed
images that add new files to the /etc/ directory using OverlayFS.

2 years agoextension-release: establish compatibility between host file and extension-release...
maanyagoenka [Wed, 29 Mar 2023 20:34:21 +0000 (20:34 +0000)] 
extension-release: establish compatibility between host file and extension-release file

The release file that accompanies the confext images needs to be
host compatible to be able to be merged into the host /etc/ directory.
This commit checks for version compatibility between the image file and
the host file.

2 years agoos-util: add a new confext image type and the ability to parse their release files
maanyagoenka [Fri, 24 Feb 2023 00:37:52 +0000 (00:37 +0000)] 
os-util: add a new confext image type and the ability to parse their release files

Adds a new image type called IMAGE_CONFEXT which is similar to IMAGE_SYSEXT but works
for the /etc/ directory instead of /usr/ and /opt/. This commit also adds the ability to
parse the release file that is present with the confext image in /etc/confext-release.d/
directory.

2 years agoMerge pull request #27154 from DaanDeMeyer/kconfig
Luca Boccassi [Wed, 5 Apr 2023 18:59:24 +0000 (19:59 +0100)] 
Merge pull request #27154 from DaanDeMeyer/kconfig

mkosi kernel build updates

2 years agotest: use kbd-mode-map we ship in TEST-73-LOCALE
Franck Bui [Wed, 5 Apr 2023 11:37:48 +0000 (13:37 +0200)] 
test: use kbd-mode-map we ship in TEST-73-LOCALE

The rational is the same as the one described in commit
be0cc2ce6c947aafadb3f42dba405269f670b31c.

2 years agotest: add tests for dir_fd_is_root_or_cwd()
Yu Watanabe [Wed, 5 Apr 2023 06:23:19 +0000 (15:23 +0900)] 
test: add tests for dir_fd_is_root_or_cwd()

Follow-up for e212f422796da9e626030289faf083407c8955df.

2 years agomkosi: Update bundled kconfig 27154/head
Daan De Meyer [Wed, 5 Apr 2023 15:04:30 +0000 (17:04 +0200)] 
mkosi: Update bundled kconfig

- Remove useless serial console configs
- Add CONFIG_SERIAL_8250_PCI so that qemu's virtconsole works properly
- Add CONFIG_DMI and CONFIG_DMI_SYSFS so that SMBIOS credentials work
- Add CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC so we can read the
  current kernel config from /proc/config.gz
- Add CONFIG_IOSCHED_BFQ to get rid of a udev error on boot on Fedora
- Add CONFIG_HW_RANDOM_VIRTIO to get hw rng in qemu
- Add CONFIG_SECURITY_YAMA to get rid of warning from sysctl on boot
- Add CONFIG_VSOCKETS and CONFIG_VIRTIO_VSOCKETS to enable vsock support

2 years agomkosi: Make sure we always boot our built from source kernel
Daan De Meyer [Wed, 5 Apr 2023 14:20:28 +0000 (16:20 +0200)] 
mkosi: Make sure we always boot our built from source kernel

If we build a kernel from source, let's make sure it's always booted
by giving it a very high version number.

2 years agoresolve: refuse mdns scope for ipv4 broadcast addresses
Ronan Pigott [Mon, 27 Mar 2023 16:43:58 +0000 (09:43 -0700)] 
resolve: refuse mdns scope for ipv4 broadcast addresses

This query can never be answered, so let's no wait for it to timeout.

2 years agoMerge pull request #27143 from bluca/no_tpm
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2023 09:24:18 +0000 (11:24 +0200)] 
Merge pull request #27143 from bluca/no_tpm

cryptsetup: fix build without TPM2

2 years agoRevert "mkosi: Drop python-docutils"
Daan De Meyer [Wed, 5 Apr 2023 08:23:58 +0000 (10:23 +0200)] 
Revert "mkosi: Drop python-docutils"

This reverts commit be266f49d6b7e3f021e2a07f937d39d1f14a283d.

Turns out we installed this because it's required by the bpf selftests
so let's keep it intact.

2 years agoservice: use newdup() where appropriate
Lennart Poettering [Tue, 4 Apr 2023 14:25:33 +0000 (16:25 +0200)] 
service: use newdup() where appropriate

2 years agoMerge pull request #27137 from yuwata/id128-get-machine
Yu Watanabe [Wed, 5 Apr 2023 06:24:45 +0000 (15:24 +0900)] 
Merge pull request #27137 from yuwata/id128-get-machine

sd-id128: introduce id128_get_machine() and _at()

2 years agovarious: simplify calls to parse_boolean_argument()
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2023 17:39:04 +0000 (19:39 +0200)] 
various: simplify calls to parse_boolean_argument()

parse_boolean_argument() returns the same information via both the output
argument and normal return.

2 years agoci: do one build with no tpm/p11kit/fido2 27143/head
Luca Boccassi [Tue, 4 Apr 2023 21:37:35 +0000 (22:37 +0100)] 
ci: do one build with no tpm/p11kit/fido2

We have some missing coverage in the CI, all builds enable these features,
but there are often changes and they cover a lot of code. Do one build
without them to ensure we don't break builds.

2 years agocryptsetup: fix build without TPM2
Luca Boccassi [Tue, 4 Apr 2023 21:34:49 +0000 (22:34 +0100)] 
cryptsetup: fix build without TPM2

Follow-up for acbb504eaf1be51572b1c0d0d490ac478bc41c64

2 years agotpm2: fix nits from PR #26185
William Roberts [Tue, 4 Apr 2023 16:14:17 +0000 (11:14 -0500)] 
tpm2: fix nits from PR #26185

Fixes:
  - Comment style
  - Alignment style
  - cleanup macro usage
  - incorrect error message[1]

1. Thanks to tempusfugit991@gmail.com for pointing out the error
message mistake.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
2 years agotest/test-functions: fix typo in install_suse_systemd()
Thomas Blume [Tue, 4 Apr 2023 13:13:13 +0000 (15:13 +0200)] 
test/test-functions: fix typo in install_suse_systemd()

2 years agoupdate TODO
Lennart Poettering [Tue, 4 Apr 2023 19:28:50 +0000 (21:28 +0200)] 
update TODO

As it turns out RuntimeDirectoryPreserve= already supports such a mode.

2 years agoupdate TODO
Lennart Poettering [Tue, 4 Apr 2023 19:27:52 +0000 (21:27 +0200)] 
update TODO

2 years agoexecute: add one more assert()
Lennart Poettering [Tue, 4 Apr 2023 11:41:00 +0000 (13:41 +0200)] 
execute: add one more assert()

2 years agoMerge pull request #27128 from keszybz/sd-bus-docs-and-error-messages
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2023 19:28:15 +0000 (21:28 +0200)] 
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

2 years agoman: mention -o option for systemd-journal-remote
Yu Watanabe [Tue, 4 Apr 2023 15:38:55 +0000 (00:38 +0900)] 
man: mention -o option for systemd-journal-remote

2 years agomachine-id-setup: do not read host's machine ID when root directory is specified 27137/head
Yu Watanabe [Fri, 31 Mar 2023 07:07:23 +0000 (16:07 +0900)] 
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.

2 years agomachine-id-setup: use id128_get_machine() at one more place
Yu Watanabe [Sat, 1 Apr 2023 13:49:47 +0000 (22:49 +0900)] 
machine-id-setup: use id128_get_machine() at one more place

2 years agodiscover-image: use id128_get_machine() at one more place
Yu Watanabe [Sat, 1 Apr 2023 13:49:22 +0000 (22:49 +0900)] 
discover-image: use id128_get_machine() at one more place

2 years agospecifier: always convert missing machine-id file to EUNATCH
Yu Watanabe [Sat, 1 Apr 2023 13:48:14 +0000 (22:48 +0900)] 
specifier: always convert missing machine-id file to EUNATCH

Then, use id128_get_machine().

2 years agonspawn: ignore NULL machine ID in the container
Yu Watanabe [Sat, 1 Apr 2023 05:59:46 +0000 (14:59 +0900)] 
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.

2 years agorepart: use id128_get_machine()
Yu Watanabe [Fri, 31 Mar 2023 07:00:37 +0000 (16:00 +0900)] 
repart: use id128_get_machine()

This also makes that the seed is actually randomized when the read
machine ID is NULL.

2 years agotest: add tests for id128_get_machine() and _at()
Yu Watanabe [Tue, 4 Apr 2023 02:43:06 +0000 (11:43 +0900)] 
test: add tests for id128_get_machine() and _at()

2 years agosd-id128: introduce id128_get_machine() and id128_get_machine_at()
Yu Watanabe [Fri, 31 Mar 2023 06:55:01 +0000 (15:55 +0900)] 
sd-id128: introduce id128_get_machine() and id128_get_machine_at()

2 years agofd-util: introduce dir_fd_is_root_or_cwd()
Yu Watanabe [Sat, 1 Apr 2023 16:25:46 +0000 (01:25 +0900)] 
fd-util: introduce dir_fd_is_root_or_cwd()

2 years agotest: add tests for ID128_REFUSE_NULL
Yu Watanabe [Tue, 4 Apr 2023 03:26:57 +0000 (12:26 +0900)] 
test: add tests for ID128_REFUSE_NULL

2 years agosd-id128: introduce ID128_REFUSE_NULL flag
Yu Watanabe [Tue, 4 Apr 2023 03:18:04 +0000 (12:18 +0900)] 
sd-id128: introduce ID128_REFUSE_NULL flag

2 years agoservice: minor modernizations
Lennart Poettering [Tue, 4 Apr 2023 10:21:00 +0000 (12:21 +0200)] 
service: minor modernizations

2 years agomanager: remove transient unit directory during startup
Zbigniew Jędrzejewski-Szmek [Tue, 4 Apr 2023 10:05:16 +0000 (12:05 +0200)] 
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.

2 years agosd-bus: use macros for standard bus error names consistently 27128/head
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 21:07:33 +0000 (23:07 +0200)] 
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.

2 years agocore: a more informative error when SetProperties/StartTransientUnit fails
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 19:08:35 +0000 (21:08 +0200)] 
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.

2 years agoman/sd_bus_message_open_container: mention two common errors
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 18:53:51 +0000 (20:53 +0200)] 
man/sd_bus_message_open_container: mention two common errors

2 years agoman/systemd.service: add example for char prefixes
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 18:16:01 +0000 (20:16 +0200)] 
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.

2 years agoman: move description of command line substitution out of ExecStart=
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 18:05:18 +0000 (20:05 +0200)] 
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.

2 years agocore: unify two similar paths, avoid formatting of unused string
Zbigniew Jędrzejewski-Szmek [Sun, 2 Apr 2023 11:50:29 +0000 (13:50 +0200)] 
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.

2 years agocore: simplify unit_escape_setting()
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2023 14:23:47 +0000 (16:23 +0200)] 
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.

2 years agocore: typos in comments
Zbigniew Jędrzejewski-Szmek [Sat, 1 Apr 2023 14:15:12 +0000 (16:15 +0200)] 
core: typos in comments

2 years agoupdate TODO
Lennart Poettering [Tue, 4 Apr 2023 10:20:50 +0000 (12:20 +0200)] 
update TODO

2 years agosd-journal: allow to specify compression algorithm through env
Yu Watanabe [Tue, 4 Apr 2023 05:19:51 +0000 (14:19 +0900)] 
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>
2 years agosd-journal: always use the compression algorithm specified in the header
Yu Watanabe [Tue, 4 Apr 2023 09:22:50 +0000 (18:22 +0900)] 
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.

2 years agocompress: introduce compression_supported() helper function
Yu Watanabe [Tue, 4 Apr 2023 05:34:32 +0000 (14:34 +0900)] 
compress: introduce compression_supported() helper function

2 years agosd-journal: cache results of parsing environment variables
Yu Watanabe [Tue, 4 Apr 2023 07:43:44 +0000 (16:43 +0900)] 
sd-journal: cache results of parsing environment variables

2 years agojournald: fix log message
Yu Watanabe [Tue, 4 Apr 2023 08:11:28 +0000 (17:11 +0900)] 
journald: fix log message

2 years agoservice: dump fdstore contents also in free-form debug dump
Lennart Poettering [Thu, 30 Mar 2023 14:38:47 +0000 (16:38 +0200)] 
service: dump fdstore contents also in free-form debug dump

2 years agoMerge pull request #27122 from yuwata/id128-at
Daan De Meyer [Tue, 4 Apr 2023 07:25:37 +0000 (09:25 +0200)] 
Merge pull request #27122 from yuwata/id128-at

undefined

2 years agochase: fix error handling
Yu Watanabe [Sat, 1 Apr 2023 12:58:08 +0000 (21:58 +0900)] 
chase: fix error handling

Fixes a bug introduced by 63bfd52f48a772c86ff84e3a1ba1fcd19e0008f8.

2 years agotest: add tests for id128_{read,write}_at() 27122/head
Yu Watanabe [Tue, 4 Apr 2023 02:39:33 +0000 (11:39 +0900)] 
test: add tests for id128_{read,write}_at()

2 years agosd-id128: introduce id128_write_at()
Yu Watanabe [Fri, 31 Mar 2023 07:12:39 +0000 (16:12 +0900)] 
sd-id128: introduce id128_write_at()

2 years agosd-id128: introduce id128_read_at()
Yu Watanabe [Fri, 31 Mar 2023 07:10:36 +0000 (16:10 +0900)] 
sd-id128: introduce id128_read_at()

2 years agosd-id128: rename Id128FormatFlag -> Id128Flag
Yu Watanabe [Sat, 1 Apr 2023 12:30:45 +0000 (21:30 +0900)] 
sd-id128: rename Id128FormatFlag -> Id128Flag

As the flag is not only for formatting.

2 years agosd-id128: rename argument and add missing assertion
Yu Watanabe [Sat, 1 Apr 2023 15:35:33 +0000 (00:35 +0900)] 
sd-id128: rename argument and add missing assertion

2 years agoRevert "sd-id128: make id128_read() optionally take root directory"
Yu Watanabe [Mon, 3 Apr 2023 01:39:00 +0000 (10:39 +0900)] 
Revert "sd-id128: make id128_read() optionally take root directory"

This reverts commit 830e52caa2bf1a29f56cb93e7ed85acb1bda11c3.

2 years agosrc: changed usage of basename() to path_extract_filename().
OMOJOLA JOSHUA DAMILOLA [Sat, 1 Apr 2023 18:52:32 +0000 (18:52 +0000)] 
src: changed usage of basename() to path_extract_filename().
TODO.

2 years agoMerge pull request #27114 from keszybz/trivial-cleanups
Luca Boccassi [Mon, 3 Apr 2023 17:55:49 +0000 (18:55 +0100)] 
Merge pull request #27114 from keszybz/trivial-cleanups

Trivial cleanups

2 years agopid1: drop two spurious empty line
Lennart Poettering [Mon, 3 Apr 2023 17:15:58 +0000 (19:15 +0200)] 
pid1: drop two spurious empty line

2 years agocore/main: also check the argument terminator
Mike Yuan [Mon, 3 Apr 2023 10:42:39 +0000 (18:42 +0800)] 
core/main: also check the argument terminator

For future-proof reasons, in case we will add
another option that starts with --deserialize.

Addresses https://github.com/systemd/systemd/commit/4f44d2c4f76922a4f48dd4473e6abaca40d7e555#r107285603