]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 weeks agoupdate TODO 32441/head
Lennart Poettering [Wed, 24 Apr 2024 09:22:31 +0000 (11:22 +0200)] 
update TODO

6 weeks agoexecute: make ExecStatus dump more useful by showing passed time
Lennart Poettering [Wed, 24 Apr 2024 10:01:14 +0000 (12:01 +0200)] 
execute: make ExecStatus dump more useful by showing passed time

Let's show the runtimes of our commands and preparations for them. It's
actually quite interesting, we sometimes are irritatingly slow with our
handoffs.

6 weeks agoswap: hook up with handoff timestamps
Lennart Poettering [Wed, 24 Apr 2024 08:13:55 +0000 (10:13 +0200)] 
swap: hook up with handoff timestamps

6 weeks agomount: hook up with handoff timestamps
Lennart Poettering [Wed, 24 Apr 2024 08:13:39 +0000 (10:13 +0200)] 
mount: hook up with handoff timestamps

6 weeks agosocket: hookup handoff timestamps with processes forked off by socket units
Lennart Poettering [Wed, 24 Apr 2024 07:47:29 +0000 (09:47 +0200)] 
socket: hookup handoff timestamps with processes forked off by socket units

6 weeks agomanager: switch service unit type over to using new handoff timestamping logic
Lennart Poettering [Tue, 23 Apr 2024 21:27:23 +0000 (23:27 +0200)] 
manager: switch service unit type over to using new handoff timestamping logic

Also: rename Handover → Handoff. I think it makes it clearer that this
is not really about handing over any resources, but that the executor is
out off the game from that point on.

6 weeks agoexecute: send handoff timestamps from executor to service manager
Lennart Poettering [Tue, 23 Apr 2024 21:22:07 +0000 (23:22 +0200)] 
execute: send handoff timestamps from executor to service manager

This changes the executor to systematically send handoff timestamps to
the service manager if a socket for that is supplied. This drops the
code that did this via Type=exec messages, and reverts that part to the
old behaviour before 93cb78aee2cff8109a5a70128287732f03d7a062.

Benefits of this approach:

1. We can collect the handoff for any command we fork off, regardless
   if it's ExecStart= something else, regardless whether it's Type=exec,
   Type=simple or some any other service type, regardless of the unit
   type.

2. We collect both CLOCK_REALTIME and CLOCK_MONOTONIC, as we do for the
   other process timestamps.

3. It's entirely backwards compatible, as this doesn't change the
   protocol between service manager and executor, but just extends it.

6 weeks agomanager: add socket for receiving handoff timestamps from forked children
Lennart Poettering [Tue, 23 Apr 2024 21:17:49 +0000 (23:17 +0200)] 
manager: add socket for receiving handoff timestamps from forked children

This adds an AF_UNIX socket pair to the manager that we can collect
handoff timestamp messages on.

The idea is that forked off children send a datagram with a timestamp
and we use its sender PID to match it against the right forked off
process.

This part only implements the receiving side: a socket is created, and
listened on. Received datagrams are parsed, verified and then dispatched
to the interested units.

6 weeks agocore: fix assertions in manager_dispatch_user_lookup_fd()
Lennart Poettering [Thu, 25 Apr 2024 11:30:10 +0000 (13:30 +0200)] 
core: fix assertions in manager_dispatch_user_lookup_fd()

assert_se() should not be used here, these checks are paranoia only and
have no side-effect after all.

hence fix this to use assert(), or in fact ASSERT_PTR()

6 weeks agorun/run: fix invocation ID handling
Yu Watanabe [Wed, 24 Apr 2024 05:58:07 +0000 (14:58 +0900)] 
run/run: fix invocation ID handling

Fixes a regression introduced by 8157cc0e3e33c97b406cc088cf001ca524154f64.

6 weeks agoMerge pull request #32464 from YHNdnzj/journal-object-invocation-id
Yu Watanabe [Wed, 24 Apr 2024 21:40:45 +0000 (06:40 +0900)] 
Merge pull request #32464 from YHNdnzj/journal-object-invocation-id

journal: small fixes for OBJECT_SYSTEMD_INVOCATION_ID

6 weeks agosystemctl: list-jobs: interchange 'waiting for' and 'blocking' in output
Rasmus Villemoes [Wed, 24 Apr 2024 09:16:50 +0000 (11:16 +0200)] 
systemctl: list-jobs: interchange 'waiting for' and 'blocking' in output

The current output of 'systemctl list-jobs' with the --after and/or --before
switches seems backwards. With artificial units

# check-oil.service
[Unit]
Description=Check the oil level
Before=engine-ready.target

