]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest: add test cases for issue #26839 in TEST-03-JOBS 26844/head
Mike Yuan [Thu, 16 Mar 2023 08:23:17 +0000 (16:23 +0800)] 
test: add test cases for issue #26839 in TEST-03-JOBS

2 years agocore: introduce UNIT_ATOM_PROPAGATE_STOP_GRACEFUL for PropagatesStopTo=
Mike Yuan [Mon, 3 Jul 2023 23:28:33 +0000 (07:28 +0800)] 
core: introduce UNIT_ATOM_PROPAGATE_STOP_GRACEFUL for PropagatesStopTo=

Follow-up for 017a7ba4f406adcf69d6b3ec15b9f2d9ed5ad853

Before this commit, when a unit that is restarting propagates stop
to other units, it can also depend on them, which results in
job type conflict and thus failure to pull in the dependencies.

So, let's introduce a new dependency atom UNIT_ATOM_PROPAGATE_STOP_GRACEFUL,
and use it for PropagatesStopTo=. It will enqueue a restart job if
there's already a start job, which meets the ultimate goal and avoids
job type conflict.

Fixes #26839

2 years agocore/transaction: return early when appropriate to reduce nesting
Mike Yuan [Mon, 3 Jul 2023 22:55:55 +0000 (06:55 +0800)] 
core/transaction: return early when appropriate to reduce nesting

2 years agoman/systemctl: document --job-mode=restart-dependencies
Mike Yuan [Wed, 5 Jul 2023 00:14:27 +0000 (08:14 +0800)] 
man/systemctl: document --job-mode=restart-dependencies

Follow-up for 09d04ad325473e05e23e6ba8382d7de1dd819bda

2 years agojournal-remote: upload journals from namespace
Igor Tsiglyar [Mon, 3 Jul 2023 13:51:32 +0000 (16:51 +0300)] 
journal-remote: upload journals from namespace

2 years agohwdb : add support for Archos 101 Cesium Educ to 60-sensor.hwdb
Thomas Genty [Tue, 4 Jul 2023 13:41:57 +0000 (15:41 +0200)] 
hwdb : add support for Archos 101 Cesium Educ to 60-sensor.hwdb

2 years agoNEWS/--help: correct/be clearer on bootclt -R vs. -RR
Lennart Poettering [Tue, 4 Jul 2023 11:04:56 +0000 (13:04 +0200)] 
NEWS/--help: correct/be clearer on bootclt -R vs. -RR

The NEWS file was simply wrong. Let's also improve the --help text on
this.

Fixes: #28221
2 years agohibernate-resume-generator: downgrade 'noresume' log message
Lennart Poettering [Tue, 4 Jul 2023 09:47:19 +0000 (11:47 +0200)] 
hibernate-resume-generator: downgrade 'noresume' log message

This log message is shown pretty regular at boot in various scenarios
(such as CI builds), and it's not a reason for any concern, it's just the
immediate effect of explicit configuration. Hence let's downgrade from
LOG_NOTICE to LOG_INFO so that it is still usually in the boot output,
but not particularly highlighted, since there's really no reason to.

2 years agosystemctl: implement a new "whoami" verb, that just returns unit of caller/PID
Lennart Poettering [Mon, 3 Jul 2023 12:36:14 +0000 (14:36 +0200)] 
systemctl: implement a new "whoami" verb, that just returns unit of caller/PID

2 years agotest: wait for the interface to become routable after reconfiguring
Frantisek Sumsal [Mon, 3 Jul 2023 19:38:42 +0000 (21:38 +0200)] 
test: wait for the interface to become routable after reconfiguring

Since 6e8477edd3 TEST-75 started failing with:

[  571.468298] testsuite-75.sh[46]: + for addr in "${DNS_ADDRESSES[@]}"
[  571.468298] testsuite-75.sh[46]: + run delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.468899] testsuite-75.sh[562]: + tee /tmp/tmp.qKlHPbCCJZ
[  571.469317] testsuite-75.sh[561]: + delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.501381] testsuite-75.sh[562]: ;; network unreachable resolving 'mail.signed.test/A/IN': fd00:dead:beef:cafe::1#53
[  571.501564] testsuite-75.sh[562]: ;; resolution failed: SERVFAIL
[  571.515457] testsuite-75.sh[46]: + grep -qF '; fully validated' /tmp/tmp.qKlHPbCCJZ

Let's wait for the dns0 interface to become routable again after
re-enabling IPv6 to, hopefully, mitigate this.

