1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

65416 Commits

Author SHA1 Message Date
licunlong
a068eeac6f core/dbus-manager: also show DefaultIOAccounting and DefaultIPAccounting
fix: https://github.com/systemd/systemd/issues/28045
2023-06-19 09:57:11 +02:00
Luca Boccassi
5f655ffb15
Merge pull request #28069 from medhefgo/boot-dp
boot: device_path_to_str improvements
2023-06-18 15:11:49 +01:00
Luca Boccassi
40cdb3b756 journal: avoid infinite recursion when closing bad journal FD
When trying to log, if we fail we try to close the journal FD. If
it is bad, safe_close() will fail and assert, which will try to log,
which will fail, which will try to close the journal FD...
Infinite recursion looks very pretty live in gdb, but let's avoid
that by immediately invalidating the journal FD before closing it.
2023-06-18 12:31:53 +01:00
Jan Janssen
78fffdea37 boot: Improve device_path_to_str_internal()
The UEFI spec has a generic `Path` node representation that can be used
for device path nodes that are unknown. So we can use that instead of
giving up when we see a node other than FilePath.

This also simplifies the FilePath case by just using xasprintf(). The
code is really just a fallback for silly firmware that does not
implement EFI_DEVICE_PATH_TO_TEXT_PROTOCOL (looking at you, Apple).

The correctness of this was tested by round-tripping it through
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL, which yielded an identical device
compared to our input path.
2023-06-18 11:13:09 +02:00
Jan Janssen
e53e5c0ac1 boot: Split log_hexdump() 2023-06-18 11:13:03 +02:00
Jan Janssen
f982500338 boot: Move custom device path string creating into its own function 2023-06-18 09:42:22 +02:00
Luca Boccassi
55e1ff26a5
Merge pull request #28060 from mrc0mmand/remote-journal-tests
test: add a couple of tests for systemd-journal-gatewayd
2023-06-17 11:34:50 +01:00
Yu Watanabe
ecaee348d9
Merge pull request #28063 from bluca/test_oomd_fixlets
Readability fixes for TEST-55-OOMD
2023-06-17 14:37:53 +09:00
Luca Boccassi
6acbb3f2fb TEST-55-OOMD: improve ephemeral configuration readability 2023-06-17 00:08:09 +01:00
Luca Boccassi
565b13f8b2 TEST-55-OOMD: use /run/ for configuration instead of /etc/
Make sure configuration is ephemeral if the image is reused
2023-06-17 00:08:09 +01:00
Frantisek Sumsal
9ccd59f751 socket-activate: make a copy of the command name and arguments
When we call safe_fork() with the first argument set (process name), we
call rename_process() that zeroes out saved argv (that was saved by
save_argc_argv() in the main func defined by DEFINE_MAIN_FUNC()). In this
case this means that with --accept both the target executable name and
its arguments will be empty strings:

```
$ systemd-socket-activate --accept --listen 1111 cat &
Listening on [::]:1111 as 3.
$ curl localhost:1111
Communication attempt on fd 3.
Connection from 127.0.0.1:52948 to [::ffff:127.0.0.1]:1111
Spawned cat (cat) as PID 10576.
Execing  ()
Failed to execp  (): No such file or directory
Child 10576 died with code 1
curl: (56) Recv failure: Connection reset by peer
```

Let's make a copy of the necessary arguments beforehand and use it
instead to fix this.
2023-06-16 20:42:43 +02:00
Frantisek Sumsal
1d252ea2ae test: add a couple of tests for systemd-journal-gatewayd 2023-06-16 20:42:43 +02:00
Kiran Vemula
88c6f8f894 resolved: Initialize until_valid while storing negative/NXDOMAIN response in the cache
Initialize until_valid is properly for negative response, the cached negative responses can be used to answer the queries before contacting upstream server.
2023-06-16 17:45:06 +01:00
Luca Boccassi
b79f29cd2b
Merge pull request #28049 from bluca/portablectl_flags
portable: fix silly typo in D-Bus interface name, use only new(er) methods from portablectl
2023-06-16 17:44:34 +01:00
Frantisek Sumsal
b2f03d73d9 journal-gatewayd: make MHD_OPTION_EXTERNAL_LOGGER the first option
To get rid of the warning on gatewayd startup:
    microhttpd: MHD_OPTION_EXTERNAL_LOGGER is not the first option
    specified for the daemon. Some messages may be printed by the
    standard MHD logger.