# fill-gas.service
[Unit]
Description=Fill the tank with gasoline
Before=engine-ready.target

# engine-ready.target
[Unit]
Description=The engine is ready

[Unit]
Description=Start the engine!
After=engine-ready.target
Wants=engine-ready.target

running 'systemctl list-jobs --before --after' produces

JOB UNIT                                              TYPE  STATE
93  check-oil.service                                 start running
└─      waiting for job 94 (engine-ready.target/start)   -     -
102 fill-gas.service                                  start running
└─      waiting for job 94 (engine-ready.target/start)   -     -
94  engine-ready.target                               start waiting
└─      waiting for job 111 (start-engine.service/start) -     -
└─      blocking job 93 (check-oil.service/start)        -     -
└─      blocking job 102 (fill-gas.service/start)        -     -
111 start-engine.service                              start waiting
└─      waiting for job 1 (multi-user.target/start)      -     -
└─      blocking job 94 (engine-ready.target/start)      -     -

Obviously, job 93 is not waiting for job 94, but rather blocking it.

6 weeks agoMerge pull request #32458 from poettering/manager_get_units_for_pidref
Luca Boccassi [Wed, 24 Apr 2024 19:28:52 +0000 (21:28 +0200)] 
Merge pull request #32458 from poettering/manager_get_units_for_pidref

core: split out manager_get_units_for_pidref() and use it at multiple places

6 weeks agomount,swap: include ExecStatus output in dump
Lennart Poettering [Wed, 24 Apr 2024 09:10:50 +0000 (11:10 +0200)] 
mount,swap: include ExecStatus output in dump

socket and service units output there ExecCommand/ExecStatus definitions
already, but this was missing in mount/swap. Fix that.

6 weeks agoMerge pull request #32465 from CodethinkLabs/mkosi-debug
Daan De Meyer [Wed, 24 Apr 2024 19:02:41 +0000 (21:02 +0200)] 
Merge pull request #32465 from CodethinkLabs/mkosi-debug

mkosi: Build images and run mkosi tests with --debug to aid debugging in CI

6 weeks agoMerge pull request #32461 from DaanDeMeyer/test-fixes
Daan De Meyer [Wed, 24 Apr 2024 17:30:53 +0000 (19:30 +0200)] 
Merge pull request #32461 from DaanDeMeyer/test-fixes

Various integration test fixes

6 weeks agoTEST-50-DISSECT: Skip mutable sysext tests on virtiofs 32461/head
Daan De Meyer [Tue, 23 Apr 2024 21:20:44 +0000 (23:20 +0200)] 
TEST-50-DISSECT: Skip mutable sysext tests on virtiofs

virtiofs cannot be used as the upper fs for overlayfs, so skip all
the sysext mutable tests that would try to use virtiofs as the
upper fs.

6 weeks agotest: Add --debug when running mkosi through integration-test-wrapper 32465/head
Richard Maw [Wed, 24 Apr 2024 17:27:07 +0000 (18:27 +0100)] 
test: Add --debug when running mkosi through integration-test-wrapper

6 weeks agoman/systemd.journal-fields: add missing OBJECT_SYSTEMD_INVOCATION_ID 32464/head
Mike Yuan [Wed, 24 Apr 2024 17:08:47 +0000 (01:08 +0800)] 
man/systemd.journal-fields: add missing OBJECT_SYSTEMD_INVOCATION_ID

6 weeks agojournald-server: drop spuriously doubled '=' for OBJECT_SYSTEMD_INVOCATION_ID
Mike Yuan [Wed, 24 Apr 2024 16:55:31 +0000 (00:55 +0800)] 
journald-server: drop spuriously doubled '=' for OBJECT_SYSTEMD_INVOCATION_ID

6 weeks agomkosi: Build images with --debug to aid debugging in CI
Richard Maw [Wed, 24 Apr 2024 16:31:41 +0000 (17:31 +0100)] 
mkosi: Build images with --debug to aid debugging in CI

6 weeks agomanager: also port manager_dispatch_sigchld() to manager_get_units_for_pidref() 32458/head
Lennart Poettering [Wed, 24 Apr 2024 09:38:28 +0000 (11:38 +0200)] 
manager: also port manager_dispatch_sigchld() to manager_get_units_for_pidref()

We have pretty much the same code here, let's reuse the common
implementation.

6 weeks agomanager: split out helper that gets Unit objects with interest in given PidRef
Lennart Poettering [Tue, 23 Apr 2024 16:32:16 +0000 (18:32 +0200)] 
manager: split out helper that gets Unit objects with interest in given PidRef

This is both easier to read and allows us to reuse the helper later.