2 years agoMerge pull request #28245 from rpigott/dhcp6-relax-assert
Yu Watanabe [Mon, 3 Jul 2023 23:06:13 +0000 (08:06 +0900)] 
Merge pull request #28245 from rpigott/dhcp6-relax-assert

relax data assert in dchp6_option_parse_string

2 years agoMerge pull request #28215 from poettering/start-as-restart
Mike Yuan [Mon, 3 Jul 2023 21:54:56 +0000 (05:54 +0800)] 
Merge pull request #28215 from poettering/start-as-restart

pid1: enqueue auto-restart job for the unit itself as JOB_START and for dependending units as JOB_RESTART

2 years agotest-network: add test for an invalid captive portal uri 28245/head
Ronan Pigott [Mon, 3 Jul 2023 20:15:47 +0000 (13:15 -0700)] 
test-network: add test for an invalid captive portal uri

This could probably be extended to include many more invalid uri

2 years agodhcp6: relax data assert in dhcp6_option_parse_string
Ronan Pigott [Mon, 3 Jul 2023 20:02:47 +0000 (13:02 -0700)] 
dhcp6: relax data assert in dhcp6_option_parse_string

dhcp6_option_parse_string is intended to clear strings with length 0,
for consistency. The data assert is too strict for this purpose, so we
will allow data || data_len == 0, similar to other dhcp6_option_parse*
helpers.

Fixes: fde788601be8 ("dhcp6-client: parse RFC8910 captive portal dhcp6 option")
2 years agoMerge pull request #28232 from rpigott/ndisc-captive-portal-mfree
Yu Watanabe [Mon, 3 Jul 2023 16:27:20 +0000 (01:27 +0900)] 
Merge pull request #28232 from rpigott/ndisc-captive-portal-mfree

ndisc: clear ndisc captive portal value on bogus zero-len option

2 years agologinctl,machinectl: use same ansi formatting in --help texts as in systemctl
Lennart Poettering [Mon, 3 Jul 2023 11:33:47 +0000 (13:33 +0200)] 
loginctl,machinectl: use same ansi formatting in --help texts as in systemctl

2 years agounits: skip systemd-battery-check in environments where it doesn't make sense
Lennart Poettering [Mon, 3 Jul 2023 11:36:08 +0000 (13:36 +0200)] 
units: skip systemd-battery-check in environments where it doesn't make sense

Let's condition the service so that it doesn't run where we aren't
directly run on baremetal, or where no power sources are discovered at
all.

2 years agocore/service: show correct restart usec for services in SERVICE_AUTO_RESTART_QUEUED 28215/head
Mike Yuan [Mon, 3 Jul 2023 14:32:36 +0000 (22:32 +0800)] 
core/service: show correct restart usec for services in SERVICE_AUTO_RESTART_QUEUED

Follow-up for #28215

We can now correctly distinguish enqueued auto-restarts
from those that are still pending. Let's take advantage
of that.

2 years agotest: add test case for recent OnSuccess=/OnFailure= state machine changes
Lennart Poettering [Mon, 3 Jul 2023 12:49:46 +0000 (14:49 +0200)] 
test: add test case for recent OnSuccess=/OnFailure= state machine changes

2 years agocore: introduce a new job mode JOB_RESTART_DEPENDENCIES
Lennart Poettering [Fri, 30 Jun 2023 16:17:06 +0000 (18:17 +0200)] 
core: introduce a new job mode JOB_RESTART_DEPENDENCIES

This new job mode will enqueue a start job for a unit, and all units
depending on the unit will get a restart job enqueued. This is then used
for automatic sevice restarts: the unit itself is only started, the
depending units restarted. This way the unit will not go down
unnecessarily, triggering OnSuccess= needlessly.

This also introduces a new state SERVICE_AUTO_RESTART_QUEUED that is
entered once the restart jobs are enqueued. Previously we'd stay in
SERVICE_AUTO_RESTART, but that's problematic, since we'd lose
information whether we still need to enqueue the restart job during a
serialization/deserialization cycle or not. By having an explicit state
for this we know exactly whether we still need to enqueue the job or
not. It's also good since when we are in SERVICE_AUTO_RESTART_QUEUED we
want to act on unit_start(), but on SERVICE_AUTO_RESTART we want to wait
for the holdoff time to pass before we act on unit_start().

Fixes: #27722
2 years agoservice: re-linebreak some comments matching current coding style
Lennart Poettering [Fri, 30 Jun 2023 16:16:55 +0000 (18:16 +0200)] 
service: re-linebreak some comments matching current coding style

2 years agoMerge pull request #28230 from yuwata/network-wait-address-configure
Luca Boccassi [Mon, 3 Jul 2023 14:04:32 +0000 (15:04 +0100)] 
Merge pull request #28230 from yuwata/network-wait-address-configure

