Yu Watanabe
2f96a29c2c
wait-online: request that at least one managed online interface exists
...
Fixes a regression caused by ab3aed4a03 .
I thought the commit does not cause any severe regression. However,
drivers for network interfaces may be loaded later. So, we should wait
if no network interface is found.
Fixes #27822 .
2023-05-31 22:12:03 +02:00
Yu Watanabe
7b975e9f45
basic/syscall: update syscall list
...
Only notable change is that memfd_secret is now defined on s390(x).
2023-05-29 06:59:10 +08:00
Yu Watanabe
80ec3db5c7
journalctl: fix --follow with non-matching filter
...
When there is no matching entry stored in journal, then initial call of
`sd_journal_previous()` following `sd_journal_seek_tail()` returns
zero, and does not move the read pointer.
In the main loop, on every journal event, we call `sd_journal_next()`,
even though the current location is tail, and it takes no effect.
In such a case, we need to call `sd_journal_previous()` instead of
`sd_journal_next()`.
2023-05-28 23:53:58 +09:00
Yu Watanabe
b78f9481bc
sd-journal: introduce sd_journal_step_one()
...
After the commit 7a4ee86161 ,
sd_journal_next() following sd_journal_seek_tail() takes no-op,
and we need to call sd_journal_previous(). This may be useful in
some cases, e.g. to fix the issue explained in the previous commit.
2023-05-28 23:53:18 +09:00
Yu Watanabe
fb35feae97
test: add testcase for 'journalctl --follow --cursor-file='
...
Also, add a FIXME comment to illustrate the issue uncovered after by
7a4ee86161 .
2023-05-28 14:52:32 +09:00
Yu Watanabe
24d633e438
journalctl: also update cursor with --follow
...
Fixes #26746 .
2023-05-28 14:52:32 +09:00
Yu Watanabe
713342d9b0
journalctl: replace ppoll() loop with sd_event_loop()
...
No functional change, just refactoring.
2023-05-28 14:52:32 +09:00
Yu Watanabe
e4c4a9db87
journalctl: split out show()
...
No functional changes, just refactoring.
2023-05-28 14:52:32 +09:00
Yu Watanabe
8c12d3586a
journalctl: split out update_cursor()
...
No functional change, just refactoring.
2023-05-28 14:52:32 +09:00
Yu Watanabe
2ce9a07b34
journalctl: split out action_list_fields()
...
No functional change, just refactoring.
2023-05-28 14:52:32 +09:00
Yu Watanabe
3f2203f64d
journalctl: fix --no-tail handling
...
Fixes a bug introduced by 62f21ec91a .
2023-05-28 14:52:32 +09:00
Yu Watanabe
20e933ae74
journalctl: use correct variable to check if --since is specified
2023-05-28 14:52:32 +09:00
Yu Watanabe
4f0165fd34
journalctl: always initialize global variables
...
That's not necessary, as they are initialized with zero, but for safety
and readability.
2023-05-28 14:52:32 +09:00
Yu Watanabe
9e39cb2855
Merge pull request #27721 from yuwata/journalctl-cleanup
...
journalctl: split get_boots() into three
2023-05-27 07:59:22 +09:00
Yu Watanabe
e44f06065b
journalctl: split get_boots() into three
...
Previously, get_boots() used for three ways; finding boot entry by
boot ID, finding boot entry by offset, listing up all boot IDs.
Let's split it into three for each usecase.
No functional change, just refactoring.
2023-05-27 03:57:39 +09:00
Yu Watanabe
c93d3c0512
logs-show: introduce add_match_boot_id() helper function
2023-05-27 03:57:01 +09:00
Yu Watanabe
d4fd160f69
Merge pull request #27786 from YHNdnzj/format-timestamp-monotonic
...
time-util,format-table: add relative_monotonic variant for timestamp
2023-05-27 03:05:34 +09:00
Yu Watanabe
f254238204
Merge pull request #27803 from mrc0mmand/even-more-nalloc-shenanigans
...
A couple more fixes for potential OOM-related issues
2023-05-27 02:58:32 +09:00
Yu Watanabe
998db5871f
udev: introduce .PART_SUFFIX internal property
...
To make unify rules for disk and partition.
2023-05-26 16:38:09 +02:00
Yu Watanabe
831108245e
core/unit: update bidirectional dependency simultaneously
...
Previously, if unit_add_dependency_hashmap() failed, then a
one-directional unit dependency reference might be created, and
triggeres use-after-free. See issue #27742 for more details.
This makes unit dependency always bidirectional, and cleanly revert
partial update on failure.
Fixes #27742 .
2023-05-26 15:24:09 +09:00
Yu Watanabe
83123a4498
core/unit: search shared namespace in transitive relation of JoinsNamespaceOf=
...
Previously, dependency chain of JoinsNamespaceOf= did not work, e.g.
- a.service has JoinsNamespaceOf=b.service
- b.service has JoinsNamespaceOf=c.service
if, first c.service, next a.service, finally b.service is started,
then a.service is not joined to the namespace of c.service. And, as
mentioned in the document, the namespace used by b.service is not
deterministic.
This makes when searching exsiting namespace to be joined, all units in
the transitive dependency of JoinsNamespaceOf= are checked.
2023-05-26 15:23:57 +09:00
Yu Watanabe
a60f96fcf5
core/unit: make JoinsNamespaceOf= implies the inverse dependency
...
Previously, even if a.service has JoinsNamespaceOf=b.service, the
inverse direction of reference was not introduced.
Hence, a.service is started earlier than b.service, the namespace will
not shared with b.service.
Also, even if a.service had the reference to b.service, b.service did not.
If b.service is freed earlier, then unit_clear_dependencies() does not clear
the reference from a to b, and will cause use-after-free on unit_free() for
a.service.
Let's make JoinsNamespaceOf=b.service in a.service implies the inverse
dependency, i.e. JoinsNamespaceOf=a.service for b.service. Then, we can safely
free b.service.
2023-05-26 11:50:08 +09:00
Yu Watanabe
512df9de23
core/unit: drop doubled empty line
2023-05-26 11:50:08 +09:00
Yu Watanabe
8493a82d0b
test: add tests for JoinsNamespaceOf=
...
To illustrate the current behavior of the dependency.
2023-05-26 11:50:05 +09:00
Yu Watanabe
cd8910f053
Merge pull request #27770 from mrc0mmand/more-nallocfuzz-shenanigans
...
A couple of fixes for potential issues during OOM situations
2023-05-25 17:15:37 +09:00
Yu Watanabe
9e7b922c8f
Merge pull request #27769 from YHNdnzj/loginctl-followup
...
loginctl: some follow-ups
2023-05-25 05:52:06 +09:00
Yu Watanabe
1f74369c2e
Merge pull request #27723 from YHNdnzj/service-restart-cleanup
...
core: get rid of unused Service.will_auto_restart logic
2023-05-25 05:14:52 +09:00
Yu Watanabe
290c4a4b34
Merge pull request #27173 from yuwata/update-utmp
...
update-utmp: do not fail when PID1 is reexecuting
2023-05-25 04:00:58 +09:00
Yu Watanabe
65d9bd5626
Merge pull request #27773 from dtardon/timestamp-cleanup
...
Use *timestamp_is_set() at more places
2023-05-25 03:27:15 +09:00
Yu Watanabe
3aa53842fd
Merge pull request #27774 from dtardon/free-cleanup
...
Use free_and_*() more
2023-05-25 03:06:51 +09:00
Yu Watanabe
d689f70a2c
test: add test case for systemd-update-utmp vs daemon-reexec
2023-05-24 20:06:10 +09:00
Yu Watanabe
08bc702b12
test: drop a workaround
...
Follow-up for 61961e693d .
2023-05-24 20:06:10 +09:00
Yu Watanabe
fcb2343175
update-utmp: reconnect after sleep when PID1 is reexecuting
...
Fixes #27167 .
2023-05-24 20:06:10 +09:00
Yu Watanabe
87ae54533c
update-utmp: update log message
2023-05-24 20:06:10 +09:00
Yu Watanabe
86da32ee0c
update-utmp: downgrade log level of ignored failure
2023-05-24 20:06:10 +09:00
Yu Watanabe
4c40ab203c
update-utmp: swap q <-> r
...
We usually use 'r' for general purpose.
No functional change, just refactoring.
2023-05-24 20:06:10 +09:00
Yu Watanabe
3950d8f693
update-utmp: modernize get_startup_monotonic_time()
...
This also downgrade error level, as the failure will be ignored.
No functional change, just refactoring.
2023-05-24 20:06:07 +09:00
Yu Watanabe
309491e4cf
update-utmp: rebreak comments
2023-05-24 20:04:33 +09:00
Yu Watanabe
230f663e3e
update-utmp: use verbs
...
No functional change, just refactoring.
2023-05-24 20:04:33 +09:00
Yu Watanabe
5f1f05b961
Merge pull request #27740 from dtardon/list-sessions-idle
...
Show idle status in `loginctl list-sessions`
2023-05-24 20:03:39 +09:00
Yu Watanabe
8ddc5f7699
Merge pull request #27757 from dtardon/bus-locator
...
Convert more DBus calls to BusLocator
2023-05-24 20:02:57 +09:00
Yu Watanabe
5c4e96c28c
test: rotate journal before storing coredumps
...
Hopefully fixes the failure like
https://jenkins-systemd.apps.ocp.cloud.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/2558/
---
[ 66.708894] testsuite-74.sh[728]: + coredumpctl --json=off
[ 66.709344] testsuite-74.sh[826]: TIME PID UID GID SIG COREFILE EXE SIZE
[ 66.709773] testsuite-74.sh[826]: Tue 2023-05-23 22:10:17 UTC 739 0 0 SIGTRAP journal /tmp/test-dump -
[ 66.711134] testsuite-74.sh[826]: Tue 2023-05-23 22:10:18 UTC 747 0 0 SIGABRT journal /tmp/test-dump -
[ 66.711789] testsuite-74.sh[826]: Tue 2023-05-23 22:10:19 UTC 763 0 0 SIGTRAP present /tmp/test-dump 53.5K
[ 66.712460] testsuite-74.sh[826]: Tue 2023-05-23 22:10:20 UTC 776 0 0 SIGABRT present /tmp/test-dump 53.3K
[ 66.713505] testsuite-74.sh[728]: + coredumpctl --root=/
[ 66.714144] testsuite-74.sh[828]: TIME PID UID GID SIG COREFILE EXE SIZE
[ 66.714535] testsuite-74.sh[828]: Tue 2023-05-23 22:10:17 UTC 739 0 0 SIGTRAP journal /tmp/test-dump -
[ 66.715208] testsuite-74.sh[828]: Tue 2023-05-23 22:10:18 UTC 747 0 0 SIGABRT journal /tmp/test-dump -
[ 66.715907] testsuite-74.sh[828]: Tue 2023-05-23 22:10:19 UTC 763 0 0 SIGTRAP present /tmp/test-dump 53.5K
[ 66.716565] testsuite-74.sh[828]: Tue 2023-05-23 22:10:20 UTC 776 0 0 SIGABRT present /tmp/test-dump 53.3K
[ 66.717494] testsuite-74.sh[728]: + coredumpctl --directory=/var/log/journal
[ 66.718188] testsuite-74.sh[830]: TIME PID UID GID SIG COREFILE EXE SIZE
[ 66.882072] testsuite-74.sh[830]: Tue 2023-05-23 22:10:17 UTC 739 0 0 SIGTRAP journal /tmp/test-dump -
[ 66.882642] testsuite-74.sh[830]: Tue 2023-05-23 22:10:18 UTC 747 0 0 SIGABRT journal /tmp/test-dump -
[ 66.883450] testsuite-74.sh[830]: Tue 2023-05-23 22:10:19 UTC 763 0 0 SIGTRAP present /tmp/test-dump 53.5K
[ 66.883944] testsuite-74.sh[830]: Tue 2023-05-23 22:10:20 UTC 776 0 0 SIGABRT present /tmp/test-dump 53.3K
[ 66.885448] testsuite-74.sh[728]: + coredumpctl --file=/var/log/journal/2e1ed84be19a4e22adfc99ad849be1f6/system.journal
[ 66.885989] testsuite-74.sh[728]: + at_exit
[ 66.894162] coredumpctl[833]: No coredumps found.
---
2023-05-24 09:22:13 +02:00
Yu Watanabe
73d24e45f8
test-network: add tests for vlan QoS mapping
2023-05-24 11:15:44 +09:00
Yu Watanabe
4194478af8
network/vlan: paranoia about type safety
...
No functional change, as the struct is defined as the following:
```
struct ifla_vlan_qos_mapping {
__u32 from;
__u32 to;
};
```
2023-05-24 11:06:43 +09:00
Yu Watanabe
4d13d175f8
network/vlan: drop unnecessary restriction for QoS mapping
...
Fixes #27460 .
2023-05-24 11:02:39 +09:00
Yu Watanabe
5dc0c21b31
core/slice: shorten code a bit
2023-05-24 10:26:21 +09:00
Yu Watanabe
93ec924c41
test: add test cases for defining mount and swap units from kernel cmdline
2023-05-24 08:23:22 +09:00
Yu Watanabe
55365b0a23
fstab-generator: support defining mount units through kernel command line
...
Now, the following kernel command line options are supported:
systemd.mount-extra=what:where:fstype:options
systemd.swap-extra=what:options
Closes #27260 .
2023-05-24 08:23:22 +09:00
Yu Watanabe
2646f18445
fstab-generator: fix error code propagation in run_generator()
...
Previously, some errors might be ignored.
2023-05-24 08:23:22 +09:00
Yu Watanabe
6742eca134
fstab-generator: refuse invalid mount point path in fstab earlier
2023-05-24 08:23:22 +09:00
Yu Watanabe
9445623363
fstab-generator: refuse to add swap earlier if disabled
...
No functional change, preparation for later commits.
2023-05-24 08:23:22 +09:00
Yu Watanabe
256604ccdd
fstab-generator: call add_swap() earlier
...
As 'where' field will be ignored for swap entry.
2023-05-24 08:23:22 +09:00
Yu Watanabe
cfeb4d378e
fstab-generator: split out several functions from parse_fstab()
...
No functional changes, just refactoring and preparation for later
commits.
2023-05-24 08:23:22 +09:00
Yu Watanabe
82c29dbee0
test-fstab-generator: add tests for mount options
2023-05-24 08:23:22 +09:00
Yu Watanabe
70bf9f62b9
test-fstab-generator: also check file contents
...
Since e683878c0f , only filenames are
checked. Let's check contents of generated unit files.
2023-05-24 08:23:22 +09:00
Yu Watanabe
a484320572
Merge pull request #27755 from keszybz/fix-root-resize-new
...
Reload keymap and locale config after firstboot writes it out
2023-05-24 06:08:54 +09:00
Yu Watanabe
dd57168144
Merge pull request #27754 from poettering/cloexec-fdset-madness
...
pid1: when taking possession of passed fds check O_CLOEXEC state first
2023-05-24 06:08:17 +09:00
Yu Watanabe
26a9dd6f55
sd-bus: refuse to send messages with an invalid string
...
Prompted by aaf7b0e411 and
4804da5853 .
2023-05-23 19:14:21 +08:00
Yu Watanabe
4539bb3b4b
Merge pull request #27733 from mrc0mmand/more-test-followups
...
test: a couple of follow-ups
2023-05-23 05:02:36 +09:00
Yu Watanabe
6554f56361
wait-online: downgrade log level of failure that interface is removed or unmanaged during processing it
...
Closing #27145 .
2023-05-22 19:06:06 +09:00
Yu Watanabe
e7432ed7ca
Merge pull request #27726 from yuwata/network-wireguard-doc
...
network: update doc
2023-05-22 16:46:38 +09:00
Yu Watanabe
f8c5301e44
man: AllowedIPs= can be specified multiple times
...
Closes #27507 .
2023-05-22 14:18:46 +09:00
Yu Watanabe
54189b2ec3
network/wireguard: make AllowedIPs= cleared by specifying an empty string
2023-05-22 14:15:49 +09:00
Yu Watanabe
23ff8a776c
test: install test specific modules in test_append_files()
2023-05-22 12:40:05 +09:00
Yu Watanabe
a94149601a
sd-journal: save correct location specifier
2023-05-22 02:54:40 +09:00
Yu Watanabe
43e460a584
test-journal-interleaving: extend tests to clarify the issue in sd_journal_next() or friends
...
This illustrates bug in sd_journal_next() or friends;
calling sd_jounral_next() followed by sd_journal_seek_tail() makes the
location saved in sd-journal something corrupted, and subsequent
sd_journal_previous() or friends may fail or provides unexpected result.
2023-05-22 02:49:25 +09:00
Yu Watanabe
ddf0d5cc0d
Merge pull request #27157 from YHNdnzj/networkctl-edit
...
networkctl: add verb edit and cat to operate on network configs
2023-05-21 21:36:56 +09:00
Yu Watanabe
873be895ed
udev: add USB revision in ID_PATH
...
xHCI host controller may register two (or more?) USB root hubs for USB
2.0 and USB 3.0, and devices under the hubs may have same ID_PATH.
So, to avoid the conflict, let's introduce ID_PATH_WITH_USB_REVISION
that includes the USB revision.
Closes #19406 .
2023-05-20 14:27:10 +09:00
Yu Watanabe
5a54a01634
udev-builtin-path_id: split out add_id_tag()
...
No functional change, just refactoring.
2023-05-20 14:27:07 +09:00
Yu Watanabe
874c408935
udev: check existence of property before use
2023-05-20 14:26:05 +09:00
Yu Watanabe
70b53893f1
cryptenroll: update log messages
2023-05-20 14:21:10 +09:00
Yu Watanabe
cefa4a02ab
cryptenroll: drop unmet condition
2023-05-20 14:21:10 +09:00
Yu Watanabe
b3bd6ccd1e
Merge pull request #27707 from mrc0mmand/tests
...
test: provide coverage for a couple of recent-ish issues
2023-05-20 08:40:01 +09:00
Yu Watanabe
294c20198b
test: replace Makefile for several tests with symlink to the one for TEST-01-BASIC
2023-05-20 05:42:24 +09:00
Yu Watanabe
396f6900ae
Merge pull request #27676 from ldv-alt/udevadm-verify
...
udevadm-verify: add support for directory arguments
2023-05-20 05:41:05 +09:00
Yu Watanabe
24d724087f
Merge pull request #27701 from poettering/switch-root-same-file
...
switch-root: use same_files() logic when checking whether new and old root dir are actually the same
2023-05-20 05:39:28 +09:00
Yu Watanabe
b4e2fcb6bb
core/device: downgrade error when units specified in SYSTEMD_WANTS= not found
...
Closes #27693 .
2023-05-19 15:25:28 +08:00
Yu Watanabe
d0e3ae838f
unit: add conditions and deps to make oomd.socket and .service consistent
...
Fixes #27690 .
2023-05-19 08:58:56 +02:00
Yu Watanabe
47f4ddaf28
Merge pull request #27686 from keszybz/make-boot-output-nicer
...
Make boot output nicer
2023-05-19 03:50:45 +09:00
Yu Watanabe
65f2ff7998
Merge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing
...
The semiannual excercise in output narrowing
2023-05-19 03:04:47 +09:00
Yu Watanabe
ec0bd9611a
Merge pull request #27684 from mrc0mmand/more-nspawn-tests
...
test: further extend systemd-nspawn coverage
2023-05-19 03:00:54 +09:00
Yu Watanabe
837dfea5ed
Merge pull request #27673 from YHNdnzj/restartsteps-transient
...
core,bus-unit-util: add missing RestartSteps and RestartMaxDelaySec to bus_append_service_property
2023-05-18 17:54:33 +09:00
Yu Watanabe
7aeafa93df
README: drop busybox requirement
...
Follow-up for 5656759d06 .
2023-05-18 10:51:49 +02:00
Yu Watanabe
f0485be000
Merge pull request #27677 from mrc0mmand/test-followups
...
test: get rid of the busybox stuff
2023-05-18 17:47:02 +09:00
Yu Watanabe
89572df859
Merge pull request #27664 from mrc0mmand/test-merge
...
test: let's merge more tests together
2023-05-17 09:53:58 +09:00
Yu Watanabe
871a41f0ef
Merge pull request #27606 from YHNdnzj/loginctl-list-show-state
...
loginctl: list-{users,sessions}: add a column for showing state
2023-05-17 01:41:13 +09:00
Yu Watanabe
8c7dd49ad1
Merge pull request #27655 from yuwata/udev-net-assign-alternative-names-only-on-add-event
...
udev/net: assign alternative names only on add event
2023-05-17 01:39:40 +09:00
Yu Watanabe
3418ca21ed
test: add basic test for memfd_set_sealed() and memfd_get_sealed()
2023-05-16 18:59:25 +09:00
Yu Watanabe
52e2672af2
memfd-util: set F_SEAL_EXEC flag if supported
2023-05-16 18:50:39 +09:00
Yu Watanabe
17915ea5b3
memfd-util: memfd may also have F_SEAL_EXEC flag
...
Follow-up for c29715a8f7 .
Fixes #27608 .
2023-05-16 18:48:32 +09:00
Yu Watanabe
8e3303333f
missing: add more F_SEAL_XYZ flags
2023-05-16 18:46:16 +09:00
Yu Watanabe
40b6b448bd
test: add tests for renaming network interface
2023-05-16 18:28:18 +09:00
Yu Watanabe
9094ae52ca
udev/net: assign alternative names only on add uevent
...
Previously, we first assign alternative names to a network interface,
then later change its main name if requested. So, we could not assign
the name that currently assigned as the main name of an interface as an
alternative name. So, we retry to assign the previous main name as an
alternative name on later move uevent.
However, that causes some confusing situation. E.g. if a .link file has
```
Name=foo
AlternativeNames=foo baz
```
then even if the interface is renamed by a user e.g. by invoking 'ip link'
command manually, the interface can be still referenced as 'foo', as the
name is now assigned as an alternative name.
This makes the order of name assignment inverse: the main name is first
changed, and then the requested alternative names are assigned. And
udevd do not assign alternative names on move uevent.
Replaces #27506 .
2023-05-16 16:37:31 +09:00
Yu Watanabe
8182445500
sd-netlink: make rtnl_set_link_name() optionally append alternative names
2023-05-16 16:37:31 +09:00
Yu Watanabe
cd941e6596
udev/net: generate new network interface name only on add uevent
...
On other uevents, the name will be anyway ignored in rename_netif() in
udev-event.c.
2023-05-16 16:37:31 +09:00
Yu Watanabe
e65c6c1baa
udev/net: verify ID_NET_XYZ before trying to assign it as an alternative name
2023-05-16 16:37:31 +09:00
Yu Watanabe
5668f3a7cf
udev: make udev_builtin_run() take UdevEvent*
...
No functional change, preparation for later commits.
2023-05-16 16:37:31 +09:00
Yu Watanabe
b3cfe59001
udev: use SYNTHETIC_ERRNO() at one more place
2023-05-16 16:37:28 +09:00
Yu Watanabe
5571048919
meson: fix description for link-udev-shared option
2023-05-16 14:14:06 +08:00
Yu Watanabe
0c3ea0c222
sd-dhcp-server: also send DNS servers or friends on DHCPOFFER
...
From RFC 2131 section 4.3.1 (https://www.rfc-editor.org/rfc/rfc2131#section-4.3.1 ):
----
The server MUST return to the client:
- Parameters requested by the client, according to the following rules:
-- IF the server has been explicitly configured with a default
value for the parameter, the server MUST include that value
in an appropriate option in the 'option' field,
----
The sentence is not only for ACK, but for all (positive) responses, that
is DHCPOFFER and DHCPACK.
Fixes #27471 .
2023-05-13 12:37:17 +01:00