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

55043 Commits

Author SHA1 Message Date
Daan De Meyer
764721cc07 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.
2021-12-06 22:17:40 +01:00
Daan De Meyer
035b0f8fe8 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.
2021-12-06 22:17:38 +01:00
Christian Göttsche
ef6bb4dd3e 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: 37109b856a ("pid1: use LOG_DEBUG/INFO/NOTICE for unit resource consumption message")
2021-12-06 20:55:22 +01:00
Zbigniew Jędrzejewski-Szmek
ea599435a7
Merge pull request #21372 from DaanDeMeyer/journal-truncate
journal-file: truncate archived journals
2021-12-06 20:52:19 +01:00
Yu Watanabe
de1253e4c6
Merge pull request #21638 from yuwata/network-dhcp6pd-prefix-lost
network: dhcp6pd: fix prefix lost handling
2021-12-07 02:54:10 +09:00
Yu Watanabe
2756fb24ee network: state-file: honor dhcp6_use_domains flag 2021-12-07 01:58:35 +09:00
Frantisek Sumsal
33b7988d2e analyze,resolve: suppress a couple of false-positive alerts 2021-12-06 17:45:37 +01:00
Frantisek Sumsal
7fd2b742c9 core: check for NULL in one more place 2021-12-06 17:45:20 +01:00
yangmingtai
5896a9ebdb fix DirectoryNotEmpty when it comes to a Non-directory file 2021-12-07 01:28:07 +09:00
Luca Boccassi
efeecf4010 NEWS: add more entries for v250 2021-12-06 15:58:38 +00:00
Luca Boccassi
11b109223f NEWS: add more entries for v250 2021-12-06 15:29:11 +00:00
Yu Watanabe
aa9de5b1c0 process-util: handle double NUL as the end of command line
Fixes #21186.
2021-12-06 23:42:25 +09:00
Yu Watanabe
95a511b704 process-util: rename function arguments for storing results 2021-12-06 23:21:08 +09:00
Yu Watanabe
2b5587c28f
Merge pull request #21620 from yuwata/udev-path-id
udev/path_id: fix skip_subsystem()
2021-12-06 23:15:43 +09:00
Daan De Meyer
6127ff9870 journal: punch holes in unused parts of entry arrays when archiving
Entry arrays grow exponentially, so when archiving a journal file is
archived, it's very likely that the final entry array objects in each
entry array chain aren't fully used. Let's punch holes in the unused
parts so the filesystem can reclaim this unused space and use it for
something else.
2021-12-06 14:54:06 +01:00
Daan De Meyer
ab6e257b3e journal: truncate archived journals
Journal files have space allocated in 8MiB-aligned increments. This
can add up to substantial wasted space as many archived journals
accumulate without using all the allocated space. Let's truncate
journal files to their actually used size when archiving them to
reclaim this unused space.

As the mmap cache is not thread-safe, we can't call
journal_file_move_to_object() from the offline thread. Instead,
we use journal_file_read_object() which doesn't rely on the mmap
cache.
2021-12-06 14:54:06 +01:00
Daan De Meyer
117e21121e journal: Add journal_file_read_object() 2021-12-06 14:54:06 +01:00
Yu Watanabe
e3a97777ab
Merge pull request #21633 from yuwata/network-route-null-destination
network: route: fix null destination handling
2021-12-06 22:27:37 +09:00
Yu Watanabe
55c3658ba1
Merge pull request #21634 from yuwata/dhcp-header-cleanups
dhcp: trivial header cleanups
2021-12-06 22:26:58 +09:00
Yu Watanabe
416644567b network: dhcp6pd: make dhcp6_pd_assign_prefixes() used also by dhcp6_pd_prefix_acquired() 2021-12-06 21:35:53 +09:00
Yu Watanabe
21cf8e9e6d network: dhcp6pd: first check prefixes, then calculate lifetime 2021-12-06 21:35:53 +09:00
Yu Watanabe
542d04950e network: dhcp6pd: shorten code a bit 2021-12-06 21:35:53 +09:00
Yu Watanabe
c3cd535132 network: dhcp6pd: skip to assign prefixes to a downstream link if it is not ready 2021-12-06 21:35:53 +09:00
Yu Watanabe
5014e66019 network: dhcp6pd: move dhcp6_pd_assign_prefixes()
Preparation for the later commits.
2021-12-06 21:35:53 +09:00
Yu Watanabe
4c004e2a71 network: dhcp6pd: also allow to only assign prefix route for delegated prefix to upstream interface 2021-12-06 21:35:53 +09:00
Yu Watanabe
da10d2d584 network: dhcp6pd: drop unreachable routes when lease lost 2021-12-06 21:30:57 +09:00
Yu Watanabe
95eb38c8d0 network: route: make route_cancel_request() take Link*
As the Route object may be managed by Manager.
2021-12-06 21:30:57 +09:00
Yu Watanabe
1d44187ce6 network: dhcp6pd: also drop prefix assigned to upstream interface
But do not drop prefixes from downstream which request another uplink.
2021-12-06 21:30:26 +09:00
Yu Watanabe
86a4b84aa9
Merge pull request #21632 from yuwata/network-dhcp6pd-fix-typo-and-split
network: dhcp6pd: fix typo and split file
2021-12-06 21:24:47 +09:00
Yu Watanabe
24888c0b19
Merge pull request #21630 from yuwata/test-network-cleanups
test-network: trivial cleanups
2021-12-06 21:24:26 +09:00
Yu Watanabe
ab106a609b network: eui64 address is supported only ethernet or infiniband
So, this makes prefixstable mode will be used for other interface types.
2021-12-06 21:07:12 +09:00
Zbigniew Jędrzejewski-Szmek
ec1574cd8e
Merge pull request #21454 from bluca/inspect_elf
analyze: add inspect-elf verb to parse package metadata
2021-12-06 12:45:25 +01:00
Pavel Březina
2f121b6fa1 man: fix description of sd_uid_get_sessions 2021-12-06 12:39:03 +01:00
Franck Bui
d5ee050ffc journal: don't remove the flushed flag when journald is stopped
Due to the fact that systemd-journal-flush.service has
"Requires=systemd-journald.service", this service is stopped too when journald
is requested to do so.