6 weeks agoMerge pull request #32447 from keszybz/test-taint
Zbigniew Jędrzejewski-Szmek [Wed, 24 Apr 2024 16:09:57 +0000 (18:09 +0200)] 
Merge pull request #32447 from keszybz/test-taint

core: drop unused param, move taint calculation to separate file

6 weeks agoci: remove packages.microsoft.com
Luca Boccassi [Wed, 24 Apr 2024 14:33:31 +0000 (15:33 +0100)] 
ci: remove packages.microsoft.com

It is not needed, it publishes things like dotnet, and it is often
broken, so just remove the sources

6 weeks agomanager: port user lookup fd serialization to serialize_fd_many()
Lennart Poettering [Tue, 23 Apr 2024 19:41:42 +0000 (21:41 +0200)] 
manager: port user lookup fd serialization to serialize_fd_many()

6 weeks agomanager: comprehensively mark manager_dispatch_user_lookup_fd() as static
Lennart Poettering [Tue, 23 Apr 2024 21:28:21 +0000 (23:28 +0200)] 
manager: comprehensively mark manager_dispatch_user_lookup_fd() as static

The prototype was static, but the implementation was not. Make both
static, this is otherwise too confusing. (This doesn't actually change
anything, since the prototype decides about this anyway, but it makes
things easier to read.)

6 weeks agocapability-util: avoid thread_local
Lennart Poettering [Wed, 24 Apr 2024 07:44:16 +0000 (09:44 +0200)] 
capability-util: avoid thread_local

While stracing PID1's forking off of children I noticed that every
single forked off child reads cap_last_cap from procfs. That value is a
kernel constant, hence we can save a lot of work if we'd cache it.

Thing is, we actually do cache it, in a thread_local cache field. This
means that the forked off processes (which are considered new threads)
will have to re-query it, even though we already know the result.

Hence, let's get rid of the thread_local stuff (given that the value is
going to be the same for all threads anyway, and we pretty much have a
single thread only anyway). Use an C11 atomic_int instead, which ensures
the value is either initialized or not initialized, but we don't need to
be concerned of partial initialization.

This makes the cap_last_cap reading go away in the children, as strace
shows (since cap_last_cap() is already called by PID 1 before
fork()ing, anyway).

6 weeks agocryptenroll: fix typo (close parenthesis out of nowhere)
Mike Yuan [Wed, 24 Apr 2024 12:01:47 +0000 (20:01 +0800)] 
cryptenroll: fix typo (close parenthesis out of nowhere)

Follow-up for 8518f4a814426e7a92342298353a4cd9508cb33b

6 weeks agomanager: use startswith() return value
Lennart Poettering [Tue, 23 Apr 2024 19:48:16 +0000 (21:48 +0200)] 
manager: use startswith() return value

6 weeks agomanager: use proper unicode arrow in dump
Lennart Poettering [Wed, 24 Apr 2024 09:10:28 +0000 (11:10 +0200)] 
manager: use proper unicode arrow in dump

6 weeks agoTEST-50-DISSECT: Use --apparent-size when calling du
Daan De Meyer [Tue, 23 Apr 2024 21:16:29 +0000 (23:16 +0200)] 
TEST-50-DISSECT: Use --apparent-size when calling du

Otherwise if the file is full of holes we get the wrong size and
we'll fail later on.

6 weeks agoTEST-50-DISSECT: Skip mountfsd test if the user namespace interface is not supported
Daan De Meyer [Tue, 23 Apr 2024 21:15:44 +0000 (23:15 +0200)] 
TEST-50-DISSECT: Skip mountfsd test if the user namespace interface is not supported

6 weeks agocore/taint: make short_uid_range() not take a path 32447/head
Zbigniew Jędrzejewski-Szmek [Wed, 24 Apr 2024 10:43:04 +0000 (12:43 +0200)] 
core/taint: make short_uid_range() not take a path

As requested in review.

6 weeks agocore: drop unused param, move taint calculation to separate file
Zbigniew Jędrzejewski-Szmek [Wed, 24 Apr 2024 07:33:25 +0000 (09:33 +0200)] 
core: drop unused param, move taint calculation to separate file

Follow-up for 2b28dfe6e632f47a9058d9378fb88a0c99b34a91.

I also considered moving the function to src/basic, but since it's only used by
the manager, it doesn't seem useful.

6 weeks agoexec-invoke: correct dont_close[] size
Lennart Poettering [Tue, 23 Apr 2024 19:49:12 +0000 (21:49 +0200)] 
exec-invoke: correct dont_close[] size

THis needs 15 entries as far as I can count, not just 14.

Follow-up for: 5686391b006ee82d8a4559067ad9818e3e631247