network: delay to configure address untill it is removed on reconfigure

2 years agondisc: reject malformed captive portal URI with EBADMSG 28232/head
Ronan Pigott [Mon, 3 Jul 2023 10:07:57 +0000 (03:07 -0700)] 
ndisc: reject malformed captive portal URI with EBADMSG

This allows the correct, gracious, error handling to follow up in the
ndisc handler. Otherwise, an internal error is assumed and the interface
disabled.

Fixes: 9747955d2d60 ("ndisc: parse RFC8910 captive portal ipv6ra option")
2 years agoupdate TODO
Lennart Poettering [Mon, 3 Jul 2023 09:59:45 +0000 (11:59 +0200)] 
update TODO

2 years agondisc: clear ndisc captive portal value on bogus zero-len option
Ronan Pigott [Mon, 3 Jul 2023 07:36:04 +0000 (00:36 -0700)] 
ndisc: clear ndisc captive portal value on bogus zero-len option

This value was freed but erroneously never cleared, leading to
use-after-free.

Fixes: 9747955d2d60 ("ndisc: parse RFC8910 captive portal ipv6ra option")
2 years agotest-network: add test for static route with preferred source 28230/head
Yu Watanabe [Mon, 3 Jul 2023 07:04:30 +0000 (16:04 +0900)] 
test-network: add test for static route with preferred source

This adds possible reproducer for issue #28009 (though, the issue is
highly racy, hence this may not trigger the issue reliably).

2 years agotest-network: check route more strictly
Yu Watanabe [Mon, 3 Jul 2023 07:03:50 +0000 (16:03 +0900)] 
test-network: check route more strictly

2 years agonetwork: delay to configure address until it is removed on reconfigure
Yu Watanabe [Mon, 3 Jul 2023 06:43:53 +0000 (15:43 +0900)] 
network: delay to configure address until it is removed on reconfigure

When we request an address that already exists and is under removing,
we need to wait for the address being removed. Otherwise, configuration
of a route whose preferred source is the address will fail.

Fixes #28009.
Replaces #28088.

2 years agonetwork: constify several functions
Yu Watanabe [Mon, 3 Jul 2023 07:00:20 +0000 (16:00 +0900)] 
network: constify several functions

2 years agoMerge pull request #28132 from rpigott/dhcp-captive-portal
Yu Watanabe [Mon, 3 Jul 2023 05:51:56 +0000 (14:51 +0900)] 
Merge pull request #28132 from rpigott/dhcp-captive-portal

Implement RFC8910: captive portal dhcp options

2 years agohwdb: Add override for headset form-factors
Bastien Nocera [Sun, 2 Jul 2023 09:44:57 +0000 (11:44 +0200)] 
hwdb: Add override for headset form-factors

Correct the SOUND_FORM_FACTOR property for Steelseries Arctis headsets.
The USB IDs were all gathered from HeadsetControl[1].

[1]: https://github.com/Sapd/HeadsetControl

2 years agoMerge pull request #28226 from mrc0mmand/coverity-fixes
Luca Boccassi [Sun, 2 Jul 2023 14:54:56 +0000 (15:54 +0100)] 
Merge pull request #28226 from mrc0mmand/coverity-fixes

A couple of Coverity-related fixes

2 years agotree-wide: explicitly ignore return value in a couple more places 28226/head
Frantisek Sumsal [Sun, 2 Jul 2023 09:39:00 +0000 (11:39 +0200)] 
tree-wide: explicitly ignore return value in a couple more places

Resolves:
  - CID#1490777
  - CID#1498366
  - CID#1508639
  - CID#1509084
  - CID#1509086
  - CID#1509087

2 years agounit: drop an unused assignment
Frantisek Sumsal [Sun, 2 Jul 2023 09:22:50 +0000 (11:22 +0200)] 
unit: drop an unused assignment

Resolves: CID#1509244

2 years agovirt: drop an unused assignment
Frantisek Sumsal [Sun, 2 Jul 2023 09:09:09 +0000 (11:09 +0200)] 
virt: drop an unused assignment

As `v` gets overwritten by the following detect_vm_cpuid() call.

Resolves: CID#1509247

2 years agotree-wide: "<n>bit" → "<n>-bit"
Zbigniew Jędrzejewski-Szmek [Sat, 1 Jul 2023 21:33:20 +0000 (15:33 -0600)] 
tree-wide: "<n>bit" → "<n>-bit"

In some places, "<n> bits" is used when more appropriate.

