Yu Watanabe [Thu, 9 Dec 2021 07:02:23 +0000 (16:02 +0900)]
doc: fix typo
Дамјан Георгиевски [Mon, 29 Nov 2021 21:44:01 +0000 (22:44 +0100)]
bootctl: optionally install .signed efi file
if /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed exists
install that instead of /usr/lib/systemd/boot/efi/systemd-bootx64.efi
the idea is that SecureBoot tooling can create the efi.signed file
whenever /usr/lib/systemd/boot/efi/systemd-bootx64.efi from the package
is updated.
Yu Watanabe [Wed, 8 Dec 2021 20:57:12 +0000 (05:57 +0900)]
Merge pull request #21686 from yuwata/network-wlan-fix-reconfigure
network: do not reconfigure wireless interface when previously not connected to any APs
Daan De Meyer [Wed, 8 Dec 2021 20:15:38 +0000 (20:15 +0000)]
Merge pull request #21637 from nabijaczleweli/EBA
kernel-install: export BOOT_ROOT instead of hacking it in hooks, note KERNEL_INSTALL_* ABI
Yu Watanabe [Wed, 8 Dec 2021 19:35:50 +0000 (04:35 +0900)]
Merge pull request #21678 from keszybz/sysusers-work
Make it easier to figure out what sysusers is doing and why
Yu Watanabe [Wed, 8 Dec 2021 18:04:21 +0000 (03:04 +0900)]
network: do not reconfigure wireless interface when previously not connected to any APs
Follow-up for
6706ce2fd2a13df0ae5e469b72d688eaf643dac4.
Fixes #21685.
Yu Watanabe [Wed, 8 Dec 2021 17:43:21 +0000 (02:43 +0900)]
network: wifi: ssid may be NULL
This fixes the following log message:
systemd-networkd[888]: wlan0: nl80211: received new_interface(7) message: iftype=station, ssid=(null)
Luca Boccassi [Wed, 8 Dec 2021 13:28:15 +0000 (13:28 +0000)]
Merge pull request #21667 from yuwata/resolve-do-not-re-read-settings-from-networkd-when-unmodified
resolve: do not re-read settings from networkd when link state file is unmodified
Daan De Meyer [Wed, 8 Dec 2021 11:56:36 +0000 (12:56 +0100)]
docs: Clarify that the fd store is discarded when a service is stopped
Frantisek Sumsal [Wed, 8 Dec 2021 13:24:17 +0000 (13:24 +0000)]
Merge pull request #21676 from keszybz/rename-variables-to-make-codeql-happy
Rename variables to make codeql happy
наб [Wed, 8 Dec 2021 12:49:17 +0000 (13:49 +0100)]
journal: succes[s]fully typo
As found by fossies codespell:
https://fossies.org/linux/test/systemd-main.
bb916f3.211208.tar.gz/codespell.html
наб [Tue, 16 Mar 2021 16:42:28 +0000 (17:42 +0100)]
kernel-install: note $KERNEL_INSTALL_{MACHINE_ID,BOOT_ROOT}= ABI
наб [Tue, 16 Mar 2021 16:02:59 +0000 (17:02 +0100)]
kernel-install: export $BOOT_ROOT and use it in downstreams
The previous approach, to strip "$MACHINE_ID/$KERNEL_VERSION" from the
end, is pretty bad and encourages this for users, which makes them
inflexible to this being modified locally
Frantisek Sumsal [Wed, 8 Dec 2021 10:41:07 +0000 (11:41 +0100)]
ci: ignore FIXME alerts in the CodeQL Action
We already track them in LGTM and it unnecessarily clutters the Security
page.
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 10:46:09 +0000 (11:46 +0100)]
sysusers: raise level of message about UID/GID being already used
It can be quite important that a different value was used, so let's
log this by default.
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 10:21:17 +0000 (11:21 +0100)]
sysusers: improve message about conflicting entries
Without any markup, the sentence could be quite confusing:
g user 55
g user 56
→
"Two or more conflicting lines for user configured"
It also wasn't clear which line is ignored.
Inspired by https://github.com/systemd/systemd/pull/21156.
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 09:33:53 +0000 (10:33 +0100)]
sysusers: add --dry-run
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 09:44:00 +0000 (10:44 +0100)]
sysusers: use ordered_hashmap_isempty()
Yu Watanabe [Tue, 7 Dec 2021 16:36:07 +0000 (01:36 +0900)]
network: call link_check_ready() when all stacked netdevs are created
Follow-up for
879377cad531aabbf85a140201b0ea3ff9a8c3d2.
Otherwise, the underlying interface may stuck in configuring state.
Yu Watanabe [Tue, 7 Dec 2021 18:48:46 +0000 (03:48 +0900)]
resolve: do not re-read settings from networkd if link state file is unmodified
If many interface creation/deletion occurs continuously, then resolved
becomes easily busy. Let's slightly optimize the event triggered by
sd-network.
Yu Watanabe [Tue, 7 Dec 2021 18:15:08 +0000 (03:15 +0900)]
sd-network: introduce sd_network_link_get_stat()
Yu Watanabe [Wed, 8 Dec 2021 09:33:35 +0000 (18:33 +0900)]
sd-network: drop unnecessary +1 for buffer size
Daan De Meyer [Wed, 8 Dec 2021 09:26:53 +0000 (09:26 +0000)]
Merge pull request #21527 from vcaputo/journal-file-mfd-centric
journal-file: get rid of JournalFile.mmap
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 09:19:53 +0000 (10:19 +0100)]
sysusers: use uppercase UID/GID consistently in messages
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 09:09:30 +0000 (10:09 +0100)]
test-dhcp-option: inline iterator variable declarations
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 09:07:08 +0000 (10:07 +0100)]
test-exec-util: rename variable to avoid global/local name conflict
Zbigniew Jędrzejewski-Szmek [Wed, 8 Dec 2021 09:06:49 +0000 (10:06 +0100)]
test-dhcp-option: rename variable to avoid global/local name conflict
CodeQL was complaining that the local variable obscurs the global
one. It is indeed a bit confusing when reading this… Let's rename
the variable to avoid confusing the reader.
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 17:33:32 +0000 (18:33 +0100)]
gitignore: remove patterns for build files in source dir
Those made sense when autotoolz were used. With meson, everything
should land in the build dir, and this is only likely to obscure issues
with custom build rules.
C.f. https://github.com/systemd/systemd/pull/20429#issuecomment-
988132332
наб [Tue, 16 Mar 2021 16:38:20 +0000 (17:38 +0100)]
kernel-install: respect $MACHINE_ID and ignore /etc/machine-id if on tmpfs
Confer https://github.com/systemd/systemd/pull/19006#issuecomment-
800234022:
On some systems it's the admin's explicit choice not to to have the
machine ID leak into the ESP
On some systems the machine ID is transient, generated at every boot,
and hence should not be written to the ESP
Yu Watanabe [Wed, 8 Dec 2021 01:11:20 +0000 (10:11 +0900)]
Merge pull request #21672 from yuwata/network-old-kernel-support
network: old kernel support
Zbigniew Jędrzejewski-Szmek [Fri, 3 Dec 2021 12:11:01 +0000 (13:11 +0100)]
meson: drop libgcrypt dep from resolved tests
Follow-up for pull request #21170.
I hoped that we would drop libgcrypt fully and drop all references to the
library in meson, but this doesn't seem feasible (because of the use in
sd-journal). But let's remove it here, all the resolved code has been switched
to work either of the two libraries.
Yu Watanabe [Tue, 7 Dec 2021 20:47:11 +0000 (05:47 +0900)]
dhcp: fix assertion failure
Fixes #21671.
Vito Caputo [Tue, 7 Dec 2021 22:18:14 +0000 (14:18 -0800)]
journal-file: require MMapCache* for journal_file_open()
Previously the MMapCache* was optionally NULL, which open would
handle by creating a new MMapCache* for the occasion.
This produced some slightly circuitous refcount-handling code in
the function, as well as arguably creating opportunities for
weirdness where an MMapCache* was intended to be supplied but
happened to be NULL, which this magic would then paper over.
In any case, this was basically only being utilized by tests,
apparently just to avoid having to create an MMapCache. So
update the relevant tests to supply an MMapCache and make
journal_file_open() treat a NULL MMapCache* as fatal w/assert.
Vito Caputo [Tue, 7 Dec 2021 22:16:28 +0000 (14:16 -0800)]
mmap-cache: add MMapCache trivial cleanup helpers
Enable _cleanup_(mmap_cache_unrefp) style cleanup for MMapCache*
Vito Caputo [Thu, 25 Nov 2021 23:32:07 +0000 (15:32 -0800)]
journal-file: goodbye JournalFile.mmap
This gets rid of the manual MMapCache ref/unref goop in
journal_file_{open,close}(), in favor of just letting the
JournalFile.cache_fd MMapFileDescriptor carry the baton.
Vito Caputo [Thu, 25 Nov 2021 23:24:48 +0000 (15:24 -0800)]
journal: stop using JournalFile.mmap everywhere
Preparatory commit; before JournalFile can stop hanging onto its
copy of MMapCache, all these users need to find another way.
Most of the time these callers already have the MMapCache onhand,
so it's no big deal for them to just supply it.
journal_file_rotate() in particular needed to change, and it
seemed wise to not use the mmap_cache_fd_cache() accessor on
f->cache_fd, instead requiring the caller supply the cache to
use. This was done with an eye towards a potential future where
the journal_file_archive() isolates the cache_fd to a private
cache, which the newly rotated-to file wouldn't be allowed to
use. It's no biggie for the existing callers to just provide the
appropriate surviving cache.
Basically the mmap_cache_fd_cache() accessor was added just for
journal-verify.c's (ab)use of the mmap-cache. Which, if the
ugly singleton MMapCache assumption ever goes away, can be
cleaned up to simply use a separate MMapCache for those search
arrays.
Vito Caputo [Thu, 25 Nov 2021 23:07:39 +0000 (15:07 -0800)]
mmap-cache: add MMapFileDescriptor.cache accessor
Sometimes we want to reuse an existing MMapFileDescriptor's
cache, but it's a private struct.
This lets us access that pointer if necessary.
Vito Caputo [Thu, 25 Nov 2021 23:01:38 +0000 (15:01 -0800)]
mmap-cache: ref/unref MMapCache in fd add/free
Preparatory commit; callers manually ref/unref MMapCaches
alongside MMapFileDescriptor add/frees, when the latter should be
sufficient.
A subsequent commit will drop some of those manual MMapCache
reference hoop-jumping, leaving the lifecycle bound to
MMapFileDescriptors.
Yu Watanabe [Tue, 7 Dec 2021 20:35:37 +0000 (05:35 +0900)]
network: address: read flags from message header when IFA_FLAGS is not supported by kernel
Follow-up for
0828a38605975b68c14c9194a1ee2c5c2ff7038f.
Fixes #21670.
Yu Watanabe [Tue, 7 Dec 2021 20:37:42 +0000 (05:37 +0900)]
network: route: tighten variable scope
Follow-up for
5e82a6137546d3a2ac403df261732076130356a8.
Yu Watanabe [Tue, 7 Dec 2021 18:06:39 +0000 (03:06 +0900)]
sd-network: drop _public_ attribute
sd-network is not public yet.
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 17:47:25 +0000 (18:47 +0100)]
Merge pull request #20476 from jamacku/new-feature-reloaded-stamp
core: indicate the time when units were loaded
James Hilliard [Thu, 12 Aug 2021 03:59:19 +0000 (21:59 -0600)]
bpf: refactor skeleton generation
This should hopefully fix cross compilation for the bpf programs.
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 16:26:37 +0000 (17:26 +0100)]
Merge pull request #21625 from yuwata/network-dhcp-6rd
network: dhcp: add 6rd support
Luca Boccassi [Fri, 3 Dec 2021 01:36:05 +0000 (01:36 +0000)]
core: add StartUnitWithFlags DBUS method
When an activation job is skipped because of a Condition*= setting failing,
currently the JobRemoved signal lists 'done' as the result, just as with
a successful job.
This is a problem when doing dbus activation: dbus-broker will receive a
signal that says the job was successful, so then it moves into a state where
it waits for the requested name to appear on the bus, but that never happens
because the job was actually skipped.
Add a new StartUnitWithFlags that changes the behaviour of the JobRemoved
signal to list 'done' or 'skipped'.
Fixes #21520
Frantisek Sumsal [Tue, 7 Dec 2021 15:08:36 +0000 (16:08 +0100)]
github: mention the systemd-devel ML in the new issue tab
Frantisek Sumsal [Tue, 7 Dec 2021 15:28:48 +0000 (15:28 +0000)]
Merge pull request #21657 from mrc0mmand/codeql-shenanigans
ci: sync the list of CodeQL queries with LGTM
Jan Macku [Thu, 2 Sep 2021 14:50:50 +0000 (16:50 +0200)]
core: Indicate the time when the manager started loading units the last time
Jan Macku [Thu, 2 Sep 2021 14:37:13 +0000 (16:37 +0200)]
core: Add new DBUS properties UnitsReloadStartTimestamp and UnitsLoadTimestampMontonic
Frantisek Sumsal [Tue, 7 Dec 2021 13:57:09 +0000 (14:57 +0100)]
ci: pack-ify our custom CodeQL queries and enable them in Actions
Unlike LGTM, the CodeQL Action requires the custom queries to have their
own qlpack.yml file, so let's provide one.
Frantisek Sumsal [Tue, 7 Dec 2021 11:18:06 +0000 (12:18 +0100)]
ci: run the CodeQL action also when its configuration changes
Just to make sure we didn't break anything.
Frantisek Sumsal [Tue, 7 Dec 2021 11:06:29 +0000 (12:06 +0100)]
ci: sync the list of CodeQL queries with LGTM
Dan Streetman [Fri, 20 Aug 2021 18:44:35 +0000 (14:44 -0400)]
resolve: remove server 'large' level
This removes the DNS_SERVER_FEATURE_LEVEL_LARGE, and sets the EDNS0
advertised max packet size as if always in 'large' mode.
Without this, we always send out EDNS0 opts that limit response sizes
to 512 bytes, thus the remote server will never send anything larger
and will always truncate responses larger than 512 bytes, forcing us
to drop from EDNS0 down to TCP, even though one of the primary benefits
of EDNS0 is larger packet sizes.
Fixes: #20993
Frantisek Sumsal [Tue, 7 Dec 2021 13:14:39 +0000 (14:14 +0100)]
ci: add a missing SPDX header
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 11:58:59 +0000 (12:58 +0100)]
Merge pull request #21264 from medhefgo/boot-lto
sd-boot: LTO support
Yu Watanabe [Mon, 6 Dec 2021 00:47:46 +0000 (09:47 +0900)]
test-network: support the case that the default config files are not installed yet
Yu Watanabe [Mon, 6 Dec 2021 00:03:54 +0000 (09:03 +0900)]
test-network: add test for 6rd
Yu Watanabe [Mon, 6 Dec 2021 00:20:17 +0000 (09:20 +0900)]
man: network: document Use6RD= setting
Yu Watanabe [Sun, 5 Dec 2021 16:35:55 +0000 (01:35 +0900)]
network: dhcp-pd: add 6rd support
Closes #19152.
Yu Watanabe [Sat, 4 Dec 2021 17:40:18 +0000 (02:40 +0900)]
sd-dhcp-client: support 6rd option
Yu Watanabe [Sun, 5 Dec 2021 16:35:44 +0000 (01:35 +0900)]
network: introduce link_remove()
Yu Watanabe [Sat, 4 Dec 2021 22:29:05 +0000 (07:29 +0900)]
network: dhcp-pd: rename [DHCPv6PrefixDelegation] -> [DHCPPrefixDelegation]
This just changes the names of settings, variables, functions, files, and so on.
No functionality is changed.
Preparation for supporting 6rd.
Yu Watanabe [Tue, 7 Dec 2021 11:28:18 +0000 (20:28 +0900)]
Merge pull request #21653 from yuwata/network-dhcp6pd-unreachable-route-cleanups
network: dhcp6pd: cleanups for unreachable route
Yu Watanabe [Tue, 7 Dec 2021 11:21:47 +0000 (20:21 +0900)]
Merge pull request #21655 from yuwata/network-creating-enslaving-netdev-cleanups
network: cleanups for creating or enslaving netdevs
Yu Watanabe [Sun, 5 Dec 2021 12:38:48 +0000 (21:38 +0900)]
network: dhcp6pd: assign addresses in the delegated prefix instead of a subnet prefix /64 on upstream interface
Yu Watanabe [Sun, 5 Dec 2021 16:28:43 +0000 (01:28 +0900)]
network: dhcp6pd: do not check Announce= setting when the link does not support RADV
Yu Watanabe [Tue, 7 Dec 2021 07:07:28 +0000 (16:07 +0900)]
network: fix memleak
Follow-up for
ab106a609bc253c0dc49667e981108110b3a87a5.
Fixes CID#
1467055.
Yu Watanabe [Sun, 5 Dec 2021 12:46:37 +0000 (21:46 +0900)]
network: dhcp6pd: drop link_has_preferred_subnet_id() and inline condition
Yu Watanabe [Sat, 4 Dec 2021 21:57:41 +0000 (06:57 +0900)]
network: dhcp6pd: use the kernel's default value for priority of unreachable route
This should not change any behavior, as both values are equivalent.
Yu Watanabe [Sat, 4 Dec 2021 21:54:03 +0000 (06:54 +0900)]
network: dhcp6pd: always use main route table for unreachable route
This mostly reverts
e47bcb7d0b2cb07c5c594e374baeb061bb7f88ba.
Yu Watanabe [Sat, 4 Dec 2021 19:36:48 +0000 (04:36 +0900)]
network: dhcp6pd: set server address for unreachable route
This is just for json output.
Yu Watanabe [Sat, 4 Dec 2021 21:38:46 +0000 (06:38 +0900)]
network: dhcp6pd: gracefully handle delegated prefix whose prefixlen is larger than 64
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 09:24:44 +0000 (10:24 +0100)]
Merge pull request #20522 from yuwata/cgroup-fix
core/cgroup: fix io.weight and blkio.weight
Evgeny Vereshchagin [Fri, 19 Nov 2021 16:23:03 +0000 (16:23 +0000)]
ci: pin python dependencies and let Dependabot keep track of them
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 07:20:07 +0000 (08:20 +0100)]
Merge pull request #21307 from medhefgo/boot-alloc
sd-boot: Non-failing allocators
Yu Watanabe [Mon, 6 Dec 2021 22:18:29 +0000 (07:18 +0900)]
network/netdev: drop spurious state from the condition to create stacked netdevs
Stacked netdevs are requested when the underlying interface is in
configuring state.
Yu Watanabe [Mon, 6 Dec 2021 20:47:31 +0000 (05:47 +0900)]
network/netdev: create stacked netdevs after all set-link operations are finished
E.g. setting MAC address must be done before creating VLAN interface.
Yu Watanabe [Mon, 6 Dec 2021 20:34:08 +0000 (05:34 +0900)]
network: do not block configuring addresses by creating stacked netdevs
`link_is_ready_to_configure()` is used to judge we can configure
addresses, routes, and etc. And they can be configured independently of
stacked netdevs.
Yu Watanabe [Mon, 6 Dec 2021 20:57:29 +0000 (05:57 +0900)]
network: set MAC address before enslaving to bond or bridge interface
As the master interface may inherit the slave MAC address.
Maciek Borzecki [Tue, 30 Nov 2021 10:07:30 +0000 (11:07 +0100)]
units/systemd-udevd: allow bpf() syscall
Programs run by udev triggers may need to execute the bpf() syscall. Even more
so, since on a cgroup v2 system, the only way to set up device access filtering
is to install a BPF program on the cgroup in question and one way of passing
data to such program is through BPF maps, which can only be access using the
bpf() syscall. One such use case was identified in RHBZ#
2025264 related to
snap-device-helper, and led to RHBZ#
2027627 being filed.
Unfortunately there is no finer grained control over what gets passed in the
syscall, so just enable bpf() and leave fine grained mediation to other
security layers (eg. SELinux).
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=
2027627
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Zbigniew Jędrzejewski-Szmek [Tue, 7 Dec 2021 06:35:34 +0000 (07:35 +0100)]
Merge pull request #21598 from DaanDeMeyer/journald-file
journal: Fix re-enabling COW for archived journal files on BTRFS
Yu Watanabe [Mon, 6 Dec 2021 23:23:27 +0000 (08:23 +0900)]
network,udev: do not adjust local assignment bit of specified MAC address
People often assigns the MAC address of the enslaved interface to e.g.
bridge interface. So, the local assignment bit should not be adjusted.
Fixes #21649.
Yu Watanabe [Tue, 7 Dec 2021 00:51:38 +0000 (09:51 +0900)]
Merge pull request #21642 from yuwata/network-state-file-ignore-dynamic-when-dbus-entry-exists
network: state-file: ignore dynamic entries when specified by DBus method
Luca Boccassi [Tue, 7 Dec 2021 00:14:45 +0000 (00:14 +0000)]
Merge pull request #21646 from mrc0mmand/lgtm-followups
LGTM follow-ups
Luca Boccassi [Tue, 7 Dec 2021 00:14:04 +0000 (00:14 +0000)]
Merge pull request #21639 from yuwata/network-dhcp6pd-use-dhcp6_pd_prefix_acquired
network: dhcp6pd: use dhcp6 pd prefix acquired() and drop dhcp6_pd_distribute_prefix()
Yu Watanabe [Mon, 6 Dec 2021 23:29:34 +0000 (08:29 +0900)]
Merge pull request #21196 from yuwata/process-util-nulstr
process-util: handle double NUL as the end of command line
Franck Bui [Wed, 17 Nov 2021 07:13:04 +0000 (08:13 +0100)]
TEST-10: don't attempt to write a byte to the socket
Writing a byte to test10.socket is actually the root cause of issue #19154:
depending on the timing, it's possible that PID1 closes the socket before socat
(or nc, it doesn't matter which tool is actually used) tries to write that one
byte to the socket. In this case writing to the socket returns EPIPE, which
causes socat to exit(1) and subsequently make the test fail.
Since we're only interested in connecting to the socket and triggering the rate
limit of the socket, this patch removes the parts that write the single byte to
the socket, which should remove the race for good.
Since it shouldn't matter whether the test uses socat or nc, let's switch back
to nc and hence remove the sole user of socat. The exit status of nc is however
ignored because some versions might choke when the socket is closed
unexpectedly.
dependabot[bot] [Mon, 6 Dec 2021 21:17:32 +0000 (21:17 +0000)]
build(deps): bump github/codeql-action from 1.0.24 to 1.0.25
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.24 to 1.0.25.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
e095058bfa09de8070f94e98f5dc059531bc6235...
546b30f35ae5a3db0e0be1843008c2224f71c3b0)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Yu Watanabe [Mon, 6 Dec 2021 17:32:01 +0000 (02:32 +0900)]
network: state-file: do not append dynamic entries when specified by DBus method
Fixes #21515.
Daan De Meyer [Fri, 3 Dec 2021 10:06:36 +0000 (11:06 +0100)]
journal: Fix disabling NO_COW on btrfs filesystems
Disabling NOCOW when data has been written to a file doesn't work.
Instead, when we're done writing to a journal file (after archiving),
let's rewrite the file with COW enabled. This also takes care of
properly defragmenting the file.
With zstd compression level 3, journal files are compressed to 12%
of their original size with default journal settings.
As rewriting the file might take a while since we also do an fsync()
after the rewrite, this work is done in the offline thread to avoid
blocking the journald event loop.
Daan De Meyer [Fri, 3 Dec 2021 10:07:02 +0000 (11:07 +0100)]
basic: Make sure we're extra paranoid in chattr_full
On btrfs, trying to disable FS_NOCOW_FL on a file that has data
already written will fail silently without reporting an error. To
catch such cases, let's query the flags again if the IOC_SETFLAGS
ioctl() succeeds to make sure the flags we tried to configure we're
actually accepted by the kernel.
Daan De Meyer [Wed, 1 Dec 2021 08:34:13 +0000 (09:34 +0100)]
journal: Update the JournalFile path when archiving
When we archive a path, we rename the file to indicate this. However,
until now, we didn't actually update the path member of the corresponding
JournalFile instance. Let's make sure we also update this to avoid
misuse of the old path later on.
This change also requires we save the previous path in journal_file_rotate()
since we need to open a new file at the previous path.
Daan De Meyer [Wed, 1 Dec 2021 08:32:59 +0000 (09:32 +0100)]
mkosi: Add compsize to list of installed packages on Fedora
compsize is useful to check the compression ratio of journal files
on filesystems that support compression such as BTRFS.
Daan De Meyer [Wed, 1 Dec 2021 08:31:00 +0000 (09:31 +0100)]
mkosi: Add e2fsprogs to installed packages for Fedora
lsattr is useful to check chattr flags on files.
Daan De Meyer [Tue, 30 Nov 2021 15:39:35 +0000 (16:39 +0100)]
journal: Move offlining logic to journald-file.c
With this change, the logic to write the final tag, emit the final
change notification and to offline the file moves from journal_file_close()
to journald_file_close(). Since all this logic is only executed when
the journal file is writable and all code that writes journal files
already uses journald_file_close() instead of journal_file_close(), this
change should not introduce any changes in behaviour.
Moving the offline related logic to journald-file.c allows us to use
code from src/shared in the offlining logic, more specifically, we can
use the file copying logic from copy.h to fix BTRFS filesystem compression
for journal files when archiving.
Daan De Meyer [Tue, 30 Nov 2021 15:18:56 +0000 (16:18 +0100)]
journal: Introduce journald-file.c for journal file write related logic
Currently, all the logic related to writing journal files lives in
journal-file.c which is part of libsystemd (sd-journal). Because it's
part of libsystemd, we can't depend on any code from src/shared.
To allow using code from src/shared when writing journal files, let's
gradually move the write related logic from journal-file.c to
journald-file.c in src/journal. This directory is not part of libsystemd
and as such can use code from src/shared.
We can safely remove any journal write related logic from libsystemd as
it's not used by any public APIs in libsystemd.
This commit introduces the new file along with the JournaldFile struct
which wraps an instance of JournalFile. The goal is to gradually move
more functions from journal-file.c and fields from JournalFile to
journald-file.c and JournaldFile respectively.
This commit also modifies all call sites that write journal files to
use JournaldFile instead of JournalFile. All sd-journal tests that
write journal files are moved to src/journal so they can make use of
journald-file.c.
Because the deferred closes logic is only used by journald, we move it
out of journal-file.c as well. In journal_file_open(), we would wait for
any remaining deferred closes for the file we're about to open to complete
before continuing if the file was not newly created. In journald_file_open(),
we call this logic unconditionally since it stands that if a file is newly
created, it can't have any outstanding deferred closes.
No changes in behavior are introduced aside from the earlier execution
of waiting for any deferred closes to complete when opening a new journal
file.
Christian Göttsche [Mon, 6 Dec 2021 15:57:42 +0000 (16:57 +0100)]
core: use correct level for CPU time log message
raise_level() takes the info condition as second argument and the notice
one as third. For the consumed CPU time these conditions are swapped.
Fixes:
37109b856aeb ("pid1: use LOG_DEBUG/INFO/NOTICE for unit resource consumption message")
Zbigniew Jędrzejewski-Szmek [Mon, 6 Dec 2021 19:52:19 +0000 (20:52 +0100)]
Merge pull request #21372 from DaanDeMeyer/journal-truncate
journal-file: truncate archived journals
Yu Watanabe [Mon, 6 Dec 2021 17:54:10 +0000 (02:54 +0900)]
Merge pull request #21638 from yuwata/network-dhcp6pd-prefix-lost
network: dhcp6pd: fix prefix lost handling
Yu Watanabe [Mon, 6 Dec 2021 16:58:35 +0000 (01:58 +0900)]
network: state-file: honor dhcp6_use_domains flag