Sniff.

6 weeks agoMerge pull request #32449 from DaanDeMeyer/mkosi
Daan De Meyer [Wed, 24 Apr 2024 10:11:11 +0000 (12:11 +0200)] 
Merge pull request #32449 from DaanDeMeyer/mkosi

Various mkosi fixes

6 weeks agomkosi: Add attr 32449/head
Daan De Meyer [Wed, 24 Apr 2024 09:03:14 +0000 (11:03 +0200)] 
mkosi: Add attr

Required for messing around with xattrs in integration tests.

6 weeks agomkosi: Add nvme-cli
Daan De Meyer [Wed, 24 Apr 2024 09:02:48 +0000 (11:02 +0200)] 
mkosi: Add nvme-cli

The nvme command is needed for TEST-84-STORAGETM.

6 weeks agomkosi: Add psmisc to opensuse for killall
Richard Maw [Tue, 23 Apr 2024 20:44:30 +0000 (21:44 +0100)] 
mkosi: Add psmisc to opensuse for killall

6 weeks agomkosi: Add psmisc to debian-ubuntu for killall
Richard Maw [Tue, 23 Apr 2024 09:34:16 +0000 (10:34 +0100)] 
mkosi: Add psmisc to debian-ubuntu for killall

6 weeks agomkosi: Add psmisc to arch for killall
Richard Maw [Tue, 23 Apr 2024 18:39:38 +0000 (19:39 +0100)] 
mkosi: Add psmisc to arch for killall

6 weeks agotest: Shut down tests on crash
Richard Maw [Tue, 23 Apr 2024 13:13:22 +0000 (14:13 +0100)] 
test: Shut down tests on crash

If an assert in systemd fails it can't shut down normally.

By default it freezes. For interactive runs we want the crash shell
to enable further debugging, but during test runs we want it to exit
without having to wait for the test timeout.

By deactivating the crash shell, enabling reboot, and configuring qemu
so that it shuts down instead of rebooting we can shut down instead.

Because by default UEFI will enroll keys and then reboot
we also have to set --qemu-firmware-variables=custom
so it doesn't need to auto-enroll.

Because mkosi has to handle not receiving an EXIT_STATUS notification
it falls back to the exit code of qemu, which in the case of reboot
would be 0, we also override the success exit status to 123
and check that we got that as an exit code from mkosi.

6 weeks agotest: document when writable /usr overlays may be needed
Richard Maw [Mon, 25 Mar 2024 17:43:44 +0000 (17:43 +0000)] 
test: document when writable /usr overlays may be needed

6 weeks agomkosi: Update to latest
Richard Maw [Tue, 23 Apr 2024 15:41:39 +0000 (16:41 +0100)] 
mkosi: Update to latest

6 weeks agoMerge pull request #32424 from yuwata/network-radv-cleanups
Yu Watanabe [Wed, 24 Apr 2024 08:51:47 +0000 (17:51 +0900)] 
Merge pull request #32424 from yuwata/network-radv-cleanups

network/radv: further cleanups

6 weeks agoMerge pull request #32443 from weblate/weblate-systemd-main
Frantisek Sumsal [Wed, 24 Apr 2024 08:23:09 +0000 (10:23 +0200)] 
Merge pull request #32443 from weblate/weblate-systemd-main

Translations update from Fedora Weblate

6 weeks agoman: document service types that record ExecMainHandoverTimestamp
Luca Boccassi [Tue, 23 Apr 2024 09:47:49 +0000 (10:47 +0100)] 
man: document service types that record ExecMainHandoverTimestamp

Follow-up for 93cb78aee2cff8109a5a70128287732f03d7a062

6 weeks agopo: Translated using Weblate (Georgian) 32443/head
Temuri Doghonadze [Wed, 24 Apr 2024 05:36:08 +0000 (07:36 +0200)] 
po: Translated using Weblate (Georgian)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ka/
Translation: systemd/main

6 weeks agopo: Translated using Weblate (Ukrainian)
Yuri Chornoivan [Wed, 24 Apr 2024 05:36:08 +0000 (07:36 +0200)] 
po: Translated using Weblate (Ukrainian)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/uk/
Translation: systemd/main

6 weeks agopo: Translated using Weblate (Turkish)
Oğuz Ersen [Wed, 24 Apr 2024 05:36:08 +0000 (07:36 +0200)] 
po: Translated using Weblate (Turkish)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/tr/
Translation: systemd/main

6 weeks agopo: Translated using Weblate (Swedish)
Luna Jernberg [Wed, 24 Apr 2024 05:36:07 +0000 (07:36 +0200)] 
po: Translated using Weblate (Swedish)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Luna Jernberg <bittin@reimu.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sv/
Translation: systemd/main