2 years agotest: drop an unused assignment
Frantisek Sumsal [Sun, 2 Jul 2023 09:04:38 +0000 (11:04 +0200)] 
test: drop an unused assignment

Unused since 788c2d9523.
Resolves: CID#1509248

2 years agotest-network: add tests for captive portal dhcp options 28132/head
Ronan Pigott [Thu, 29 Jun 2023 23:38:55 +0000 (16:38 -0700)] 
test-network: add tests for captive portal dhcp options

2 years agonetworkctl: show captive portal configuration in link status
Ronan Pigott [Thu, 29 Jun 2023 23:38:26 +0000 (16:38 -0700)] 
networkctl: show captive portal configuration in link status

2 years agonetworkd: include captive portal information in link json description
Ronan Pigott [Thu, 29 Jun 2023 23:36:50 +0000 (16:36 -0700)] 
networkd: include captive portal information in link json description

2 years agonetwork: Introduce UseCaptivePortal IPv6RA option
Ronan Pigott [Thu, 29 Jun 2023 23:58:03 +0000 (16:58 -0700)] 
network: Introduce UseCaptivePortal IPv6RA option

Accepts a boolean. When enabled retains captive portal configuration
advertised by the router.

2 years agonetwork: Introduce UseCaptivePortal DHCPv6 option
Ronan Pigott [Thu, 29 Jun 2023 23:33:57 +0000 (16:33 -0700)] 
network: Introduce UseCaptivePortal DHCPv6 option

Acepts a boolean. When enabled requests and retains captive portal
configuration from the DHCPv6 server.

2 years agonetwork: Introduce UseCaptivePortal DHCPv4 option
Ronan Pigott [Thu, 29 Jun 2023 23:30:31 +0000 (16:30 -0700)] 
network: Introduce UseCaptivePortal DHCPv4 option

Accepts a boolean. When enabled, UseCaptivePortal will request and
retain the captive portal configuration from the DHCP server.

2 years agondisc: parse RFC8910 captive portal ipv6ra option
Ronan Pigott [Thu, 29 Jun 2023 23:22:45 +0000 (16:22 -0700)] 
ndisc: parse RFC8910 captive portal ipv6ra option

2 years agoNEWS: reword/fix/extend the entries for v254
Zbigniew Jędrzejewski-Szmek [Sat, 1 Jul 2023 20:07:25 +0000 (14:07 -0600)] 
NEWS: reword/fix/extend the entries for v254

2 years agoNEWS: drop doubled space after period
Zbigniew Jędrzejewski-Szmek [Sat, 1 Jul 2023 19:54:14 +0000 (13:54 -0600)] 
NEWS: drop doubled space after period

Emacs does this, but it doesn't make much sense. It makes even
less sense if done only in some places.

2 years agobuild(deps): bump github/codeql-action from 2.3.5 to 2.20.1
dependabot[bot] [Sat, 1 Jul 2023 10:38:05 +0000 (10:38 +0000)] 
build(deps): bump github/codeql-action from 2.3.5 to 2.20.1

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.5 to 2.20.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/0225834cc549ee0ca93cb085b92954821a145866...f6e388ebf0efc915c6c5b165b019ee61a6746a38)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/labeler from 4.0.4 to 4.2.0
dependabot[bot] [Sat, 1 Jul 2023 09:08:48 +0000 (09:08 +0000)] 
build(deps): bump actions/labeler from 4.0.4 to 4.2.0

Bumps [actions/labeler](https://github.com/actions/labeler) from 4.0.4 to 4.2.0.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/0776a679364a9a16110aac8d0f40f5e11009e327...0967ca812e7fdc8f5f71402a1b486d5bd061fe20)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/checkout from 3.5.2 to 3.5.3
dependabot[bot] [Sat, 1 Jul 2023 09:08:49 +0000 (09:08 +0000)] 
build(deps): bump actions/checkout from 3.5.2 to 3.5.3

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e5e7e5ab8b370d6c329ec480221332ada57f0ab...c85c95e3d7251135ab7dc9ce3241c5835cc595a9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump ossf/scorecard-action from 2.1.3 to 2.2.0
dependabot[bot] [Sat, 1 Jul 2023 09:08:52 +0000 (09:08 +0000)] 
build(deps): bump ossf/scorecard-action from 2.1.3 to 2.2.0

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/80e868c13c90f172d68d1f4501dee99e2479f7af...08b4669551908b1024bb425080c797723083c031)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #28187 from bluca/sbat
Luca Boccassi [Fri, 30 Jun 2023 20:55:58 +0000 (21:55 +0100)] 
Merge pull request #28187 from bluca/sbat

