Yu Watanabe
03b6879f4d
udevadm-test: prettify test results
2024-03-29 12:44:11 +00:00
Yu Watanabe
0966933b3d
unit-def: append trailing comma for the last entry
2024-03-29 13:53:01 +09:00
Yu Watanabe
17f6b64038
core: align table
2024-03-29 13:51:15 +09:00
Yu Watanabe
fee6510667
Merge pull request #31998 from yuwata/udev-event-mode
...
udev: make udevadm test and test-builtin not destructive
2024-03-29 11:31:58 +09:00
Yu Watanabe
089bef6631
udev: make udevadm test and test-builtin not destructive
...
Previously, 'udevadm test' performs not only processing udev rules,
but made several destructive change on the system; updating udev
database, device node permission, devlinks, network interface
properties, and so on.
Similary, 'udevadm test-builtin' may perform something destructive,
especially by 'keyboard', 'kmod', and 'net_setup_link' builtins.
Let's make these commands and test executables not change device
configurations.
2024-03-29 09:33:07 +09:00
Yu Watanabe
adfc608578
Merge pull request #31986 from YHNdnzj/suspend-mem-mode
...
sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep
2024-03-29 09:30:54 +09:00
Yu Watanabe
e4c7dc9418
test: disable IPv6AcceptRA= for test network interfaces with static address
...
This hopefully improves test performance.
2024-03-28 12:37:45 +00:00
Yu Watanabe
ff944339f3
ndisc-option: allow to set valid time of options
...
When an option is delegated from an upstream server, its lifetime
may be limited by a time. Such functionality will be used later by
sd-radv.
This also remove 'offset' argument from the option setter
ndisc_option_set_xyz(), and make it update existing option.
See comments in ndisc_option_add_link_layer_address() for more details.
2024-03-28 12:34:09 +00:00
Yu Watanabe
af41f9f8ad
journalctl-filter: use add_match_boot_id() instead of add_match_this_boot()
...
The function add_match_this_boot() calls sd_journal_add_conjunction(),
hence, we cannot specify multiple devices in the extra match arguments,
e.g., "journalctl /dev/sda /dev/sdb" shows no entry.
2024-03-28 12:28:17 +00:00
Yu Watanabe
a7541703b9
udev-event: split out update_clone()
...
No functional change, preparation for later commits.
2024-03-28 14:49:34 +09:00
Yu Watanabe
2a4fb037cb
Merge pull request #31989 from mrc0mmand/test-loop-dev-check
...
test: check for /dev/loop-control when checking lodev availability
2024-03-28 11:19:32 +09:00
Yu Watanabe
74158eec0e
Merge pull request #31963 from yuwata/journalctl-authenticate-cleanups
...
journalctl-authenticate: several cleanups
2024-03-28 11:19:21 +09:00
Yu Watanabe
bc91875ae5
test-network: add test cases for PersistLeases=no
2024-03-28 11:16:17 +09:00
Yu Watanabe
38b4ecf789
network: make [DHCPServer] in networkd.conf work
...
Follow-up for a3ed665a29 .
Fixes https://github.com/systemd/systemd/pull/31977#discussion_r1542196572 .
2024-03-28 11:15:53 +09:00
Yu Watanabe
1fadd9a357
network: fix typo
...
Follow-up for a3ed665a29 .
2024-03-28 10:38:04 +09:00
Yu Watanabe
5e4aad5e96
Merge pull request #31985 from DaanDeMeyer/mkosi
...
mkosi: Copy built packages to output directory
2024-03-28 10:21:34 +09:00
Yu Watanabe
a128119a1d
timedate: fix typo
...
Follow-up for 3a51e31be9 .
2024-03-28 09:55:11 +09:00
Yu Watanabe
66a0fdcaa5
journalctl-authenticate: return earlier if we are not on a TTY
...
No functional change, just refactoring.
2024-03-28 09:40:34 +09:00
Yu Watanabe
ef277c961f
journalctl-authenticate: use open_tmpfile_linkable() and link_tmpfile()
...
This also
- use path_join(),
- rename variables to more descriptive names.
2024-03-28 09:38:10 +09:00
Yu Watanabe
2dac05e62b
journalctl-authenticate: drop unnecessary safe_close()
...
Follow-up for 7560fffcd2 .
Addresses https://github.com/systemd/systemd/pull/31879#discussion_r1539063239 .
2024-03-28 09:36:29 +09:00
Yu Watanabe
4c56862170
journalctl-authenticate: use is_dir() and refuse symlink for /var/log/journal
...
I am not sure it is explicitly documented that /var/log/journal should
be a directory, rather than a symlink to a directory, but the current
code of journald seems not to support symlinked directory well. Let's
refuse that at least here and now.
2024-03-28 09:36:29 +09:00
Yu Watanabe
a3ed665a29
network/dhcp-server: introduce PersistLeases= setting
...
Requested at https://github.com/systemd/systemd/pull/31772#issuecomment-2000053357 .
2024-03-27 13:21:15 +00:00
Yu Watanabe
95d3570b47
sd-ndisc-router: introduce sd_ndisc_router_set_sender_address()
...
Currently this is not used, but will be used later to modify the sender
address.
2024-03-27 13:13:12 +00:00
Yu Watanabe
9f3587ae44
ndisc-option: add HomeAgent option support
...
Currently, these are not used, but will be used later in sd-radv.
2024-03-27 13:12:30 +00:00
Yu Watanabe
93998559f8
Merge pull request #31789 from jsitnicki/socket-pass-fds-to-exec
...
Pass socket FDs to all ExecXYZ= commands in socket unit but ExecStartPre=
2024-03-27 10:18:13 +09:00
Yu Watanabe
193134de54
home: fix typo
...
Follow-up for 5ec87d577f .
2024-03-27 04:07:51 +09:00
Yu Watanabe
d30d0b04ae
Merge pull request #31951 from bluca/resolve_reload
...
resolved: support reloading configuration at runtime
2024-03-27 02:37:52 +09:00
Yu Watanabe
18640f8211
Merge pull request #31959 from YHNdnzj/execute-pass-fds
...
core/execute: check if EXEC_PASS_FDS is set if got exec_params.fds
2024-03-27 02:37:23 +09:00
Yu Watanabe
5c7292fa80
Merge pull request #31960 from YHNdnzj/capsule-followup
...
Some follow-ups for capsule
2024-03-27 02:34:43 +09:00
Yu Watanabe
0aad30d4b5
logs-show: read the current boot ID if nothing specified for add_match_boot_id()
...
No functional change, just refactoring.
2024-03-26 23:54:46 +09:00
Yu Watanabe
8e976dc920
sd-id128: move get_boot_id_for_machine() to id128-util.c
...
And rename it to id128_get_boot_for_machine().
This also splits out id128_get_boot() from sd_id128_get_boot(), and
make id128_get_boot_for_machine() use it.
2024-03-26 23:54:46 +09:00
Yu Watanabe
96a7f3fc75
journalctl-filter: several cleanups for add_matches()
...
- split it into small pieces to reduce indentation,
- return earlier if no filter specified,
- use journal_add_matchf() and journal_add_match_pair(),
chase_and_stat(), is_symlink(), and sd_device_new_from_devname(),
- replace sd_device_get_devname() + stat() with sd_device_get_devnum(),
- refuse to install filter by path with --root, --image, or --machine
at least now, as previously it has not worked anyway.
2024-03-26 23:51:47 +09:00
Yu Watanabe
bb59f34c21
journalctl-filter: add missing sd_journal_add_conjunction()
...
Otherwise, if --facility= is specified with extra matches with '+',
the facility filter will not be applied to the specified filter after '+'.
2024-03-26 23:51:47 +09:00
Yu Watanabe
22f2b5566d
journalctl-filter: several trivial cleanups
...
- declare iterator in loop,
- use journal_add_match_pair() and journal_add_matchf(),
- log failures in the caller.
2024-03-26 23:51:47 +09:00
Yu Watanabe
5d53eef97b
journalctl-filter: modernize add_units()
...
- add missing assertions,
- use set_ensure_consume() and strv_consume(),
- use string_hash_ops_free and _cleanup_set_free_,
- use strv_fnmatch_full(),
- replace unused counter with a boolean flag,
- return earlier if no unit filtering is requested.
2024-03-26 23:51:46 +09:00
Yu Watanabe
17c512f1cc
Merge pull request #31879 from yuwata/journalctl-split
...
journalctl: split journalctl.c into small pieces
2024-03-26 23:45:20 +09:00
Yu Watanabe
073f438365
ndisc-option: sort options in sent message
...
To make the sent message reproducible.
2024-03-26 13:58:36 +00:00
Yu Watanabe
846efaf532
sd-ndisc-protocol: list up all known options
...
See below for more details:
https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml#icmpv6-parameters-5
2024-03-26 13:53:42 +00:00
Yu Watanabe
2129240447
journalctl-show: split out seek_journal()
...
No functional change, just refactoring.
2024-03-26 22:25:24 +09:00
Yu Watanabe
ade2db83fe
journalctl: split journalctl.c into small pieces
...
And introduces per-action functions.
No functional change, just refactoring.
2024-03-26 22:24:24 +09:00
Yu Watanabe
adc8a60b88
journalctl: use correct type for flags
...
This also moves its declaration, as it is not changed in the loop.
2024-03-26 22:21:13 +09:00
Yu Watanabe
dc586975b2
journalctl: merge three if blocks for seeking to the initial position
...
No functional change, just refactoring.
2024-03-26 22:21:13 +09:00
Yu Watanabe
635a3586d8
Merge pull request #31947 from yuwata/test-recently-fixed-issues
...
Tests for recently fixed issues
2024-03-26 14:56:58 +09:00
Yu Watanabe
857f29a772
test: add test cases for journalctl --facility=/--output=help
...
Follow-up for d44233503f .
2024-03-26 04:18:23 +09:00
Yu Watanabe
cbe884f13a
test: add test cases for systemd-analyze --global
...
Follow-up for ac97053618 .
2024-03-26 04:10:04 +09:00
Yu Watanabe
24578ce63a
ndisc-option: introduce ndisc_option_remove()
2024-03-26 03:30:41 +09:00
Yu Watanabe
697c3693b3
ndisc-option: rename ndisc_option_get() -> ndisc_option_get_by_type()
...
Then, introduce more generic ndisc_option_get().
2024-03-26 03:30:41 +09:00
Yu Watanabe
373452ff9f
Merge pull request #31932 from bluca/coverity
...
Fix coverity issues
2024-03-26 03:04:51 +09:00
Yu Watanabe
0ffcf398e5
Merge pull request #31899 from yuwata/sd-journal-add-match
...
sd-journal: introduce two helpers for adding journal filter
2024-03-26 02:56:58 +09:00
Yu Watanabe
6871b9c638
Merge pull request #31807 from yuwata/sd-ndisc-send
...
sd-ndisc: introduce sd_ndisc_send()
2024-03-26 02:55:33 +09:00
Yu Watanabe
65265b51df
Merge pull request #31938 from YHNdnzj/journalctl-facility
...
journalctl: explicitly check < 0 for error
2024-03-26 02:23:50 +09:00
Yu Watanabe
bcd558f12e
logs-show: use journal_add_matchf() and journal_add_match_pair()
2024-03-25 21:39:37 +09:00
Yu Watanabe
077f63264f
networkctl: use journal_add_matchf() and journal_add_match_pair()
2024-03-25 21:39:37 +09:00
Yu Watanabe
f936ae2120
journal-gateway: use journal_add_match_pair() and add_match_boot_id()
2024-03-25 21:39:37 +09:00
Yu Watanabe
8334b36653
coredumpctl: use strv_skip()
...
No functional change, just refactoring.
2024-03-25 21:39:37 +09:00
Yu Watanabe
5cacb0b645
coredumpctl: use journal_add_match_pair()
...
Also,
- use is_path(),
- drop unused pid.
2024-03-25 21:39:34 +09:00
Yu Watanabe
1aa6af6bcc
Merge pull request #31900 from DaanDeMeyer/dissect
...
nspawn logging fix
2024-03-22 20:07:34 +09:00
Yu Watanabe
e21ad9c136
sd-journal: introduce two helper functions for adding filter
2024-03-22 17:54:13 +09:00
Yu Watanabe
431f2ffbea
Merge pull request #31892 from YHNdnzj/machinectl-minor-cleanup
...
machinectl: minor modernization, use FOREACH_ARRAY
2024-03-22 08:10:39 +09:00
Yu Watanabe
d3aa0af31a
Merge pull request #31890 from YHNdnzj/ASSERT_PTR
...
core: use ASSERT_PTR and RET_GATHER more
2024-03-22 07:57:46 +09:00
Yu Watanabe
ec0bc263d7
Merge pull request #31880 from yuwata/network-varlink-trivial-cleanups
...
network: trivial varlink cleanups
2024-03-21 22:00:52 +09:00
Yu Watanabe
1015742878
varlink: use varlink_server_description()
2024-03-21 19:54:25 +09:00
Yu Watanabe
2858d92914
network: set varlink description
2024-03-21 19:52:31 +09:00
Yu Watanabe
7742d03e8d
networkctl: use varlink_flush_close_unrefp()
2024-03-21 19:45:03 +09:00
Yu Watanabe
839dce5ecb
Merge pull request #31862 from keszybz/add-strdup_to-helper
...
Add strdup_to() helper
2024-03-21 14:47:05 +09:00
Yu Watanabe
e845913fac
Merge pull request #31875 from ml-/docs-fix-socket-section
...
docs: fix keys in wrong section and minor issues in man pages
2024-03-21 12:32:53 +09:00
Yu Watanabe
bf995423fd
test: add test case for issue #31776
2024-03-21 04:44:39 +09:00
Yu Watanabe and Reid Wahl
cb2be36650
journalctl: make --until work again with --after-cursor and --lines
...
Fixes a regression introduced by 81fb5375b3 .
If one of the cursor option is specified, we first seek to the cursor position.
So, the current position may be out of the time range specified by --until,
and we need to verify the timestamp of the current position.
Fixes #31776 .
Co-authored-by: Reid Wahl <nrwahl@protonmail.com >
2024-03-21 04:43:45 +09:00
Yu Watanabe
8810b782a1
test: fix typo
...
Follow-up for 6644445586 .
2024-03-21 03:58:05 +09:00
Yu Watanabe
2e097e4a91
resolve: fix typo
...
Follow-up for ce5b9d5b3c .
2024-03-21 03:56:36 +09:00
Yu Watanabe
2503c377fa
resolve: fix typo
...
Follow-up for 47690634f1 .
2024-03-21 03:55:37 +09:00
Yu Watanabe
1c8e8ec0ff
Revert "test: temporarily adjust the default mount rate limit"
...
This reverts commit 3f4b00a34a425566ca8494846b0e74ca8c7693d3.
The issue #30573 seems to be fixed somehow. Let's revert the workaround.
2024-03-20 15:36:05 +01:00
Yu Watanabe
46325d9324
terminal-util: fix underlying with SYSTEMD_COLORS=no
...
Fixes #31857 .
2024-03-19 22:21:56 +01:00
Yu Watanabe
169b282bf9
Merge pull request #31841 from AdrianVovk/homed-trivial
...
Small homed changes + revert
2024-03-19 17:22:34 +09:00
Yu Watanabe
27e3e6a321
Merge pull request #31772 from yuwata/network-persistent-storage-use-fd
...
network: pass fd of persistent storage, then use ProtectSystem=strict again
2024-03-19 16:37:15 +09:00
Yu Watanabe
a9e7894d38
unit/network: use ProtectSystem=strict again
...
Now, networkd accesses the state directory through the file descriptor
passed from systemd-networkd-persistent-storage.service.
Hence, the networkd itself does not need to access the state directory
through its path, and we can use more stronger mode for ProtectSystem=.
2024-03-19 15:15:32 +09:00
Yu Watanabe
bfd8f70cb8
network/varlink: pass file descriptor of state directory with SetPersistentStorage method
...
The state directory is owned by systemd-networkd-persistent-storage.service,
at least technically. Let's not directly access the storage through the path,
but through the fd.
Addresses https://github.com/systemd/systemd/pull/31746#issuecomment-1993556966 .
Suggested-by: Mike Yuan <me@yhndnzj.com >
2024-03-19 15:15:32 +09:00
Yu Watanabe and Evgeny Vereshchagin
cdb88ae4e5
fuzz: test NDisc packet with more low level functions
...
Also, test send back the test packet.
Co-authored-by: Evgeny Vereshchagin <evvers@ya.ru >
2024-03-18 23:19:44 +09:00
Yu Watanabe
fcfb691fc1
icmp6-packet: expose icmp6_packet_get_header()
2024-03-18 23:18:43 +09:00
Yu Watanabe
d112b4454c
icmp6-util: drop unused icmp6_send_router_solicitation()
2024-03-18 22:52:29 +09:00
Yu Watanabe
349d51e7a1
sd-ndisc: use sd_ndisc_option and ndisc_send()
2024-03-18 22:52:29 +09:00
Yu Watanabe
ca11446217
ndisc-option: introduce ndisc_send()
...
This will be used when sending Router Solicitation and Advertisement.
2024-03-18 22:52:29 +09:00
Yu Watanabe
af0d593b32
ndisc-option: add a way to specify invalid or unsupported options
...
Mostly for testing.
2024-03-18 22:52:29 +09:00
Yu Watanabe
8430c4d91d
test-ndisc-rs: send Router Solicit message before sending test packet
2024-03-18 22:52:29 +09:00
Yu Watanabe
c73f2b7295
test: fix typo
...
Follow-up for fcf38e2cb3 .
2024-03-18 22:48:24 +09:00
Yu Watanabe
93126bb0fa
test-network: extend test case for DHCP server with null server address
2024-03-18 22:33:14 +09:00
Yu Watanabe
7a89aeb138
network/address: acquire address from DHCP server lease file
...
If the DHCP server on an interface is configured with its server
address is null, then let's reuse the previous server address if
possible.
Otherwise, if networkd is restarted or the host is rebooted, then
possibly new subnet is picked, and clients that already have addresses
in the previous subnet cannot access the server.
Prompted by https://github.com/systemd/systemd/pull/30021#discussion_r1518478633 .
2024-03-18 22:33:14 +09:00
Yu Watanabe
7b799b870f
units: use relative path
2024-03-16 05:31:44 +09:00
Yu Watanabe
1716bac658
Merge pull request #31808 from keszybz/sundry-cleanups
...
Sundry cleanups
2024-03-16 01:40:56 +09:00
Yu Watanabe
7eafdbeb00
network/dhcp-server: use the pinned fd of persistent storge
2024-03-16 01:12:05 +09:00
Yu Watanabe
e1254d0616
network/varlink: return earlier from SetPersistentStorage method if nothing changed
2024-03-16 01:12:05 +09:00
Yu Watanabe
013359ac65
network: pin file descriptor of persistent storage
...
This also drop the support of /run/systemd/netif/persistent-storage-ready,
as the file is anyway removed when networkd is stopped.
Let's use $SYSTEMD_NETWORK_PERSISTENT_STORAGE_READY=1 instead on testing.
2024-03-16 01:12:05 +09:00
Yu Watanabe
dbf66cd1ab
network/address: acquire address in address_process_request()
...
Previously, if an [Address] section is configured with a null address,
e.g. Address=0.0.0.0/24, then we acquired a free address in
link_request_address().
With this commit, we queue a request with the null address as is, and
acquire a free address later in address_process_request(). Similary,
now IPv4ACD daemon is configured in address_process_request().
With this change, we can make the address acquisition depend on other
conditions, e.g. if the persistent storage is ready or not.
2024-03-15 14:54:49 +00:00
Yu Watanabe
5ed4c2b944
sd-dhcp-server: also save the server address and netmask to the leases file
...
And introduce a tiny helper to retrieve these information.
The function is not used at this time, but will be used later.
2024-03-15 04:15:10 +09:00
Yu Watanabe
d47f83302e
sd-dhcp-server: rearrange the parser of the leases file
...
No functional changes, just refactoring and preparation for later
commits.
2024-03-15 04:15:10 +09:00
Yu Watanabe
11b88419ae
sd-dhcp-server: make sd_dhcp_server_set_lease_file() optionally take directory fd
...
Currently, though, no valid directory fd is passed to the function call.
Preparation for later commits.
2024-03-15 04:15:10 +09:00
Yu Watanabe
6e0abf5fb3
docs: fix typo
...
Follow-up for 34c6b7d9de .
2024-03-15 04:04:01 +09:00
Yu Watanabe
66c4be596e
ptyfwd: drop redundant brackets
2024-03-15 03:47:26 +09:00
Yu Watanabe
0d1606df0b
ptyfwd: do not erase line after NL
...
Otherwise, moving upwards in 'less' does not work.
Follow-up for d0aa368c85 .
2024-03-15 03:47:04 +09:00
Yu Watanabe
e852f10cb4
kbd-util: allow to override the default keymap directories
...
This introduces $SYSTEMD_KEYMAP_DIRECTORIES environment variable to
override the hardcoded keymap directories.
I think it is not necessary to provide the first class configuration
option for controlling the keymap directories, but it is not good to
hardcode the paths. So, let's introduce an environment variable to
override that.
Prompted by #31759 .
Closes #31759 .
2024-03-15 03:19:45 +09:00