6 weeks agonetwork/radv: merge two boolean flags for prefix into one 32424/head
Yu Watanabe [Tue, 23 Apr 2024 03:45:18 +0000 (12:45 +0900)] 
network/radv: merge two boolean flags for prefix into one

6 weeks agosd-radv: use in6_addr_prefix_intersect()
Yu Watanabe [Tue, 23 Apr 2024 04:14:21 +0000 (13:14 +0900)] 
sd-radv: use in6_addr_prefix_intersect()

6 weeks agoin-addr-util: introduce in{4,6}_addr_prefix_intersect()
Yu Watanabe [Tue, 23 Apr 2024 03:29:38 +0000 (12:29 +0900)] 
in-addr-util: introduce in{4,6}_addr_prefix_intersect()

6 weeks agosd-radv: allow to send multiple routes or prefix64 that have intersection with others
Yu Watanabe [Tue, 23 Apr 2024 04:09:52 +0000 (13:09 +0900)] 
sd-radv: allow to send multiple routes or prefix64 that have intersection with others

I cannot find any RFC that states we should not send multiple route
prefix or pref64 options that have intersection with others.
Moreover, each route prefix option has preference field, thus, user may
want to send e.g. a prefix with the normal preference, and another sub
prefix with the high preference. Previously, such configuration was
prohibited. Let's allow that now.

6 weeks agosd-radv: send RA on update in caller side
Yu Watanabe [Tue, 23 Apr 2024 03:34:47 +0000 (12:34 +0900)] 
sd-radv: send RA on update in caller side

As the caller may want to update multiple prefixes and friends.
Let's not automatically announce on update in library side.

Currently, only prefix is updated during running. Hence, this does not
change any effective behavior.

6 weeks agoMerge pull request #32438 from YHNdnzj/taint-cleanup
Yu Watanabe [Wed, 24 Apr 2024 02:44:06 +0000 (11:44 +0900)] 
Merge pull request #32438 from YHNdnzj/taint-cleanup

core/manager: clean up taint strings

6 weeks agocore/manager: add unmerged-bin taint 32438/head
Mike Yuan [Tue, 23 Apr 2024 14:33:10 +0000 (22:33 +0800)] 
core/manager: add unmerged-bin taint

6 weeks agocore/manager: rearrange taint tags
Mike Yuan [Tue, 23 Apr 2024 14:20:57 +0000 (22:20 +0800)] 
core/manager: rearrange taint tags

6 weeks agocore/manager: drop obsolete cgroup taint string
Mike Yuan [Tue, 23 Apr 2024 13:24:55 +0000 (21:24 +0800)] 
core/manager: drop obsolete cgroup taint string

Wwe can't boot on systems without cgroup anyway
(even cgroup v1 will be gone pretty soon).

6 weeks agomount-setup: use mount_verbose_full where appropriate
Mike Yuan [Tue, 23 Apr 2024 14:05:09 +0000 (22:05 +0800)] 
mount-setup: use mount_verbose_full where appropriate

6 weeks agoMerge pull request #32437 from keszybz/notify-fixups-split-out
Luca Boccassi [Tue, 23 Apr 2024 17:36:53 +0000 (19:36 +0200)] 
Merge pull request #32437 from keszybz/notify-fixups-split-out

Two fixups for sd-notify split out from #32093

6 weeks agoMerge pull request #32434 from poettering/cryptenroll-prefer-var
Luca Boccassi [Tue, 23 Apr 2024 16:45:43 +0000 (18:45 +0200)] 
Merge pull request #32434 from poettering/cryptenroll-prefer-var

cryptenroll: prefer looking at /var/ instead of /

6 weeks agoAdd self-contained Python sd_notify example.
Simon Fowler [Tue, 23 Apr 2024 04:27:58 +0000 (14:27 +1000)] 
Add self-contained Python sd_notify example.

This complements the existing C example.

6 weeks agosysext: do not return 0 if `unmerge()` fails in the `refresh()` function.
Antonio Alvarez Feijoo [Fri, 5 Apr 2024 13:24:40 +0000 (15:24 +0200)] 
sysext: do not return 0 if `unmerge()` fails in the `refresh()` function.

Actually, return the result of `unmerge()` if it is called in the `refresh()`
function.

Fixes 8662fcbcf1f31725998bd1ebe706ac813b053962

6 weeks agoMerge pull request #32435 from YHNdnzj/followup
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2024 13:47:57 +0000 (15:47 +0200)] 
Merge pull request #32435 from YHNdnzj/followup

Some follow-ups for recent PRs