ukify: merge .sbat sections from stub and kernel

2 years agoMerge pull request #28211 from poettering/unit-abstract
Lennart Poettering [Fri, 30 Jun 2023 20:51:15 +0000 (22:51 +0200)] 
Merge pull request #28211 from poettering/unit-abstract

remove some explicit unit type checks from generic code, and make them abstract

2 years agomount: make unit_start() mount ratelimiting check generic 28211/head
Lennart Poettering [Fri, 30 Jun 2023 13:56:40 +0000 (15:56 +0200)] 
mount: make unit_start() mount ratelimiting check generic

Let's move this into a vtable callout, so that unit.c doesn't check for
explicit unit types anymore.

(This is preparation for a future where we do a similar check for the
automount logic, or the swap logic.)

2 years agooom: don't encode whether unit types can do oomd hookup a second time
Lennart Poettering [Fri, 30 Jun 2023 13:50:33 +0000 (15:50 +0200)] 
oom: don't encode whether unit types can do oomd hookup a second time

We already encode this in UnitVTable, hence use it. Even if it means
we'll do some minor extra iterations.

2 years agopid1: also encode whether to send plymouth notifications in UnitVTable
Lennart Poettering [Fri, 30 Jun 2023 13:35:49 +0000 (15:35 +0200)] 
pid1: also encode whether to send plymouth notifications in UnitVTable

2 years agounit: don't encode literally which unit types to generate audit events for
Lennart Poettering [Fri, 30 Jun 2023 13:31:41 +0000 (15:31 +0200)] 
unit: don't encode literally which unit types to generate audit events for

Let's abstract this a bit, and keep this info purely in UnitVTable.

2 years agodbus-cgroup: Make sure we overwrite cpuset properties in drop-in
Daan De Meyer [Fri, 30 Jun 2023 14:06:54 +0000 (16:06 +0200)] 
dbus-cgroup: Make sure we overwrite cpuset properties in drop-in

The DBUS property setter overwrites the value of the property but
writes a drop-in that extends the value. Let's make sure the drop-in
overwrites the property value as well by assigning the empty string
first.

2 years agobattery-check: rework unit
Lennart Poettering [Fri, 30 Jun 2023 15:09:21 +0000 (17:09 +0200)] 
battery-check: rework unit

Let's rename the unit to systemd-battery-check.service. We usually want
to name our own unit files like our tools they wrap, in particular if
they are entirely defined by us (i.e. not just wrappers of foreign
concepts)

While we are at it, also hook this in from initrd.target, and order it
against initrd-root-device.target so that it runs before the root device
is possibly written to (i.e. mounted or fsck'ed).

This is heavily inspired by @aafeijoo-suse's PR #28208, but quite
different ;-)

2 years agotest: fix test_vxlan with the latest iproute2
Frantisek Sumsal [Fri, 30 Jun 2023 15:08:22 +0000 (17:08 +0200)] 
test: fix test_vxlan with the latest iproute2

Some options were renamed and some options with default values are not
shown unless -d(etails) is repeated.

See: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=1215e9d3862387353d8672296cb4c6c16e8cbb72

2 years agoREADME: strenghten wording regarding static libs
Lennart Poettering [Fri, 30 Jun 2023 15:39:30 +0000 (17:39 +0200)] 
README: strenghten wording regarding static libs

static versions of libsystems.so are not really supportable, and
encourages mix&match which we cannot really support. Make the wording
about this stronger in the README, since people apparently don'd read to
the last paragraph.

2 years agoboot: measure .sbat section 28187/head
Luca Boccassi [Thu, 29 Jun 2023 22:41:48 +0000 (23:41 +0100)] 
boot: measure .sbat section

We are now merging .sbat sections from sd-stub and kernel image, so
measure it in PCR11.

2 years agoukify: merge .sbat sections from stub and kernel
Luca Boccassi [Thu, 29 Jun 2023 00:05:36 +0000 (01:05 +0100)] 
ukify: merge .sbat sections from stub and kernel

If the kernel contains a .sbat section (they should start soon) then merge
it with the stub's so that revocations can apply to either component.

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

2 years agostat-util: Make sure we trigger automounts when looking for ESP/XBOOTLDR
Daan De Meyer [Thu, 29 Jun 2023 13:38:35 +0000 (15:38 +0200)] 
stat-util: Make sure we trigger automounts when looking for ESP/XBOOTLDR

Fixes #25417

2 years agodhcp6-client: parse RFC8910 captive portal dhcp6 option
Ronan Pigott [Thu, 29 Jun 2023 22:55:21 +0000 (15:55 -0700)] 
dhcp6-client: parse RFC8910 captive portal dhcp6 option

