Commit Graph
3693 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek c38e4e2fda Merge pull request #29721 from poettering/systemd-project
New capsule@.service feature
2024-03-26 13:19:33 +01:00
Yu Watanabe e21ad9c136 sd-journal: introduce two helper functions for adding filter 2024-03-22 17:54:13 +09:00
Zbigniew Jędrzejewski-Szmek 8f6ea3e827 sd-journal/catalog: use strdup_to(), rename output param 2024-03-20 15:18:21 +01:00
Zbigniew Jędrzejewski-Szmek bca4dc29df sd-device: use strdup_to() and rename output param
device_open_from_devnum() returns two things: the devname via
an output param, and the fd via the return value. Rename the param
to signal that it's not the only return channel.
2024-03-20 15:18:21 +01:00
Lennart Poettering fc772c61e8 sd-bus: add ability to connect to bus as a specific user 2024-03-14 11:34:04 +01:00
Mike Yuan 32104d3251 sd-journal: introduce sd_journal_stream_fd_with_namespace 2024-03-14 14:25:52 +08:00
Mike Yuan 2a11593178 journal-send: introduce journal_stream_path helper 2024-03-14 14:25:52 +08:00
Mike Yuan baaca3db6a path-util: introduce skip_leading_slash and use it where appropriate 2024-03-14 14:25:52 +08:00
Luca Boccassi 5e418fe32a Merge pull request #31590 from YHNdnzj/install-cleanup
shared/install: several cleanups
2024-03-07 11:28:04 +00:00
SidhuRupinderandFrantisek Sumsal 6ad20da18a Update catalog.c - Removing sanity check as there is no need of checking non null pointer (#31653)
There is no need to check the pointer as the pointer will never be NULL.

Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
2024-03-07 10:31:59 +09:00
Mike Yuan 7dfc71399d path-lookup: rename lookup_paths_free -> _done
This is stack-allocated, so update to match our usual rules.
2024-03-07 02:01:57 +08:00
Daan De Meyer 1ec5c1409e Merge pull request #31550 from teknoraver/dlopen_compress
Dynamically load compression libraries
2024-03-05 20:16:19 +01:00
Yu Watanabe 21fdecdc13 sd-netlink: allow to call rtnl_get_link_info() without iftype and flags 2024-03-05 12:19:47 +00:00
Matteo Croce 3fc72d5413 dynamically load compression libraries
Dynamically load liblz4, libzstd and liblzma with dlopen().
This helps to reduce the size of the initrd image when these libraries
are not really needed.
2024-03-05 12:37:21 +01:00
Lennart Poettering 0068131bf5 Merge pull request #31507 from poettering/import-modernize
importd: various modernizations
2024-03-01 23:42:32 +01:00
Lennart Poettering 171ddae1a1 hostnamed: add explicit BUS_ERROR_NO_HARDWARE_SERIAL error
For the very similar case of the product UUID we have its own error
BUS_ERROR_NO_PRODUCT_UUID if we have no UUID. Let's mirror this for the
hardware serial, and expose the same, to keep things nicely symmteric.
2024-03-01 22:37:38 +01:00
Lennart Poettering 7253eaa0fb sd-event: make return code of sd_event_get_exit_code() optional 2024-03-01 22:25:42 +01:00
Lennart Poettering efb9b3bab2 env-util: rename getenv_bool_secure() → secure_getenv_bool()
The glibc API is behind the wrapper is called "secure_getenv()", hence
our wrapper really should keep the order too, otherwise things are just
too confusing.
2024-02-28 15:38:00 +01:00
Lennart Poettering db7136ec73 signal-util: imply sentinel -1 in sigprocmask_many() + sigset_add_many() args list 2024-02-23 09:35:12 -08:00
Susant Sahani 9adafeddac netdev/macvlan: allow to set the broadcast queueing threshold
Allow to set the broadcast queueing threshold
on macvlan devices. This controls which multicast packets will be
processed in a workqueue instead of inline.
2024-02-22 09:36:19 +09:00
Yu Watanabe e21dd22040 Merge pull request #31338 from ssahani/network-bond-missed
network: netdev - bond add support for ARP missed max
2024-02-17 06:16:42 +09:00
Luca Boccassi 5ea0da03d4 Merge pull request #31311 from yuwata/journal-user-corruption
journal: fix user journal corruption on rotation
2024-02-16 12:07:50 +00:00
Lennart Poettering f03e8f19b7 Merge pull request #30263 from msizanoen1/fix-onboot-rotate-2
journal: Reset runtime seqnum data when flushing to system journal
2024-02-16 12:02:09 +01:00
Susant Sahani b33bba0434 network: netdev - bond add support for ARP missed max
Allows to configure bond arp_missed_max is the maximum number of arp_interval monitor cycle
for missed ARP replies. If this number is exceeded, link is reported as
down.
2024-02-16 14:44:51 +05:30
Yu Watanabe cb0d5f73e6 sd-journal: use stat_verify_linked() 2024-02-16 03:48:18 +09:00
Yu Watanabe e40b11be04 fs-util: rename xopenat() -> xopanat_full() 2024-02-16 00:25:37 +09:00
Yu Watanabe a9c2e0f426 sd-journal: fix potential memory leak
Though, hopefully, the memory leak is hypothetical, as we always close
journal file with the timer by journal_file_offline_close().
2024-02-15 09:50:18 +09:00
Yu Watanabe 36c6b26c37 sd-journal: use -EBADF for journal_file_open() 2024-02-15 09:50:18 +09:00
Yu Watanabe 3f6c529cde sd-journal: shorten code a bit 2024-02-15 09:50:18 +09:00
Lennart Poettering 336b1f1936 homed: add a ActivateHomeIfReferenced() bus call
This is very similar to ActivateHome() but will fail if the home
directory is not referenced yet. Or in other words, this doesn't add any
new reference, but simply is the other side of RefUnrestricted(): if we
allowed a home dir to be referenced without it actually being active,
then this can catch up with things and activated what was previously
referenced already.

This also relaxes access rights to that users can always activate their
own home dirs. This is useful once we allow user code to run without the
home dir being activated.
2024-02-14 15:04:15 +01:00
Yu Watanabe d1cde7f051 sd-journal: drop unused function prototype
Follow-up for 8b4fbbb0a1.

The function was renamed and moved by
035b0f8fe8.
Maybe the prototype is mistakenly re-introduced on rebase.
2024-02-14 09:31:13 +01:00
Adrian Vovk 80d07162e7 format-utils: Expose FORMAT_UID and FORMAT_GID
This pulls this generally useful helper out of sysusers and into the
util lib, and updates the places throughout the codebase where it makes
sense to use it.
2024-02-14 09:14:13 +01:00
Lennart Poettering c9cdbaed17 Merge pull request #30380 from keszybz/tmpfiles-dry-run
Make tmpfiles/sysusers nicer with local files and implement tmpfiles --dry-run
2024-02-13 09:45:50 +01:00
Yu WatanabeandCosta Tsaousis cb2b0326ee sd-journal: drop to use Hashmap to manage journal files per boot ID
As reported at https://github.com/systemd/systemd/pull/30209#issuecomment-1831344431,
using hashmap in frequently called function reduces performance.
Let's replace it with a single array and bsearch.

Replaces #29366.

Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
2024-02-12 02:42:36 +09:00
Yu WatanabeandCosta Tsaousis f7f062bf9f tree-wide: set SD_JOURNAL_ASSUME_IMMUTABLE where appropriate
Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
2024-02-12 02:42:36 +09:00
Yu WatanabeandCosta Tsaousis bd1af1d5fb sd-journal: introduce SD_JOURNAL_ASSUME_IMMUTABLE flag
The flag can be used when it is not necessary to follow journal file
update.

Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
2024-02-12 02:41:28 +09:00
Yu Watanabe 51b2bcf835 sd-journal: make journal_file_read_tail_timestamp() notify to the caller that some new journal entries added
Tiny optimization for journal_file_find_newest_for_boot_id().
2024-02-12 01:27:50 +09:00
Yu Watanabe 99e6f682d3 sd-journal: cache last entry offset and journal file state
When the offset of the last entry object (or last object for journal
files generated by an old journald) is not changed, the timestamps
should be updated by journal_file_read_tail_timestamp() are unchanged.
So, we can drop to call fstat() in the function.

As, the journal header is always mapped, so we can read the offset and
journal file state without calling fstat.
Still, when the last entry offset is changed, we may need to call fstat()
to read the entry object. But, hopefully the number of fstat() call
can be reduced.
2024-02-12 01:23:16 +09:00
Zbigniew Jędrzejewski-Szmek f7862b2a00 tree-wide: use normal spelling of "reopen"
It's a commonly used verb meaning "to open again".
2024-02-09 17:57:41 +01:00
Yu Watanabe 07ae001f81 test: add tests for journal_file_next_entry() 2024-02-10 00:30:04 +09:00
Yu Watanabe 6c4ea35962 sd-journal: do not read unnecessary object
In journal_file_next_entry(), if the passed offset matches an entry object,
then generic_array_bisect() returns the object, but the object we
requested is the next (or previous) object. Hence, we should not validate
the object returned by generic_array_bisect(), otherwise it may fail
when the journal is corrupted.

Note the validity of the entry object that should be returned by
journal_file_next_entry() will be checked in the following generic_array_get().
So, when journal_file_next_entry() succeeds, the returned object is
always validated.
2024-02-10 00:29:16 +09:00
Yu Watanabe 1b4e322cdb sd-journal: always put verified object into the chain cache
Let's consider the case that
- the first array contains valid entries,
- all entries in the second array are corrupted.

Then, when we are going to upwards, and a call of generic_array_bisect()
matches the last entry of the first array, then the second array was
cached with last_index == UINT64_MAX, instead of the first array with
its last entry.
Hence, when generic_array_bisect() is called next time, the function call
of test() always fail. So, the cache entry is mostly meaningless.

Let's always store valid cache entry.
2024-02-10 00:26:17 +09:00
Yu Watanabe 821d55a8d7 sd-journal: drop duplicated tests in generic_array_bisect()
When left == right (== 0), generic_array_bisec_step() does not update
left and right. So the following test is exactly the same.
2024-02-10 00:26:17 +09:00
Yu Watanabe 1e869a5de9 network: make Reload bus method synchronous
Prompted by https://github.com/systemd/systemd/pull/30085#discussion_r1401534107.

Note, like Reconfigure bus method, even reconfiguration for an interface is
triggered by Reload method, the method only wait for the link enters
configuring state (or unmanaged state if no matching .network file exists).
Users still need to invoke systemd-networkd-wait-online if it is
necessary to wait for the interface enters configured state after Reload
medhod.
2024-02-09 14:25:54 +09:00
Mike Yuan b409aacb0a mountpoint-util: introduce path_is_mount_point_full 2024-02-06 15:09:28 +08:00
Yu Watanabe 35dab29d58 sd-bus: fix typo
Follow-up for 25fd5343ca.
2024-02-02 09:22:43 +09:00
Yu Watanabe 431042e901 sd-bus: fix typo
Follow-up for 71be64064c.
2024-02-02 09:21:18 +09:00
Lennart Poettering 4d8f4e02ba Merge pull request #31109 from yuwata/nspawn-resolve-network-interface-before-move
nspawn: resolve network interface names before move to container namespace
2024-01-30 17:09:11 +01:00
Yu Watanabe 3652891c39 sd-device: use new interface name resolvers 2024-01-30 20:37:13 +09:00
Yu Watanabe 4e235561d6 sd-netlink: unify network interface name getter and resolvers
This makes rtnl_resolve_interface() always check the existence of the
resolved interface, which previously did not when a decimal formatted
ifindex is provided, e.g. "1" or "42".
2024-01-30 20:37:04 +09:00