6 weeks agoupdate NEWS 32434/head
Lennart Poettering [Tue, 23 Apr 2024 11:17:10 +0000 (13:17 +0200)] 
update NEWS

6 weeks agocryptenroll: use [] in --help text to indicate block device argument is now optional
Lennart Poettering [Tue, 23 Apr 2024 10:55:17 +0000 (12:55 +0200)] 
cryptenroll: use [] in --help text to indicate block device argument is now optional

6 weeks agocryptenroll: default to block device backing /var/ rather than /
Lennart Poettering [Tue, 23 Apr 2024 10:35:38 +0000 (12:35 +0200)] 
cryptenroll: default to block device backing /var/ rather than /

With 1df4b21abdb9e562805a7b006d179507182f845e we started to default to
enrolling into the LUKS device backing the root fs if none was specified
(and no wipe operation is used). This changes to look for /var/ instead.

On most systems /var/ is going to be on the root fs, hence this change
is with little effect.

However, on systems where / and /var/ is separate it makes more sense to
default to /var/ because that's where the persistent and variable data
is placed (i.e.  where LUKS should be used) while / doesn't really have
to be variable, could as well be immutable, or ephemeral. Hence /var/
should be a safer default.

Or to say this differently: I think it makes sense to support systems
with /var/ being on / well. I also think it makes sense to support
systems with them being separate, and /var/ being variable and
persistent. But any other kind of system I find much less interesting to
support, and in that case people should just specify the device name.

Also, while we are at it, tighten the checks a bit, insist on a dm-crypt
+ LUKS superblock before continuing.

And finally, let's print a short message indicating the device we
operate on.

6 weeks agojournal: do not rotate unrelated journal files when full or corrupted
Yu Watanabe [Mon, 22 Apr 2024 08:25:31 +0000 (17:25 +0900)] 
journal: do not rotate unrelated journal files when full or corrupted

When we fail to add an entry to a journal file, typically when the file
is full or corrupted, it is not necessary to rotate other journal files.

Not only that's unnecessary, rotating all journal files allows
unprivileged users to wipe system or other user's journals by writing
many journal entries to their own user journal file.

Let's rotate all journal files only when
- it is really requested by a privileged user (e.g. by journalctl --rotate), or
- the system time jumps backwards.
And, otherwise rotate only the journal file we are currently writing.

6 weeks agocore: Limit terminal reset using ANSI sequences to /dev/console
Daan De Meyer [Mon, 22 Apr 2024 20:58:49 +0000 (22:58 +0200)] 
core: Limit terminal reset using ANSI sequences to /dev/console

Doing this in reset_terminal_fd() is a bit too invasive, see
https://github.com/systemd/systemd/pull/32406#issuecomment-2070923583.

Let's only do this for /dev/console so that we work around weird firmwares
disabling line-wrapping, but avoid messing too much with other things.

While we're at it, let's handle more than just line wrapping, and do a
more general reset of stuff to get the terminal into a sane state.

6 weeks agonetwork: suggest using "networkctl edit" instead of copying manually 32435/head
Mike Yuan [Tue, 23 Apr 2024 11:51:07 +0000 (19:51 +0800)] 
network: suggest using "networkctl edit" instead of copying manually

6 weeks agocryptenroll: sort includes
Mike Yuan [Tue, 23 Apr 2024 10:38:34 +0000 (18:38 +0800)] 
cryptenroll: sort includes

Follow-up for 1df4b21abdb9e562805a7b006d179507182f845e

6 weeks agocore/service: also allow updating main pid when SERVICE_STOP
Mike Yuan [Tue, 23 Apr 2024 10:37:26 +0000 (18:37 +0800)] 
core/service: also allow updating main pid when SERVICE_STOP

Follow-up for f5b72af50d2bb6879f0e6d8ea10f34e9c111dcd1

See also: https://github.com/systemd/systemd/pull/32120#discussion_r1575992623

6 weeks agoMerge pull request #32428 from poettering/sd-notify-reboot-param
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2024 11:31:40 +0000 (13:31 +0200)] 
Merge pull request #32428 from poettering/sd-notify-reboot-param

pid1: send shutdown type and reboot argument to supervisor via sd_notify()

6 weeks agocryptenroll: use root device by default
Ludwig Nussel [Wed, 28 Feb 2024 13:46:05 +0000 (14:46 +0100)] 
cryptenroll: use root device by default

6 weeks agoMerge pull request #32433 from DaanDeMeyer/fix
Daan De Meyer [Tue, 23 Apr 2024 10:28:48 +0000 (12:28 +0200)] 
Merge pull request #32433 from DaanDeMeyer/fix

mkosi: Fix Arch Linux package glob