2 years agodhcp-client: parse RFC8910 captive portal dhcp option
Ronan Pigott [Thu, 29 Jun 2023 22:53:02 +0000 (15:53 -0700)] 
dhcp-client: parse RFC8910 captive portal dhcp option

2 years agocore: reorder systemd arguments on reexec
Frantisek Sumsal [Thu, 29 Jun 2023 11:31:19 +0000 (13:31 +0200)] 
core: reorder systemd arguments on reexec

When reexecuting system let's put our arguments carrying deserialization
info first followed by any existing arguments to make sure they get
parsed in case we get weird stuff from the kernel cmdline (like --).

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

2 years agoudev-builtin-net_id: align VF representor names with VF names
Ivan Vecera [Thu, 22 Jun 2023 08:06:27 +0000 (10:06 +0200)] 
udev-builtin-net_id: align VF representor names with VF names

Certain cards support to set their eswitch to switchdev mode. In this
mode for each created VF there is also created so called VF representor.
This representor is helper network interface used for configuration of
mentioned eswitch and belongs to an appropriate PF.

VF representors are identified by the specific value of phys_port_name
attribute and the value has format "pfMvfN" where M is PF function
number and N is VF number inside this PF.

As the VF representor interfaces belong to PF PCI device the naming
scheme used for them is the same like for other PCI devices. In this
case name of PF interface is used and phys_port_name suffix is appended.

E.g.
 PF=enp65s0f0np0 # phys_port_name for PF interface is 'p0'
 VF=enp65s0f0np0v0 # v0 is appended for VF0 in case of NAMING_SR_IOV_V
REP=enp65s0f0np0pf0vf0 # phys_port_name for VF0 representor is 'pf0vf0'

First as the phys_port_name for representors is long (6+ chars) then the
generated name does not fit into IFNAMSIZ so this name is used only as
alternate interface name and for the primary one is used generic one
like eth<N>. Second 'f0' and 'pf0' in REP name is redundant.

This patch fixes this issue by introducing another naming scheme for VF
representors and appending 'rN' suffix to PF interface name for them.
N is VF number so the name used for representor interface is similar to
VF interface and differs only by the suffix.

For the example above we get:
 PF=enp65s0f0np0
 VF=enp65s0f0np0v0
REP=enp65s0f0np0r0

This eases for userspace to determine which representor interface
represents particular VF.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2 years agoMerge pull request #28138 from pkern/oci-dhcpv6
Luca Boccassi [Thu, 29 Jun 2023 21:17:02 +0000 (22:17 +0100)] 
Merge pull request #28138 from pkern/oci-dhcpv6

sd-dhcp6-lease: Ignore invalid bytes at the end of the packet

2 years agoMerge pull request #28191 from yuwata/network-ipv6-privacy-extensions
Luca Boccassi [Thu, 29 Jun 2023 21:16:10 +0000 (22:16 +0100)] 
Merge pull request #28191 from yuwata/network-ipv6-privacy-extensions

network: introduce global setting for IPv6 privacy extensions

2 years agomount-util: tweak flags decoding in mount_verbose_full()
Lennart Poettering [Thu, 29 Jun 2023 10:55:43 +0000 (12:55 +0200)] 
mount-util: tweak flags decoding in mount_verbose_full()

Fine-tune the decoding of mount options in mount_verbose_full() to
provide more helpful log output:

1. decode changing of propagation changes
2. discern changing of superblock flags/mount option string from mount
   flags
3. don't check secondary fields when deciding which mount op is
   executed, only the flags decide that.

2 years agoman: add brief smbios-type-11 man page
Lennart Poettering [Thu, 29 Jun 2023 13:57:26 +0000 (15:57 +0200)] 
man: add brief smbios-type-11 man page

2 years agoman: document vmm.notify_socket credential in systemd(1) man page
Lennart Poettering [Wed, 28 Jun 2023 16:20:01 +0000 (18:20 +0200)] 
man: document vmm.notify_socket credential in systemd(1) man page

Let's move the long explanation to the man page of the component that
interprets the credential, and keep only a brief summary in
systemd.system-credentials(7).

2 years agotest: add test for trailing invalid byte at the end 28138/head
Yu Watanabe [Thu, 29 Jun 2023 16:14:00 +0000 (01:14 +0900)] 
test: add test for trailing invalid byte at the end

2 years agosd-dhcp6-lease: ignore invalid byte(s) at the end of the packet
Philipp Kern [Fri, 23 Jun 2023 08:39:52 +0000 (10:39 +0200)] 
sd-dhcp6-lease: ignore invalid byte(s) at the end of the packet

