1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-11 20:58:27 +03:00

52197 Commits

Author SHA1 Message Date
Abderrahim Kitouni
912ef24b66 sysupdate: fix typo in DBus config 2024-12-07 11:33:29 +00:00
Zbigniew Jędrzejewski-Szmek
560412148f Revert "journalctl: show coredumps again when --unit= is specified"
This reverts commit cbd5f5d7d6d652d52a18170123f5d08baf7e9862.
2024-12-07 02:21:51 +09:00
Yu Watanabe
cbd5f5d7d6 journalctl: show coredumps again when --unit= is specified
This effectively reverts fdcd37df3b97abc381c7b7a29b81cc013c7a3230.

After 888e378da2dbf4520e68a9d7e59712a3cd5a830f, coredumps for system
services are stored by systemd-coredump user. Henve, _UID=0 does not
match anything anymore.

Before:
```
$ build/journalctl -u systemd-networkd.service -p2 -n1
-- No entries --
```

After:
```
$ build/journalctl -u systemd-networkd.service -p2 -n1
Dec 06 05:39:55 H systemd-coredump[4187]: [🡕] Process 4145 (systemd-network) of user 192 dumped core.
(snip)
```
2024-12-06 09:56:09 +00:00
Luca Boccassi
3e3c5739f0
More assert macros (#35471) 2024-12-06 00:50:07 +00:00
Zbigniew Jędrzejewski-Szmek
5c0132a4cd test-parse-util: use ASSERT_* macros 2024-12-05 20:14:15 +01:00
Zbigniew Jędrzejewski-Szmek
ebb89ae6f6 test-condition: use xsprintf and drop pointless cast 2024-12-05 20:14:12 +01:00
Zbigniew Jędrzejewski-Szmek
1526396807 test-condition: use ASSERT_* macros
Some strange asserts are dropped.
2024-12-05 20:14:08 +01:00
Zbigniew Jędrzejewski-Szmek
3cf362f6f5 test-time-util: do more suppression of time zone checks
The issue is directly triggered by tzdata-2024b, where the setting of timezone
started to fail and the tests stopped passing. But those timestamps in 1/1/1970
appear to have some problems already before:

  $ sudo date -s 'Thu 1970-01-01 13:00:01 WET'
  Thu Jan  1 03:00:01 PM EET 1970
  $ sudo date -s 'Thu 1970-01-01 12:00:01 WET'
  date: cannot set date: Invalid argument
  Thu Jan  1 02:00:01 PM EET 1970
  $ rpm -q tzdata
  tzdata-2024a-9.fc41.noarch

The same issue appears with other timezones. So move the first timestamp one
day forward to avoid the issue.

After the previous problem is solved, we also get the problem already seen
previously where the roundtrip returns a time that is off by one hour:

@86401000000 → Fri 1970-01-02 00:00:01 WET → @82801000000 → Thu 1970-01-01 23:00:01 WET
Assertion 'x / USEC_PER_SEC == y / USEC_PER_SEC' failed at src/test/test-time-util.c:415, function test_format_timestamp_impl(). Aborting.

Extend the override to suppress this.
2024-12-05 16:12:12 +00:00
Daan De Meyer
900ac3a76a
ci: Implement coverage on top of mkosi (#35407) 2024-12-05 10:47:45 +01:00
Zbigniew Jędrzejewski-Szmek
2eb8aeb442 test-cgroup: use ASSERT_* macros
The test for inode_same_at() is tightened to a specific value.
2024-12-05 10:42:15 +01:00
Zbigniew Jędrzejewski-Szmek
c96e272e4f test-bus-util: use ASSERT_* macros 2024-12-05 10:42:15 +01:00
Zbigniew Jędrzejewski-Szmek
274f7c00f5 test-acl-util: use ASSERT_* macros 2024-12-05 10:40:27 +01:00
Daan De Meyer
561a3786b7 test-execute: Don't make rootfs read-only if we're collecting coverage
The test needs to be able to write coverage data to the rootfs so don't
make / read-only.
2024-12-04 14:04:24 +01:00
Daan De Meyer
eb11048744 creds-util: Improve one log message 2024-12-04 11:12:50 +01:00
Daan De Meyer
157198d9ec test-creds: Migrate to new assertion macros 2024-12-04 11:12:50 +01:00
Zbigniew Jędrzejewski-Szmek
116eab8e7a test-format-table: add test for unsetting table name
This should extend coverage to another part that previously wasn't covered.
2024-12-03 15:00:26 +01:00
Zbigniew Jędrzejewski-Szmek
e0be4dc563 test-format-table: add smoke test for int/uint formatting
When looking at coverage data, I noticed that some types of ints have no
coverage whatsoever.
2024-12-03 15:00:26 +01:00
Zbigniew Jędrzejewski-Szmek
5c74c26db9 test-format-table: convert to ASSERT_* macros 2024-12-03 14:57:01 +01:00
Zbigniew Jędrzejewski-Szmek
444e9ba660 shared/tests: adjust error messages
Grammar is improved a bit and some messages are shortened.
2024-12-03 14:30:01 +01:00
Luca Boccassi
80ea227191
pid1: assume user namespaces are unavailable if we get -EINVAL from clone (#35440) 2024-12-02 22:03:52 +00:00
Zbigniew Jędrzejewski-Szmek
544df97b41 ukify: ellipsize CN to not exceed maximum length
Currently the generation of the certificate fails if len(fqdn) >= 43.
Ellipsize the fqdn to let the tests pass in all cases.

Fixes https://github.com/systemd/systemd/issues/34581.
2024-12-02 16:55:57 +00:00
Zbigniew Jędrzejewski-Szmek
22996a3393 basic/namespace-util: fix double logging after fork failure
[   10.056930] (journald)[104]: Failed to fork off '(sd-mkuserns)': Invalid argument
[   10.063727] systemd[1]: systemd-modules-load.service: About to execute: /usr/lib/systemd/systemd-modules-load
[   10.071148] (journald)[104]: Failed to fork process (sd-mkuserns): Invalid argument

safe_fork_full() already logs at debug level, so the caller shouldn't.
2024-12-02 11:51:23 +01:00
Zbigniew Jędrzejewski-Szmek
afb368951c pid1: assume user namespaces are unavailable if we get -EINVAL from clone()
As reported in https://github.com/systemd/systemd/issues/35400,
on riscv64, with Linux version 6.6.51-linux4microchip+fpga-2024.09, we get:

[   10.063727] systemd[1]: systemd-modules-load.service: About to execute: /usr/lib/systemd/systemd-modules-load
[   10.071148] (journald)[104]: Failed to fork process (sd-mkuserns): Invalid argument

Fixes https://github.com/systemd/systemd/issues/35400.

'r' is used to make the repeated checks shorter. Without that, the long variable
name is distracting.
2024-12-02 11:30:06 +01:00
Mike Yuan
703b1b7f24 core/service: preserve RuntimeDirectory= even if oneshot service exits
Follow-up for c26948c6dae1d2ca13499b36f193b13a0760834c

We only want to get rid of cred mount here, and RuntimeDirectory=
is documented to be retained for SERVICE_EXITED state.

Fixes #35427
2024-12-02 10:57:45 +01:00
Luca Boccassi
0747e3b60e kernel-install: remove .extra.d/ directory too
When a UKI is removed, the per-UKI .extra.d/ directory (addons,
extensions, etc) is left behind.
2024-12-01 14:05:45 +09:00
Yu Watanabe
a1417e5563 systemctl: skip checking inhibitors when dbus.service is not running
Fixes a bug introduced by 804874d26ac73e0af07c4c5d7165c95372f03f6d.

Fixes #35416.
2024-12-01 14:00:55 +09:00
David Tardon
c3dc460b6c execute: free syscall_log hashmap when done
Fixes #35394
2024-11-28 16:45:02 +01:00
Yu Watanabe
d9d784ebe0 sysupdate: add missing full stop to the polkit message
Follow-up for e55e7a5a613712dc9a94d40a1fea1f02d359961f.
2024-11-28 18:13:51 +09:00
Luca Boccassi
723069188d
nsresourced: log about correct errno (#35386)
Split out from #35242
2024-11-27 19:26:41 +00:00
Yu Watanabe
1d96f18bd8 network/queue: do not increase reference counter when remove request is not queued
Fixes a bug introduced by ef45f5c8d0bfbeda2a57b28bba9831f044b23b21.
Fixes #35164.
2024-11-27 19:24:50 +00:00
Mike Yuan
67b9a72c60
nsresourced: log about correct errno in userns_destroy_cgroup() 2024-11-27 18:38:01 +01:00
Mike Yuan
4da9f38de1
cgroup-util: use RET_NERRNO where appropriate 2024-11-27 18:38:00 +01:00
Lennart Poettering
62f3e2f84a nspawn: make sure --private-users-ownership=no and =off work the same way
We usually want to use "extended booleans" for cases like this, i.e.
that "off", "no" and "0" can be used interchangably for turning
something off.
2024-11-28 00:47:14 +09:00
Lennart Poettering
92338a63ff sysext: coding style fixes & fix a memory leak
Follow-up for: bbec1c87d3bf8d14eeb1ee3b4df973a53cca2e58
2024-11-28 00:46:33 +09:00
Yu Watanabe
288b9acf1c
Minor follow-ups for recent PRs (#35381) 2024-11-28 00:16:29 +09:00
Lennart Poettering
fbb159b789 service: don't second guess invocation mode again
let's just check the debug invocation boolean, and not recheck the
restart mode again. It's mostly redundant (because the boolean should
not have been become true if the restart mode was not set accordingly).

Moreover, i think we might want to eventually allow a manual way to
enable debug invocation mode, and hence this pointless checking would
become a problem.

Also, we never check the restart mode again in other cases, hence we
shouldn't here either.
2024-11-28 00:14:55 +09:00
Lennart Poettering
d79ba8574b nspawn: improve error message when we cannot look into a container tree due to perms 2024-11-28 00:14:04 +09:00
Lennart Poettering
0790f4e45f nspawn: don't try to unregister a machine we never registered
When registering we condition this on "arg_register". Let's do the same
when unregistering, otherwise we might end up trying to unregister a
machine we never registered.
2024-11-28 00:12:57 +09:00
Mike Yuan
9a1276e0a2
shared/bootspec: mark _to_string funcs as _const_
Addresses https://github.com/systemd/systemd/pull/34959#discussion_r1860451777
2024-11-27 14:49:09 +01:00
Mike Yuan
992852e24c
shared/bootspec: use FOREACH_ELEMENT where appropriate, avoid unneeded memzero() 2024-11-27 14:49:08 +01:00
Mike Yuan
7d93fa7099
shared/bootspec: move boot_entry_addons_done() up, drop separate prototype
Follow-up for e2501a851e10f5279862b2bccbdd9184572cce6a
2024-11-27 14:49:04 +01:00
Mike Yuan
7a719510c8
basic/fileio: minor coding style cleanup
Follow-up for bbec1c87d3bf8d14eeb1ee3b4df973a53cca2e58
2024-11-27 14:33:23 +01:00
Luca Boccassi
0abaa5be10
bootspec fixups (#34959) 2024-11-27 10:55:32 +00:00
Zbigniew Jędrzejewski-Szmek
ef20d06da6
ukify: Switch to JSON HWID description format (#35208)
Fixes #35176
2024-11-27 09:50:41 +01:00
Adrian Vovk
f2751d757f
bootspec: Look at /loader/addons in XBOOTLDR
The bootspec util-lib's handling of global addons didn't previously
match the behavior of sd-stub, and this commit corrects that.

First, bootspec didn't load global addons from the XBOOTLDR dir, but the
stub does. So, bootspec now enumerates addons in XBOOTLDR, not just ESP

Second, the stub only loads resources (including addons) from the
partition that it was found on. Thus, we must keep track of which
partition the global addons come from, and which partition each boot
entry comes from. In other words: global addons found on the ESP will
NOT apply to UKIs found in XBOOTLDR, and bootspec now reflects that.
2024-11-26 22:25:29 -05:00
Adrian Vovk
ef370a3c30
bootspec: Fixup loading of local addons for UKIs
Follow-up for 59b3df9
2024-11-26 16:33:11 -05:00
Adrian Vovk
e2501a851e
bootspec: Fixup memory leak
This would previously leak memory: the array was deleted but contents
inside of the array were not
2024-11-26 16:33:10 -05:00
Adrian Vovk
5a10a9a3bb
sd-stub: Fixup typo & measurement order
A previous commit accidentally reversed the measurement order of the
confext initrds and sysext initrds via a minor typo. This commit fixes
the typo and restores the original measurement order

Follow-up: ac32323
2024-11-26 16:33:09 -05:00
gerblesh
bbec1c87d3 sysext: set SELinux context for hierarchies and workdir 2024-11-26 17:47:32 +00:00
Lennart Poettering
7b4b3a8f7b sd-varlink: fix bug when enqueuing messages with fds asynchronously
When determining the poll events to wait for we need to take the queue
of pending messages that carry fds into account. Otherwise we might end
up not waking up if such an fd-carrying message is enqueued
asynchronously (i.e. not from a dispatch callback).
2024-11-26 16:06:53 +00:00