6 weeks agomanager: Improve freeze/thaw for unrealized cgroup
Adrian Vovk [Mon, 22 Apr 2024 21:21:58 +0000 (17:21 -0400)] 
manager: Improve freeze/thaw for unrealized cgroup

This is a follow-up for e50bfc89cefd4aafedaf2a7eacbf8b5ed80b134e

In that commit, we made Freeze/Thaw work with unrealized cgroups.
However, the unit was left in a strange state: it would be frozen by the
kernel but systemd would be unaware, and it remained possible to try and
realize the cgroup while the unit is supposed to be frozen. This commit
fixes the state tracking and prevents cgroups from being realized when
the unit is frozen.

6 weeks agoMerge pull request #32427 from poettering/systemctl-help-missing
Lennart Poettering [Tue, 23 Apr 2024 10:11:53 +0000 (12:11 +0200)] 
Merge pull request #32427 from poettering/systemctl-help-missing

systemctl: add missing --help entries

6 weeks agobuild(deps): bump pkg/debian from `30c77a7` to `733ac7c`
dependabot[bot] [Tue, 23 Apr 2024 09:40:35 +0000 (09:40 +0000)] 
build(deps): bump pkg/debian from `30c77a7` to `733ac7c`

Bumps pkg/debian from `30c77a7` to `733ac7c`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
6 weeks agomkosi: Configure lower retention limit for package artifacts 32433/head
Daan De Meyer [Tue, 23 Apr 2024 09:58:44 +0000 (11:58 +0200)] 
mkosi: Configure lower retention limit for package artifacts

This is more than 0.5G per job, so let's drop the retention to
4 days to make sure we don't hit github's limits.

6 weeks agomkosi: Fix Arch Linux package glob
Daan De Meyer [Tue, 23 Apr 2024 09:53:28 +0000 (11:53 +0200)] 
mkosi: Fix Arch Linux package glob

7 weeks agoservice: allow MainPID= updates during stop of the service
Michal Sekletar [Fri, 5 Apr 2024 15:34:23 +0000 (17:34 +0200)] 
service: allow MainPID= updates during stop of the service

Example use case is a migration of MainPID to an auxiliary scope.

7 weeks agoMerge pull request #32352 from DaanDeMeyer/test
Daan De Meyer [Tue, 23 Apr 2024 09:27:23 +0000 (11:27 +0200)] 
Merge pull request #32352 from DaanDeMeyer/test

test: Various mkosi integration test improvements

7 weeks agoupdate TODO 32428/head
Lennart Poettering [Tue, 23 Apr 2024 08:14:24 +0000 (10:14 +0200)] 
update TODO

7 weeks agosystemctl: set reboot argument for most forms of shutdown, not just plain reboots
Lennart Poettering [Tue, 23 Apr 2024 08:14:41 +0000 (10:14 +0200)] 
systemctl: set reboot argument for most forms of shutdown, not just plain reboots

This doesn't hurt anyway, and is useful now that we propagate the string
via sd_notify() too.

7 weeks agoshutdown: send an sd_notify() message on shutdown with the shutdown reason and boot...
Lennart Poettering [Mon, 22 Apr 2024 15:32:12 +0000 (17:32 +0200)] 
shutdown: send an sd_notify() message on shutdown with the shutdown reason and boot param

This is kinda nice in containers, to exfiltrate a string from the
container on shutdown.

7 weeks agomkosi: Run integration tests in CI 32352/head
Daan De Meyer [Fri, 19 Apr 2024 08:54:38 +0000 (10:54 +0200)] 
mkosi: Run integration tests in CI

We do the image build and run the tests in a btrfs loopback so we
can make use of btrfs subvolumes and COW to keep the disk space
requirements to a minimum and speed up the ephemeral copies we make
of the image to run the tests.

We also switch to building debug packages and publishing the built
packages as artifacts.

7 weeks agotest: Various mkosi integration test improvements
Daan De Meyer [Fri, 19 Apr 2024 07:17:58 +0000 (09:17 +0200)] 
test: Various mkosi integration test improvements

- Stop using logging module since the default output formatting is
  pretty bad. Prefer print() for now.
- Log less, logging the full mkosi command line is rather verbose,
  especially when it contains multi-line dropins.
- Streamline the journalctl command we output for debugging failed
  tests.
- Don't force usage of the disk image format.
- Don't force running without unit tests.
- Don't force disabling RuntimeBuildSources.
- Update documentation to streamline the command for running a single
  test and remove sudo as it's not required anymore.
- Improve the console output by having the test unit's output logged
  to both the journal and the console.
- Disable journal console log forwarding as we have journal forwarding
  as a better alternative.