2023-06-16 17:03:27 +02:00
Luca Boccassi
c18f4eb9e9 portablectl: fix using --force when no --extension is passed
The 'force' flag applies whether or not extensions are present
2023-06-16 12:31:56 +01:00
Luca Boccassi
e0a067a251 portable: fix silly typo in D-Bus interface name
D'oh. Nobody noticed in 3 years, I guess nobody calls these directly
and instead the manager's methods are used. Still we'll have to keep
this around, so just hide it.
2023-06-16 12:31:56 +01:00
Kiran Vemula
5ed91481ab resolved: added serve stale feature implementation of RFC 8767
serve stale feature to keep the DNS resource records beyond TTL to return them as stale records in case of upstream server is not reachable or returns negative response.
SD_RESOLVED_NO_STALE flag has been added to disable serving stale records via dbus.
added serve stale test cases to TEST-75-RESOLVED
Fixes: #21815
2023-06-16 10:20:15 +01:00
Luca Boccassi
f03b74cb53
Merge pull request #23391 from yuwata/meson-bump-required-version
meson: bump required version
2023-06-16 10:13:44 +01:00
Frantisek Sumsal
e46b313a62 test: clean up the new test case a bit
Follow-up to 61cecfa0d8.
2023-06-16 09:56:32 +02:00
Lennart Poettering
7eb73fac04
Merge pull request #27927 from Geass-LL/main
core/unit: increase the GetNameOwner timeout to 90s
2023-06-16 09:38:53 +02:00
zhmylove
61cecfa0d8 journalctl: add --truncate-newline option 2023-06-16 09:31:47 +02:00
Yu Watanabe
5063f027ef networkd-test.py: disable global DNS= setting
Otherwise, queries may be passed to unexpected DNS servers.
2023-06-16 10:57:51 +09:00
Yu Watanabe
55f9d72a5d networkd-test.py: do not query IPv6 address
From changelog of dnsmasq v2.87:
====
Note in manpage the change in behaviour of -address. This behaviour
actually changed in v2.86, but was undocumented there. From 2.86 on,
(eg) --address=/example.com/1.2.3.4 ONLY applies to A queries. All other
types of query will be sent upstream. Pre 2.86, that would catch the
whole example.com domain and queries for other types would get
a local NODATA answer. The pre-2.86 behaviour is still available,
by configuring --address=/example.com/1.2.3.4 --local=/example.com/
====
2023-06-16 10:44:16 +09:00
Yu Watanabe
77725adedd networkd-test.py: replace deprecated option IPv6AcceptRouterAdvertisements=
Also, use 'yes' or 'no' for boolean options.
2023-06-16 10:43:06 +09:00
Yu Watanabe
eeb88ea41d networkd-test.py: show more debugging logs on failure 2023-06-16 10:43:06 +09:00
Evgeny Vereshchagin
83dda3d28b ci: drop the "find" kludge
meson no longer complains about install_tag
2023-06-16 10:43:06 +09:00
Yu Watanabe
35c035a1a7 meson: bump required version to 0.60.0
To suppress warning about install_tag argument.
2023-06-16 10:43:06 +09:00
Yu Watanabe
ff5becf585 meson: bump required version to 0.59.0
fs.stemp() and fs.name() can take File object since 0.59.0.
2023-06-16 10:43:06 +09:00
Yu Watanabe
2bd6f87e95 ci: bump debian release bullseye -> bookworm
Preparation for bumping meson requirement higher than 0.56.2.
2023-06-16 10:43:06 +09:00
Yu Watanabe
f06390d504 mkosi: install HyperScale repository for CentOS 8
Preparation for bumping meson requirement higher than 0.56.2.
2023-06-16 10:43:06 +09:00
Yu Watanabe
0b01cac59a meson: drop non-existent test directories 2023-06-16 10:43:06 +09:00
Yu Watanabe
d1b0d8415c meson: drop redundant spaces 2023-06-16 10:43:06 +09:00
licunlong
8df433d7cd core/unit: increase the NameOwnerChanged/GetNameOwner timeout to the unit's start timeout
When dbus is overloaded, these messages are easily timedout,
systemd may kill dbus-type service by mistake. This PR
mitigates this problem by increasing the timeout to the
unit's start timeout.
2023-06-16 09:19:36 +08:00
licunlong
f5a9d2ee2a core/unit: add get_timeout_start_usec in UnitVTable and define it for service 2023-06-16 09:19:33 +08:00
Luca Boccassi
9a109e7cd6
Merge pull request #28053 from mrc0mmand/assorted-fixes
A bunch of typo fixes and code cleanups
2023-06-16 01:21:22 +01:00
наб
f26c794308 find-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix
The original commit is fully correct in its analysis, description, and
mechanics, but the patch changes an identical condition around line 500
(find_esp_and_warn()), instead of line 800 (find_xbootldr_and_warn()).