However stopping systemd-journal-flush.service implies that journald
relinquishes /var hence implicitly switching back to the volatile storage
mode and removing /run/systemd/journal/flushed.

If journald is started afterwards, it will run in volatile storage mode
regardless of the value of 'Storage=' as it believes now that /var is not yet
ready (because the flushed flag is missing).

Because this flag is mainly an indication for journald that the initialization
of /var/log/journal (during the boot process) has been done,
systemd-journal-flush.service shouldn't be tied to the state of journald itself
but to the state of /var/log/journal, hence to the state of the system.
2021-12-06 11:47:27 +01:00
Joris Hartog
5ef599b324 systemctl: support JSON output for "show-environment"
This commit adds a function which converts a bus message containing the
environment variables to a JSON object and uses this function to support
JSON formatted output for the "systemctl show-environment" command.

Fixes #21348
2021-12-06 11:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
dfaf3ec1bf
Merge pull request #21621 from mrc0mmand/lgtm-false-positive
lgtm: ignore certain cleanup functions
2021-12-06 11:31:38 +01:00
Bastien Nocera
213455e26a hwdb: Allow console users access to rfkill
This rule has been shipped in Fedora's gnome-bluetooth package for 10
years and is used by the gnome-settings-daemon rfkill plugin (used by
gnome-bluetooth, gnome-shell, and gnome-control-center) to monitor
and change software rfkill switch settings.
2021-12-06 11:26:29 +01:00
Urs Ritzmann
25060a570c sd_bus_get_timeout: fix timeout value doc
The documentation of sd_bus_get_timeout wrongfully states that the returned time-value is relative. In fact, it is an absolute value which is based of CLOCK_MONOTONIC. This change corrects that documentation.
2021-12-06 11:21:48 +01:00
Yu Watanabe
133f65ef2c test-network: start dhcpd after address is assigned 2021-12-06 19:18:55 +09:00
Yu Watanabe
5f7f1f824f test-network: make start_isc_dhcpd() take IP version 2021-12-06 19:18:55 +09:00
Yu Watanabe
d5ebcf6533 network: split networkd-dhcp6.c
This moves DHCPv6 prefix delegation related functions to
networkd-dhcp-prefix-delegation.c.
2021-12-06 19:17:09 +09:00
Yu Watanabe
ba466f0d4e network: dhcp6pd: fix copy-and-paste error 2021-12-06 19:17:09 +09:00
Yu Watanabe
cf477495d6 network: route: handle null address with non-zero prefixlen correctly
Previously, even if a link has a route to e.g. ::/96, default gateway
via ::1.2.3.4 cannot be configured.
2021-12-06 19:16:17 +09:00
Yu Watanabe
b489d6a26e network: route: logs null address with non-zero prefixlen correctly 2021-12-06 19:16:17 +09:00
Yu Watanabe
85ede495cc dhcp: fix indentation and alignment 2021-12-06 19:15:42 +09:00
Yu Watanabe
d262928879 dhcp6: drop unnecessary space 2021-12-06 19:15:41 +09:00
Zbigniew Jędrzejewski-Szmek
79fa910333
Merge pull request #21623 from nabijaczleweli/ekstrahuje
man/kernel-install clarifications
2021-12-06 11:10:40 +01:00
Zbigniew Jędrzejewski-Szmek
ea7c87bfd9
Merge pull request #21629 from yuwata/man-netdev-update
man: netdev: several cleanups
2021-12-06 10:23:04 +01:00
Yu Watanabe
ee44b32ff4 man: netdev: merge and reword Egress/IngressQOSMAps= 2021-12-06 17:59:35 +09:00
Zbigniew Jędrzejewski-Szmek
8fc2648454
Merge pull request #21628 from yuwata/man-network-dnssec
man: network: fix default values for DNSSEC= and DNSOverTLS=
2021-12-06 08:54:43 +01:00