- Delete existing journal file before running test.
- Delete journal files of succeeded tests to reduce disk usage.
- Rename system_mkosi target to just mkosi
- Pass in mkosi source directory explicitly to accomodate arbitrary
  build directory locations.
- Add test interactive debugging if stdout is connected to a tty
- Stop explicitly using the 'system' image since it'll likely be
  dropped soon.
- Only forward journal if we're not running in debugging mode.
- Stop using testsuite.target and instead just add the necessary
  extras to the main testsuite unit via the credential dropin.
- Override type to idle so test output is not interleaved with
  status output.
- Don't build mkosi target by default
- Always add the mkosi target if mkosi is found
- Remove dependency of the integration tests on the mkosi target
  as otherwise the image is always built, even though we configure
  it to not be built by default.
- Move mkosi output, cache and build directory into build/ so that
  invocations from meson and regular invocations share the same
  directories.
- Various aesthetic cleanups.

7 weeks agomkosi: Deal with ubuntu's special debug packages
Daan De Meyer [Tue, 23 Apr 2024 07:09:37 +0000 (09:09 +0200)] 
mkosi: Deal with ubuntu's special debug packages

Building debug packages on ubuntu requires the "debug" option to be
specified explicitly. Debug packages on Ubuntu have the .ddeb extension,
so let's make sure we handle that by copying the .ddeb packages in the
build script as well.

7 weeks agomkosi: Use -fdebug-prefix-map= instead of -ffile-prefix-map=
Daan De Meyer [Mon, 22 Apr 2024 21:45:50 +0000 (23:45 +0200)] 
mkosi: Use -fdebug-prefix-map= instead of -ffile-prefix-map=

-ffile-prefix-map= implies -fmacro-prefix-map= which is incompatible
with our definition of PROJECT_FILE.

See https://github.com/systemd/systemd/issues/32417.

-fdebug-prefix-map= only affects debuginfo without affecting macros.

7 weeks agomkosi: Update to latest
Daan De Meyer [Mon, 22 Apr 2024 13:26:35 +0000 (15:26 +0200)] 
mkosi: Update to latest

7 weeks agosystemctl: add forgotten --after/--before to --help text 32427/head
Lennart Poettering [Tue, 23 Apr 2024 07:58:05 +0000 (09:58 +0200)] 
systemctl: add forgotten --after/--before to --help text

Follow-up for: afba41995de65d8f378b138ea6d9804be32625a3

7 weeks agosystemctl: add forgotten --reboot-argument= to --help text
Lennart Poettering [Mon, 22 Apr 2024 16:05:52 +0000 (18:05 +0200)] 
systemctl: add forgotten --reboot-argument= to --help text

Follow-up for: dae710bef121bfc379423d9d75e7d792074ab71c

7 weeks agosystemctl: add forgotten --message= to --help text
Lennart Poettering [Mon, 22 Apr 2024 16:04:34 +0000 (18:04 +0200)] 
systemctl: add forgotten --message= to --help text

Follow-up for: 9ef15026c0e7e6600372056c43442c99ec53746e

7 weeks agomkosi: mask isc-dhcp-server
Luca Boccassi [Mon, 22 Apr 2024 23:01:39 +0000 (00:01 +0100)] 
mkosi: mask isc-dhcp-server

isc-dhcp-server does not ship units, only sysv scripts, so the mkosi
presets that disable it have no effect. The generated unit is started on
each boot and fails, causing delays and noise.

Mask it so that the generated unit is overridden. It is installed only
to bring in binaries used by the networkd tests anyway.

7 weeks agoMerge pull request #32413 from yuwata/network-radv-validator
Luca Boccassi [Mon, 22 Apr 2024 23:02:34 +0000 (01:02 +0200)] 
Merge pull request #32413 from yuwata/network-radv-validator

network/radv: several cleanups for validating configs

7 weeks agonetwork: add .link file to match 80-namespace.network
Lennart Poettering [Mon, 22 Apr 2024 15:30:58 +0000 (17:30 +0200)] 
network: add .link file to match 80-namespace.network

This file makes clear the interface shall be owned by networkd.

This does what 658169e6d307b5b1aea0d82b4a6430fa9d529c68 did for nspawn's
regular devices for the devices defined through
8aee931e7ae1adb01eeac0e1e4c0aef6ed3969ec too.

7 weeks agonetwork: add "mac" to alternatives name policy by default
Lennart Poettering [Mon, 22 Apr 2024 15:30:11 +0000 (17:30 +0200)] 
network: add "mac" to alternatives name policy by default

Alternative names are basically free, hence add "mac" there too, to make
it easier to see what names could be used as primary options too.