The internal patch I distributed to testers was correct (L800), and
neither the reviewers, nor me, caught that I wrote the wrong line for
upstream submission. I've re-checked that this patch applied to
systemd 252.11-1 fixes the issue.

Keep the -ENOTTY condition for find_esp_and_warn(), since the conditions
are clearly supposed to be the same and similar semantics apply.

Fixes: commit ed89819f8f ("find-esp: don't
 silently error bootctl install if presumed XBOOTLDR part is
 stx_dev_major=0 but not btrfs")
2023-06-16 01:20:52 +01:00
Luca Boccassi
c94237468f core: fix post-fork memory leak
Doesn't matter really, but it is caught by ASAN when things fail
and there's no execve, so fix it.

https://jenkins-systemd.apps.ocp.cloud.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/3245/console
2023-06-15 23:25:00 +01:00
Frantisek Sumsal
8df6874927 udev: use timestamp_is_set() in one more place 2023-06-15 20:58:24 +02:00
Frantisek Sumsal
0347b9fdaa audit-util,varlink: use IOVEC_MAKE() in a couple more places 2023-06-15 20:58:24 +02:00
Frantisek Sumsal
9a27ef092e tree-wide: fix a couple of typos
As reported by Fossies.org.
2023-06-15 20:52:45 +02:00
Joyce
34c4496ef2
Update badge on README to refer new scorecard viewer (#28050)
* Update scorecard badge on README.md

Signed-off-by: Joyce <joycebrum@google.com>
2023-06-15 19:24:32 +01:00
Frantisek Sumsal
3bba91ef44 test: set $PATH to something predictable in the ASan wrapper
This is still necessary when running with clang's ASan, as it uses an
external binary to symbolize the stack traces.

Follow-up to ba79e8c2cc.
2023-06-15 14:53:32 +01:00
Lennart Poettering
6e89663d23 systemctl: let's emphasize a bit that halt/poweroff/reboot/shutdown are compat commands
Let's try to make clear that these calls really should not be extended
anymore, but remain as the compat glue they are but not more.

Anything new should really be added to systemctl poweroff/halt/reboot,
which is actually defined and owned by us.

This is added in light of a9c3cc8db0 which
really shouldn't have been added I am sure.

This adds two things: a note to the --help text that people use the
relevant systemctl commands instead (as they are a lot more powerful,
for example give you inhibitor and boot loader control, kexec, and so
on). And a note to developers that they stop adding new stuff to the
compat interfaces.
2023-06-15 14:06:37 +02:00
Lennart Poettering
c4ffb53054 update TODO 2023-06-15 13:43:54 +02:00
Haochen Tong
adeff82234 execute: fix the condition of private mounts for user namespacing
Follow-up for: 6ef721cbc7
2023-06-15 13:12:24 +02:00
licunlong
bb30e58f64 sd-bus: make bus_add_match_full accept timeout 2023-06-15 18:15:23 +08:00
Yu Watanabe
a5ebaf7982 kernel-install: skip to read /etc/machine-info in test
We do not provide any way to override /etc/machine-info.
As the file is deprecated in kernel-install, let's skip to read it when
we test kernel-install.

Fixes #28011.
2023-06-15 18:53:29 +09:00
Henrik Holst
cf4dbd84ac
network: make degraded-carrier bond/bridge as routable (#27776)
This makes a bond or bridge interface in the degraded-carrier state but has a routable address
handled as routable operational state.

If the carrier is degraded but the address state is routable then the operational state should be
seen as routable and not degraded because that may be the case for bonds if some of the links are down,
but when that happens the bond as whole is still routable.

This also makes operational state to degraded if address state is degraded even if the link state is
degraded-carrier.

Fixes #22713.
2023-06-15 13:32:10 +09:00
Luca Boccassi
4dad6101fd
Merge pull request #28038 from mrc0mmand/cleanups
A couple of cleanups
2023-06-14 23:18:04 +01:00