Oracle Cloud sends malformed DHCPv6 replies that have an invalid
byte at the end, which cannot be parsed as an option code.

networkd currently can cope with the invalid option (it is ignored),
but the whole packet is ignored altogether because of the additional
null at the end.

It's better to be liberal in what we accept and actually assign an
address, given that the reply contains a valid IA_NA.

Fixes #28183.

2 years agotest-network: add test for global IPv6PrivacyExtensions= setting 28191/head
Yu Watanabe [Thu, 29 Jun 2023 12:58:23 +0000 (21:58 +0900)] 
test-network: add test for global IPv6PrivacyExtensions= setting

2 years agonetwork: add global setting for IPv6PrivacyExtensions=
Yu Watanabe [Thu, 29 Jun 2023 10:09:53 +0000 (19:09 +0900)] 
network: add global setting for IPv6PrivacyExtensions=

Closes #28186.

2 years agonetwork: introduce IPV6_PRIVACY_EXTENSIONS_KERNEL enum value
Yu Watanabe [Thu, 29 Jun 2023 09:51:58 +0000 (18:51 +0900)] 
network: introduce IPV6_PRIVACY_EXTENSIONS_KERNEL enum value

No functional change. Preparation for using the _INVALID value in later
commit.

2 years agoNEWS: various fixes
Joerg Behrmann [Thu, 29 Jun 2023 12:07:54 +0000 (14:07 +0200)] 
NEWS: various fixes

2 years agomkosi: Enable Incremental= mode by default
Daan De Meyer [Thu, 29 Jun 2023 11:35:03 +0000 (13:35 +0200)] 
mkosi: Enable Incremental= mode by default

Since mkosi is now smart enough to drop the caches when the list of
packages changes, let's enable Incremental= mode by default to ensure
a good experience for anyone new to hacking on systemd with mkosi.

2 years agotest: use correct path for systemd-battery-check
Frantisek Sumsal [Thu, 29 Jun 2023 08:06:48 +0000 (10:06 +0200)] 
test: use correct path for systemd-battery-check

Follow-up to #28185.

2 years agoupdate TODO
Lennart Poettering [Thu, 29 Jun 2023 08:34:27 +0000 (10:34 +0200)] 
update TODO

2 years agonetwork: Add `IgnoreDdontFragment=` option for Fragmentation control (#28131)
Yuxiang Zhu [Thu, 29 Jun 2023 10:11:52 +0000 (18:11 +0800)] 
network: Add `IgnoreDdontFragment=` option for Fragmentation control (#28131)

From `ip-link(8)`:
> [no]ignore-df - enables/disables IPv4 DF
                      suppression on this tunnel.  Normally datagrams
                      that exceed the MTU will be fragmented; the
                      presence of the DF flag inhibits this, resulting
                      instead in an ICMP Unreachable (Fragmentation
                      Required) message.  Enabling this attribute causes
                      the DF flag to be ignored.

If this option is enabled for a GRE/GRETAP tunnel, the `DF` flag in the outer IP header
will not inherit the inner IP header's `DF` flag.

This is useful to transfer packets that exceed the MTU of the underlay
network.

2 years agoman: Extend journalctl color information
Alexander Krabler [Tue, 27 Jun 2023 16:45:33 +0000 (18:45 +0200)] 
man: Extend journalctl color information

Add sentence about colored warning messages in journalctl.

2 years agobattery-check: several follow-ups
Yu Watanabe [Wed, 28 Jun 2023 17:43:17 +0000 (02:43 +0900)] 
battery-check: several follow-ups

Follow-ups for e3d4148d50909119c4e9327e6ad96d3ca7f4661a.

- add reference to initrd-battery-check.service in man page, and move
  its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
  indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),

etc, etc...

2 years agomeson: first try dependency(), then fallback to find_library()
Yu Watanabe [Mon, 26 Jun 2023 19:53:13 +0000 (04:53 +0900)] 
meson: first try dependency(), then fallback to find_library()

This also drops the fallback for libacl, libcap, libcrypt, and libgcrypt,
as recent Ubuntu (at least, 20.04 LTS and newer) and Debian (at least, buster
and newer) have relevant .pc files.

Fixes #28161.

2 years agoNEWS: various fixes/additions
Lennart Poettering [Wed, 28 Jun 2023 20:35:12 +0000 (22:35 +0200)] 
NEWS: various fixes/additions

2 years agoMerge pull request #28168 from poettering/xdg-state-home
Lennart Poettering [Wed, 28 Jun 2023 20:30:23 +0000 (22:30 +0200)] 
Merge pull request #28168 from poettering/xdg-state-home

properly support XDG_STATE_HOME

2 years agotmpfiles: teach tmpfiles the new XDG_STATE_HOME variable too 28168/head
Lennart Poettering [Tue, 27 Jun 2023 11:14:17 +0000 (13:14 +0200)] 
tmpfiles: teach tmpfiles the new XDG_STATE_HOME variable too

2 years agoman: properly close XML tags
Lennart Poettering [Tue, 27 Jun 2023 08:32:11 +0000 (10:32 +0200)] 
man: properly close XML tags

2 years agoman: rebreak lines in file-hierarchy(7) a bit
Lennart Poettering [Tue, 27 Jun 2023 08:28:44 +0000 (10:28 +0200)] 
man: rebreak lines in file-hierarchy(7) a bit

(Does not change a single word, just rebreaks a bunch of paragraphs
matching our current line breaking rules)

2 years agoman: mention the newly-added XDG_STATE_HOME
Franklin Yu [Fri, 26 May 2023 05:06:54 +0000 (22:06 -0700)] 
man: mention the newly-added XDG_STATE_HOME

The description is copied from config-home.

Taken from: #27795

2 years agotest: add test for new XDG_STATE_HOME handling
Lennart Poettering [Mon, 26 Jun 2023 21:23:21 +0000 (23:23 +0200)] 
test: add test for new XDG_STATE_HOME handling

2 years agoexecute: don't bother with chowning StateDirectory= and friends in user mode
Lennart Poettering [Tue, 27 Jun 2023 09:19:47 +0000 (11:19 +0200)] 
execute: don't bother with chowning StateDirectory= and friends in user mode

2 years agoexecute: shorten code by making use of laccess() return code properly
Lennart Poettering [Tue, 27 Jun 2023 09:19:31 +0000 (11:19 +0200)] 
execute: shorten code by making use of laccess() return code properly

2 years agoexecute: shorten some code by using RET_NERRNO()
Lennart Poettering [Tue, 27 Jun 2023 09:19:12 +0000 (11:19 +0200)] 
execute: shorten some code by using RET_NERRNO()

2 years agoexecute: associate logs from setup_exec_directory() with the unit name
Lennart Poettering [Tue, 27 Jun 2023 09:16:01 +0000 (11:16 +0200)] 
execute: associate logs from setup_exec_directory() with the unit name

2 years agoexecute: add support for XDG_STATE_HOME for placing service state data in --user...
Lennart Poettering [Mon, 26 Jun 2023 20:42:33 +0000 (22:42 +0200)] 
execute: add support for XDG_STATE_HOME for placing service state data in --user mode

This adds support for the new XDG_STATE_HOME env var that was added to
the xdg basedir spec. Previously, because the basedir spec didn't know
the concept we'd alias the backing dir for StateDirectory= to the one
for ConfigurationDirectory= when runnin in --user mode. With this change
we'll make separate. This brings us various benefits, such as proper
"systemctl clean" support, where we can clear service state separately
from service configuration, now in user mode too.

This does not come without complications: retaining compatibility with
older setups is difficult, because we cannot possibly identitfy which
files in existing populated config dirs are actually "state" and which
one are true" configuration.

Hence let's deal with this pragmatically: if we detect that a service
that has both dirs configured only has the configuration dir existing,
then symlink the state dir to the configuration dir to retain
compatibility.

This is not great, but it's the only somewhat reasonable way out I can
see.

Fixes: #25739
2 years agoexecute: when recursively chowning StateDirectory= when spawning services, follow...
Lennart Poettering [Tue, 27 Jun 2023 09:09:03 +0000 (11:09 +0200)] 
execute: when recursively chowning StateDirectory= when spawning services, follow initial symlink

It should be OK to allow one level of symlink for the various types of
directories like StateDirectory=, LogsDirectory= and such.

2 years agoexecute: remove redundant assignment
Lennart Poettering [Mon, 26 Jun 2023 20:36:31 +0000 (22:36 +0200)] 
execute: remove redundant assignment

2 years agoexecude: include RuntimeScope field in ExecParameters
Lennart Poettering [Mon, 26 Jun 2023 20:34:25 +0000 (22:34 +0200)] 
execude: include RuntimeScope field in ExecParameters

Let's decouple execute.c a bit from the Manager object, let's pass the
runtime scope (i.e. the enum that discern invocation for user or system
context) as part of ExecParameters. This makes the scope available in
various functions without having to pass the Manager object in.