Commit graph

8500 commits

Author SHA1 Message Date
Yu Watanabe 3255bda698 network: make 'carrier' as the default required operational state for CAN device
As CAN devices do not support IP address, hence the state never goes to
higher than 'carrier'.

Prompted by https://github.com/linux-can/can-utils/issues/68#issuecomment-1327987724.
2024-01-17 04:05:43 +09:00
Mike Yuan f2723ca745
man/systemd-sleep.conf: document the operation of s2h more thoroughly 2024-01-15 03:05:25 +08:00
Lennart Poettering 535252dc26 networkd: expose nsid via dbus 2024-01-12 21:43:34 +01:00
Lennart Poettering 14adc1ab4b man: fix typo AV_VSOCK → AF_VSOCK
A reported by Arian van Putten:

https://github.com/systemd/systemd/pull/30777#pullrequestreview-1816817988
2024-01-12 13:50:32 +00:00
Yu Watanabe 967cd1712c
Merge pull request #30867 from dtardon/udev-conf-dropins
Allow dropins for udev.conf
2024-01-12 06:37:23 +09:00
Lennart Poettering 28795e4dca
Merge pull request #30777 from poettering/ssh-generator
ssh-generator which makes VMs and containers accessible to ssh via AF_UNIX and AF_VSOCK
2024-01-11 21:31:28 +01:00
Lennart Poettering 25f8d3856a
Merge pull request #30884 from poettering/logind-background-light
logind: add "background-light" + "manager" session classes
2024-01-11 21:20:01 +01:00
David Tardon 810a5895e6 man: update udev.conf man page 2024-01-12 05:12:44 +09:00
Lennart Poettering a50666e376 id128: add --no-pager, --no-legend, --json=/-j switches to systemd-id128 tool 2024-01-11 17:54:19 +01:00
Lennart Poettering 0f6827bdd1 man: document the expanded catalogue of session classes 2024-01-11 17:47:41 +01:00
Lennart Poettering 0abd510f7f ssh-proxy: add ssh ProxyCommand tool that can connect to AF_UNIX + AF_VSOCK sockets
This adds a tiny binary that is hooked into SSH client config via
ProxyCommand and which simply connects to an AF_UNIX or AF_VSOCK socket
of choice.

The syntax is as simple as this:

     ssh unix/some/path     # (this connects to AF_UNIX socket /some/path)

or:

     ssh vsock/4711

I used "/" as separator of the protocol ID and the value since ":" is
already taken by SSH itself when doing sftp. And "@" is already taken
for separating the user name.
2024-01-11 16:05:20 +01:00
Lennart Poettering 0e3220684c ssh-generator: add simple new generator 2024-01-11 16:05:20 +01:00
Lennart Poettering 658dc909dc man: fix references to systemd.exec(5)
For some reason the section for the systemd.exec man page was added
incorrectly and then copypasted everywhere else incorrectly too. Let's
fix that.
2024-01-11 12:19:44 +00:00
Antonio Alvarez Feijoo 5e16328506 analyze: clarify that security --offline=true requires an argument
Without `--root` or `--image`, the `security` command inspects all currently
loaded service units if no unit name is specified. But with `--root` or
`--image` with `--offline=true`, the `security` command exits silently if no
unit name is specified.

Also, fixed description of `--root` and `--image` in the man page, and added
missing `--unit` option to help text.
2024-01-11 12:19:20 +00:00
Carlos Garnacho 501d8b8bc6 logind: Mark LidClosed property as "emits change"
It may be useful for DEs to follow changes on this property, esp. now that
recent UPower has removed its own lid handling code.

Related: 07565ef6a1
2024-01-10 19:31:06 +00:00
Lennart Poettering 9a70dc02c6
Merge pull request #30786 from yuwata/udev-net-link-property
udev/net: introduce [Link] Property= setting and friends
2024-01-10 15:56:29 +01:00
Lennart Poettering a795ec8100
Merge pull request #30839 from yuwata/detect-virt-google
detect-virt: add Google Compute Engine support
2024-01-10 09:55:44 +01:00
Yu Watanabe 046286e863 udev/net: introduce [Link] Property=, ImportProperty=, and UnsetProperty= settings
The applied order is equivalent to Environment=, PassEnvironment=, and
UnsetEnvironment= for [Service] or so.
2024-01-10 04:33:51 +09:00
Yu Watanabe 12b1e04073 man: fix indentation 2024-01-10 03:50:32 +09:00
Yu Watanabe 9b0688f491 virt: add Google Compute Engine support
See https://cloud.google.com/run/docs/container-contract#sandbox
2024-01-10 03:08:31 +09:00
Mike Yuan 435e1098ee
core: allow fstab-style nodes in mount/swap What=
Closes #28989
2024-01-10 02:07:18 +08:00
Luca Boccassi c3f4d9f9a4
Merge pull request #30842 from aafeijoo-suse/analyze-q-man-help-fix
analyze: minor fixes
2024-01-09 10:40:19 +00:00
Antonio Alvarez Feijoo ca02969379
analyze: man and --help fixes
man:
- `verify` requires an argument
- `security` does not require an argument
- `fdstore` requires an argument
- `image-policy` requires an argument

`--help` text:
- missing `image-policy` command
- `cat-config` requires NAME or PATH
2024-01-09 10:11:59 +01:00
Antonio Alvarez Feijoo 7c0e0bbb6b
analyze: fix -q option
Follow-up to 52117f5af8
2024-01-09 09:05:50 +01:00
Mike Yuan fa724cd52c
networkd/wireguard: support network.wireguard.* credentials
Closes #26702
2024-01-09 15:25:30 +08:00
Yu Watanabe 10b8bb5495 man: drop unexpected dot 2024-01-09 10:52:18 +09:00
Lennart Poettering a1bb30de7f varlink: add "ssh:" transport
This uses openssh 9.4's -W support for AF_UNIX. Unfortunately older versions
don't work with this, and I couldn#t figure a way that would work for
older versions too, would not be racy and where we'd still could keep
track of the forked off ssh process.

Unfortunately, on older versions -W will just hang (because it tries to
resolve the AF_UNIX path as regular host name), which sucks, but hopefully this
issue will go away sooner or later on its own, as distributions update.

Fedora is still stuck at 9.3 at the time of posting this (even on
Fedora), even though 9.4, 9.5, 9.6 have all already been released by
now.

Example:
        varlinkctl call -j ssh:root@somehost:/run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt '{"text":"foobar"}'
2024-01-08 23:24:45 +01:00
Lennart Poettering c9f096969a
Merge pull request #30827 from poettering/network-generator-creds
network-generator: pick up .netdev/.link/.network configuration via c…
2024-01-08 15:02:02 +01:00
Lennart Poettering 1a30285590 network-generator: pick up .netdev/.link/.network configuration via credentials
To me this is the last major basic functionality that couldn't be
configured via credentials: the network.

We do not invent any new format for this, but simply copy relevant creds
1:1 into /run/systemd/network/ to open up the full functionality of
networkd to VM hosts.
2024-01-08 12:59:08 +01:00
Lennart Poettering 19b8e712d8 hostnamed: expose local AF_VSOCK CID among other host info
This is a host identifier of major relevance, since it is how you
connect to this system if it is a VM, hence expose this nicely.
2024-01-08 10:30:41 +01:00
Lennart Poettering 8ef31e1f13
Merge pull request #29692 from H5117/fix_pkcs11_uri
cryptenroll: change class in provided PKCS#11 URI if necessary
2024-01-05 12:14:26 +01:00
Yu Watanabe c270e41f5e man: fix typo
Follow-up for 7d93e4af80.
2024-01-05 19:08:12 +09:00
Adrian Vovk cc51085a41 core: Add %D specifier for $XDG_DATA_HOME
We already have specifiers that resolve to $XDG_STATE_HOME, and
$XDG_CONFIG_HOME. $XDG_DATA_HOME is in a similar vein.

It allows units belonging to the user service manager to correctly look
into ~/.local/share. I imagine this would be most useful inside of
condition checks (i.e. only run a service on session startup if some
data is not found in ~/.local/share) or in the inotify monitoring of a
.path unit
2024-01-05 11:03:06 +01:00
Vladimir Stoiakin 85828ef920 cryptenroll: change class in provided PKCS#11 URI if necessary
cryptenroll accepts only PKCS#11 URIs that match both a certificate and a private key in a token.
This patch allows users to provide a PKCS#11 URI that points to a certificate only, and makes possible to use output of some PKCS#11 tools directly.
Internally the patch changes 'type=cert' in the provided PKCS#11 URI to 'type=private' before storing in a LUKS2 header.

Fixes: #23479
2024-01-05 12:32:36 +03:00
Sergei Zhmylev 25aa35d465 journalctl: add --exclude-identifier option 2024-01-04 23:21:39 +01:00
Lennart Poettering 6d78dc2827 creds: rename "tpm2-absent" encryption to "null" encryption
This is what it is after all: encryption with a NULL key. This is more
descriptive, but also relevant since we want to use this kind of
credentials in a different context soon: for carrying pcrlock data into
a UKI. In that case we don#t want encryption, since the pcrlock data is
intended to help unlocking secrets, hence should not be a secret itself.

This only changes the code labels and the way this is labelled in the
output. We retain compat with the old name.
2024-01-04 22:56:48 +01:00
Luca Boccassi 81a183800f tmpfiles: add --purge switch
Any file/directory created by a tmpfiles.d will be deleted. Useful for
purge/factory reset patterns.
2024-01-04 17:36:43 +01:00
Mike Yuan 5317451f12
man/loginctl: document "self" and "auto" special session IDs
session-status automatically uses "auto" if no ID is specified,
but show-session shows the manager's properties. Let's document
these special values so that users of show-session can benefit too.
2024-01-04 19:26:47 +08:00
Mike Yuan 771240fa3d
man/loginctl: use <literal> to quote possible values of --kill-whom= 2024-01-04 18:59:38 +08:00
Lennart Poettering 2a02a8db91
Merge pull request #26663 from poettering/vpick
add new "vpick" concept for automatically picking newest resource from .v/ dir containing versioned files
2024-01-03 22:17:32 +01:00
Yu Watanabe 82a1597778
Merge pull request #28797 from Werkov/eff_limits
Add MemoryMaxEffective=, MemoryHighEffective= and TasksMaxEff…  …ective= properties
2024-01-04 05:38:06 +09:00
Michal Sekletar 508b4786e8 logind: don't setup idle session watch for lock-screen and greeter
Reason to skip the idle session logic for these session classes is that
they are idle by default.
2024-01-04 05:27:41 +09:00
Yu Watanabe aea57b1415
Merge pull request #28836 from msekletar/aux-scope
core/manager: add dbus API to create auxiliary scope from running service
2024-01-04 04:52:39 +09:00
Lennart Poettering 7d93e4af80 man: document the new vpick concept 2024-01-03 18:38:46 +01:00
Lennart Poettering de84484e7b
Merge pull request #29940 from poettering/stub-confext-pickup
stub/sysext: pick up confexts from ESP, too
2024-01-03 17:40:36 +01:00
Michal Sekletar 84c01612de core/manager: add dbus API to create auxiliary scope from running service
This commit introduces new D-Bus API, StartAuxiliaryScope(). It may be
used by services as part of the restart procedure. Service sends an
array of PID file descriptors corresponding to processes that are part
of the service and must continue running also after service restarts,
i.e. they haven't finished the job why they were spawned in the first
place (e.g. long running video transcoding job). Systemd creates new
scope unit for these processes and migrates them into it. Cgroup
properties of scope are copied from the service so it retains same
cgroup settings and limits as service had.
2024-01-03 13:50:41 +01:00
Lennart Poettering 4e1f0037b8 units: add a tpm2.target synchronization point and small generator that pulls in
Distributions apparently only compile a subset of TPM2 drivers into the
kernel. For those not compiled it but provided as kmod we need a
synchronization point: we must wait before the first TPM2 interaction
until the driver is available and accessible.

This adds a tpm2.target unit as such a synchronization point. It's
ordered after /dev/tpmrm0, and is pulled in by a generator whenever we
detect that the kernel reported a TPM2 to exist but we have no device
for it yet.

This should solve the issue, but might create problems: if there are TPM
devices supported by firmware that we don't have Linux drivers for we'll
hang for a bit. Hence let's add a kernel cmdline switch to disable (or
alternatively force) this logic.

Fixes: #30164
2024-01-03 13:49:02 +01:00
Michal Koutný 93f8e88d23 cgroup: Restrict effective limits with global resource provision
Global resource (whole system or root cg's (e.g. in a container)) is
also a well-defined limit for memory and tasks, take it into account
when calculating effective limits.
2024-01-03 13:43:04 +01:00
Michal Koutný 4fb0d2dc14 cgroup: Add EffectiveMemoryMax=, EffectiveMemoryHigh= and EffectiveTasksMax= properties
Users become perplexed when they run their workload in a unit with no
explicit limits configured (moreover, listing the limit property would
even show it's infinity) but they experience unexpected resource
limitation.

The memory and pid limits come as the most visible, therefore add new
unit read-only properties:
- EffectiveMemoryMax=,
- EffectiveMemoryHigh=,
- EffectiveTasksMax=.

These properties represent the most stringent limit systemd is aware of
for the given unit -- and that is typically(*) the effective value.

Implement the properties by simply traversing all parents in the
leaf-slice tree and picking the minimum value. Note that effective
limits are thus defined even for units that don't enable explicit
accounting (because of the hierarchy).

(*) The evasive case is when systemd runs in a cgroupns and cannot
reason about outer setup. Complete solution would need kernel support.
2024-01-03 13:37:08 +01:00
Lennart Poettering 39e0c237f1 stub: pick up confexts from the ESP as well
This does what we do for system extension also for configuration
extension.

This is complicated by the fact that we previously looked for
<uki-binary>.d/*.raw for system extensions. We want to measure sysexts
and confexts to different PCRs (13 vs. 12) hence we must distinguish
them, but *.raw would match both kinds.

This commit solves this via the following mechanism: we'll load confexts
from *.confext.raw and sysexts from *.raw but will then enclude
*.confext.raw from the latter. This preserves compatibility but allows
us to somewhat reasonable distinguish both types of images.

The documentation is updated not going into this detail though, and
instead now claims that sysexts shall be *.sysext.raw and confexts
*.confext.raw even though we actually are more lenient than this. This
is simply to push people towards using the longer, more descriptive
suffixes.

I added an XML comment (<!-- … -->) about this to the docs, so that
whenever somebody notices the difference between code and docs
understands why and leaves it that way.
2024-01-03 10:38:34 +01:00
Yu Watanabe 778823fd52 backlight: supprt ID_LEDS_CLAMP udev property for leds subsystem devices
Closes #30507.
2024-01-03 09:30:41 +09:00
Yu Watanabe cb0a3b8c14 network/route: drop TTL propagate support for MPLS routes
This effectively reverts 9b88f20aba.

We do not support MPLS routes, only IPv4 or IPv6 routes are supported.
2024-01-03 08:41:53 +09:00
Chris Simons 9ef362bf3d
machinectl: add restart convenience alias (#30625) 2023-12-28 07:09:42 +09:00
David Tardon af29d0b179 man: rewrite as <group> 2023-12-26 13:10:36 +01:00
David Tardon 0fd5f9fb50 man: fix markup
<arg> is not allowed inside <title>.
2023-12-26 13:10:36 +01:00
David Tardon 7f9d96d4c5 man: move </variablelist> to the right place 2023-12-26 13:10:35 +01:00
David Tardon b239fc7250 man: fix <cmdsynopsis> content
Inline text is not allowed.
2023-12-26 13:10:35 +01:00
David Tardon 20dcd73a28 man: fix markup
<option> is not allowed in <cmdsynopsis>.
2023-12-26 13:10:35 +01:00
David Tardon dfa6c32ad9 man: restrict <command> to the actual command 2023-12-26 13:10:35 +01:00
David Tardon 996de3397b man: move macro decls. out of <funcsynopsis>
<funcsynopsis> doesn't allow block content.
2023-12-26 13:10:35 +01:00
David Tardon 932abebf4d man: fix markup
<arg> is not allowed inside <term>.
2023-12-26 13:10:35 +01:00
David Tardon b3579feb59 man: fix indentation 2023-12-26 08:59:53 +01:00
David Tardon 0f095802ad man: add required <title> 2023-12-25 17:59:50 +01:00
David Tardon 70601fa571 man: match doctype and root element 2023-12-25 15:51:47 +01:00
David Tardon eea10b26f7 man: use same version in public and system ident. 2023-12-25 15:51:47 +01:00
Yu Watanabe f73509d90f
Merge pull request #30616 from dtardon/docbook-valid-2
DocBook validation fixes (part 2)
2023-12-25 20:00:23 +09:00
David Tardon bc6fdcbf5d man: use <refsect1> instead of <refsection>
DocBook document model doesn't allow mixing of <refsection> with the
numbered variants (<refsect1> etc.). Therefore, any document that
included something from standard-conf.xml was invalid. Fortunately, all
the includes are at the 1st level, hence let's just change
standard-conf.xml to use <refsect1> to fix that.
2023-12-25 10:50:13 +01:00
David Tardon cfcdee7c16 man: drop an extra <member>
Follow-up for 13a69c120b .
2023-12-25 10:43:18 +01:00
David Tardon 9e25422299 man: move macro decls. out of <funcsynopsis>
<funcsynopsis> doesn't allow block content.
2023-12-25 10:40:40 +01:00
David Tardon e353998eb6 man: fix markup 2023-12-25 10:40:40 +01:00
David Tardon eb066221e9 man: fix markup
<arg> is not allowed inside <title>.
2023-12-25 10:40:40 +01:00
David Tardon 1ab6ecd109 man: fix markup
<arg> is not allowed inside <title>.
2023-12-25 10:40:40 +01:00
David Tardon c101b65619 man: make ID valid
The id attribute is of type ID, defined at
https://www.w3.org/TR/1998/REC-xml-19980210#id . It may contain only
selected non-alphanumeric characters; '@' is not among them.
2023-12-25 10:40:40 +01:00
David Tardon d2c0c05f51 man: add an extra <refsect2>
DocBook's document model doesn't allow block content after a section.
2023-12-25 10:39:36 +01:00
David Tardon df93996fd6 man: drop output redir. from cmd. synopsis
<cmdsynopsis> doesn't allow inline content, like the redir. operator
here. And std. output is not an argument anyway...
2023-12-25 10:36:07 +01:00
David Tardon 8f39acd005 man: fix xpointer expression 2023-12-25 10:00:43 +01:00
David Tardon 617b85d10e man: use <warning> for warnings 2023-12-25 10:00:43 +01:00
David Tardon f37841c0b7 man: add a missing space 2023-12-25 10:00:43 +01:00
David Tardon ee5bf48f7d man: sprinkle some more markup around 2023-12-25 10:00:43 +01:00
David Tardon 28ed1ba9bd man: use better-fitting markup 2023-12-25 10:00:43 +01:00
David Tardon 2dfeb64bcd man: use <simplelist> at one more place 2023-12-25 10:00:43 +01:00
David Tardon afc7ad8cd5 man: fix plural 2023-12-25 09:15:53 +01:00
Yu Watanabe 891e81edf4
Merge pull request #30615 from dtardon/docbook-valid-1
DocBook validation fixes (part 1)
2023-12-24 19:27:26 +09:00
David Tardon 7e59b569a1 man: adjust indentation 2023-12-24 10:46:55 +01:00
David Tardon 74512bbc38 man: use the right element for untitled example 2023-12-24 09:43:22 +01:00
David Tardon 74cd284ad0 man: fix markup 2023-12-24 09:43:22 +01:00
David Tardon b2e6aae674 man: fix option value 2023-12-24 09:43:22 +01:00
David Tardon 1eb07e6ffa man: fix markup 2023-12-24 09:43:22 +01:00
David Tardon 5b297dcec8 man: drop stray empty paragraph 2023-12-24 09:32:29 +01:00
David Tardon 3c2b711f4a man: wrap sentinel in <parameter> 2023-12-24 09:32:28 +01:00
David Tardon 08b96745dd man: use just one <listitem> for the description
<varlistentry> allows one or more <term>s, but exactly one <listitem>.
2023-12-24 09:32:28 +01:00
David Tardon 7a0f2298b8 man: wrap the whole description in <listitem>
Unfortunately, version-info includes and standard-options includes are
not composable...
2023-12-24 09:32:28 +01:00
David Tardon 35fcba4a8c man: move misplaced </varlistentry> 2023-12-24 09:32:28 +01:00
David Tardon d9655d11bc man: move </listitem> to the right position 2023-12-24 09:32:28 +01:00
David Tardon a5fcbfea45 man: add missing <listitem> 2023-12-24 09:32:28 +01:00
David Tardon 35fc10756b man: add missing <cmdsynopsis> wrapper 2023-12-24 09:32:28 +01:00
David Tardon af355f198e man: add required <title> 2023-12-24 09:32:26 +01:00
David Tardon bbd0645a3e man: match doctype and root element 2023-12-24 09:23:53 +01:00
Raito Bezarius b49595503d networkd: support proxy_arp_pvlan sysctl
The proxy ARP private VLAN sysctl is useful for VLAN aggregation, see
https://sysctl-explorer.net/net/ipv4/proxy_arp_pvlan/ for details.
2023-12-24 03:40:03 +09:00
Yu Watanabe 24f4144a08
Merge pull request #30600 from dtardon/see-also-simplelist
man: use `<simplelist>` for 'See also' sections
2023-12-23 19:08:31 +09:00
Luca Boccassi d45ca9a905 man: conditionalize sd-pcrlock and sd-measure on the same variable as their binaries
The binaries are built and installed if HAVE_TPM2 is set, and ignore ENABLE_BOOTLOADER,
so do the same for the manpages.

For the sd-pcrlock case this also installs the manpage aliases for the units, which
are not installed with -Dbootloader=disabled, but there's no way to conditionalize
the aliases, so on balance it's better to have too much documentation rather than
too little.

Fixes https://github.com/systemd/systemd/issues/30588
2023-12-23 18:04:08 +08:00
David Tardon 59b4437973 man: capitalize "also" for consistency
Almost all our man pages write it that way.
2023-12-23 08:28:57 +01:00
David Tardon 13a69c120b man: use <simplelist> for 'See also' sections
This is just a slight markup improvement; there should be no difference
in rendering.
2023-12-23 08:28:57 +01:00
Yu Watanabe 4e22097489
Merge pull request #30541 from yuwata/network-address-empty
network/address: make Address= in [Network] support an empty string
2023-12-22 11:50:44 +09:00
Lennart Poettering 66f3da245b
Merge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
fstab-generator: disable default deps if x-systemd.{wanted,required}-by= is used
2023-12-21 22:47:54 +01:00
Lennart Poettering dc6522b18f
Merge pull request #28658 from H5117/enroll_with_ec
cryptsetup: Add support for EC keys in PKCS#11 tokens
2023-12-21 22:45:40 +01:00
Lennart Poettering 2118b179ca man: try to improve wording on --slice-inherit docs 2023-12-21 19:15:01 +01:00
Lennart Poettering 2f0b4d578b run/uid0: tint the terminal background color (and add new --background= switch)
This adds a new --background= switch that allows specifiying a
background color for the terminal while the tool runs.

It also teaches the tool when invoked as uid0 to tint the terminal in a
reddish hue when operating as root, and in a yellowish hue when
operating as any other user.

This should highlight nicely when the user is operating with elevated
privileges, or changed privileges.
2023-12-21 19:15:01 +01:00
Lennart Poettering 1072d94731 run: optionally set the "ignore-failure" flag for ExecStart= lines 2023-12-21 19:14:43 +01:00
Lennart Poettering 72eb3081b2 run: when invoked as "uid0", expose some sudo-like behaviour
This turns "systemd-run" into a multi-call binary. When invoked under
the name "uid0", then it behaves a bit more like traditional "sudo".
This mostly means defaults appropriuate for that, for example a PAM
stack, interactivity and more.

Fixes: #29199
2023-12-21 19:14:43 +01:00
Lennart Poettering d1a5be82ef core: imply SetLoginEnvironment= if PAMName= is set
This geneally makes sense as setting up a PAM session pretty much
defines what a login session is.

In context of #30547 this has the benefit that we can take benefit of
the SetLoginEnvironment= effect without having to set it explicitly,
thus retaining some compat of the uid0 client towards older systemd
service managers.
2023-12-21 10:14:21 +01:00
Yu Watanabe a61738b3a6 network/address: make Address= in [Network] support an empty string
Closes #30485.
2023-12-21 04:08:53 +09:00
Mike Yuan bc9e592c4f systemctl: configure boot loader options only when going through firmware
Fixes #30497
2023-12-21 01:35:55 +09:00
Yu Watanabe 63d0491bbc
Merge pull request #30536 from yuwata/network-bridge-vlan-debugging-logs
network/bridge-vlan: add debugging logs and documentation update
2023-12-20 23:46:01 +09:00
Yu Watanabe 8f876e8d98
Merge pull request #30525 from YHNdnzj/networkctl-mask
networkctl: introduce verb mask and unmask
2023-12-20 21:00:36 +09:00
Yu Watanabe 03a46b5eca man,NEWS: mention that all previously assigned VLAN IDs are cleared
Addresses https://github.com/systemd/systemd/pull/29987#issuecomment-1863934902.
2023-12-20 19:22:53 +09:00
Yu Watanabe b9e6e92510 man: fix indentation 2023-12-20 19:21:11 +09:00
Yu Watanabe 044149e615 man: environment value -> udev property
These are not environment variables, but udev properties.

Follow-up for 3b2e7dc5a2.
2023-12-20 15:08:52 +09:00
Mike Yuan 28bb29cbb4
networkctl: introduce verb mask and unmask
Suggested in https://github.com/systemd/systemd/pull/29928#discussion_r1386626565
2023-12-20 12:46:46 +08:00
Lukas Nykryn 3b2e7dc5a2 udev: allow/denylist for reading sysfs attributes when composing a NIC name
Users can currently pick specific versions of NIC naming, but that
does not guarantee that NIC names won't change after the kernel adds
a new sysfs attribute.

This patch allows for an allow/deny list of sysfs attributes
that could be used when composing the name.

These lists can be supplied as an hwdb entry in the form of
/etc/udev/hwdb.d/50-net-naming-allowlist.hwdb
net:naming:drvirtio_net
  ID_NET_NAME_ALLOW=0
  ID_NET_NAME_ALLOW_ACPI_INDEX=1
  ID_NET_NAME_ALLOW_ADDR_ASSIGN_TYPE=1
  ID_NET_NAME_ALLOW_ADDRESS=1
  ID_NET_NAME_ALLOW_ARI_ENABLED=1
  ID_NET_NAME_ALLOW_DEV_PORT=1
  ID_NET_NAME_ALLOW_FUNCTION_ID=1
  ID_NET_NAME_ALLOW_IFLINK=1
  ID_NET_NAME_ALLOW_INDEX=1
  ID_NET_NAME_ALLOW_LABEL=1
  ID_NET_NAME_ALLOW_PHYS_PORT_NAME=1
  ID_NET_NAME_ALLOW_TYPE=1
2023-12-19 19:15:52 +09:00
Vladimir Stoiakin 3d05c05873 cryptsetup: Add support for EC keys in PKCS#11 tokens
Since EC keys doesn't support encryption directly, we use ECDH protocol.
We generate a pair of EC keys in the same EC group, then derive a shared secret using the generated private key and the public key in the token.
The derived shared secret is used as a volume key. The generated public key is stored in the LUKS2 JSON token header area. The generated private key is erased.
To unlock a volume, we derive the shared secret with the stored public key and a private key in the token.

Co-authored-by: MkfsSion <mkfssion@mkfssion.com>
2023-12-19 13:14:16 +03:00
Frantisek Sumsal 31dcc1b4ba man: avoid potential shell expansion in systemctl's example
Resolves: #30014
2023-12-18 17:09:06 +01:00
Lennart Poettering 3ccadbce33 homectl: add "firstboot" command
This extends what systemd-firstboot does and runs on first boots only
and either processes user records passed in via credentials to create,
or asks the user interactively to create one (only if no regular user
exists yet).
2023-12-18 11:10:53 +01:00
Lennart Poettering 68f74b0af2
Merge pull request #30479 from keszybz/man-pages-synopsis-layout
Man pages synopsis layout
2023-12-18 10:44:58 +01:00
Zbigniew Jędrzejewski-Szmek ace3e93fee man: use <simplelist> for two more lists 2023-12-15 14:32:50 +01:00
Zbigniew Jędrzejewski-Szmek 73e97bb064 man: use <simplelist> for file lists in synopsis
With <para><filename>…</filename></para>, we get a separate "paragraph" for
each line, i.e. entries separated by empty lines. This uses up a lot of space
and was only done because docbook makes it hard to insert a newline. In some
other places, <literallayout> was used, but then we cannot indent the source
text (because the whitespace would end up in the final page). We can get the
desired result with <simplelist>.

With <simplelist> the items are indented in roff output, but not in html
output. In some places this looks better then no indentation, and in others it
would probably be better to have no indent. But this is a minor issue and we
cannot control that.

(I didn't convert all spots. There's a bunch of other man pages which have two
lines, e.g. an executable and service file, and it doesn't matter there so
much.)
2023-12-15 14:27:28 +01:00
Andrew Sayers ff47602f5e Fix a typo in the org.freedesktop.systemd1 man page 2023-12-15 07:39:05 +09:00
Zbigniew Jędrzejewski-Szmek f36c796e0f man/tmpfiles: update summary
It hasn't been just about "volatile" and "files" for a long time.
2023-12-14 12:52:28 +01:00
Zbigniew Jędrzejewski-Szmek 0b4cf0a540
Merge pull request #30232 from keszybz/ukify-imports
Use exec() to import ukify
2023-12-13 14:38:03 +01:00
Yu Watanabe 0977039bdc
Merge pull request #30433 from yuwata/network-nexthop-cleanups
network: introduce ManageForeignNextHops=
2023-12-13 14:16:27 +09:00
Will Springer e014a19420 man: make minor corrections to smbios-type-11(7)
- Correct initial version of io.systemd.credential* to 252
- Fix leftover copy-pasted heading
2023-12-13 00:58:23 +00:00
Yu Watanabe bbc05bec98 network/nexthop: introduce ManageForeignNextHops= boolean setting
Closes #29034.
2023-12-12 23:51:10 +09:00
Mike Yuan f611721fa2
man/systemd.mount: tmpfs automatically gains After=swap.target dep 2023-12-12 00:34:32 +08:00
Mike Yuan 39a4c452d2
fstab-generator: disable default deps if x-systemd.{wanted,required}-by= is used
Fixes #30273
2023-12-12 00:34:32 +08:00
Mike Yuan d3a7602d83
man/systemd.mount: update implicit deps on device unit
See also: 707ecf1423
2023-12-12 00:34:32 +08:00
Yu Watanabe a753d30303 systemctl: fix typo
Follow-up for 329050c5e2.
2023-12-10 14:26:33 +09:00
Luca Boccassi 6c75eff6af core: create workdir/upperdir when mounting a Type=overlay mount unit
So far we created the target directory, and the source for bind mounts,
but not workdir/upperdir for overlays, so it has to be done separately
and strictly before the unit is started, which is annoying. Check the
options when creating directories, and if upper/work directories are
specified, create them.
2023-12-08 11:22:14 +09:00
Shulhan 59b13e07f2 man: correct the path for location of "machinectl edit" setting file
The correct path where setting file located should be
"under /etc/systemd/nspawn", not "under /etc".
2023-12-07 14:51:05 +00:00
Yu Watanabe 786a337817
Merge pull request #30060 from poettering/analyze-archs
analyze: add "archs" verb that lists all known architectures
2023-12-07 15:47:30 +09:00
Daan De Meyer b952663cd1 gpt-auto-generator: Pass cryptsetup credentials to cryptsetup
cryptsetup reads a bunch of credentials now but we don't pass import
those in any service units yet. Let's pass through all cryptsetup
prefixed credentials to the systemd-cryptsetup@root instance.
2023-12-06 23:37:32 +01:00
Zbigniew Jędrzejewski-Szmek 34f4fcb59f
Merge pull request #30302 from keszybz/systemd-edit-stdin
systemctl edit --stdin
2023-12-06 22:28:02 +01:00
Zbigniew Jędrzejewski-Szmek fd72d1e794
Merge pull request #30085 from YHNdnzj/networkctl-edit-runtime
networkctl: introduce --runtime for editing network config under /run/
2023-12-06 22:27:01 +01:00
Zbigniew Jędrzejewski-Szmek bfa95c369a
Merge pull request #29987 from yuwata/network-bridge-vlan
network: remove unnecessary bridge vlan IDs
2023-12-06 22:25:42 +01:00
Zbigniew Jędrzejewski-Szmek d1f9a39ef4
Merge pull request #29853 from YHNdnzj/sleep-automated
logind: support Sleep() that automatically choose a sleep operation
2023-12-06 22:25:13 +01:00
Samuel BF 435c372ce5 journal-gatewayd: add since/until parameters for /entries
Request with Range header like 'entries=<cursor>:' (with a colon at the end,
invalid syntax per the doc), is now rejected with error 400 Bad Request.

fix #4883
2023-12-06 22:22:27 +01:00
Lennart Poettering fb8cc599ed analyze: add "architectures" verb that lists all known architectures 2023-12-06 22:18:14 +01:00
Luca Boccassi f08d1fea30
Merge pull request #30295 from yuwata/hostnamectl-machine-id
hostnamectl: read machine ID and boot ID through DBus
2023-12-06 21:12:36 +00:00
Lennart Poettering ffc1ec73b3 pid1: add ProtectSystem= as system-wide configuration, and default it to true in the initrd
This adds a new ProtectSystem= setting that mirrors the option of the
same of services, but in a more restrictive way. If enabled will remount
/usr/ to read-only, very early at boot. Takes a special value "auto"
(which is the default) which is equivalent to true in the initrd, and
false otherwise.

Unlike the per-service option we don't support full/strict modes, but
the door is open to eventually support that too if it makes sense. It's
not entirely trivial though as we have very little mounted this early,
and hence the mechanism might not apply 1:1. Hence in this PR is a
conservative first step.

My primary goal with this is to lock down initrds a bit, since they
conceptually are mostly immutable, but they are unpacked into a mutable
tmpfs. let's tighten the screws a bit on that, and at least make /usr/
immutable.

This is particularly nice on USIs (i.e. Unified System Images, that pack
a whole OS into a UKI without transitioning out of it), such as
diskomator.
2023-12-06 22:10:20 +01:00
Daan De Meyer 8e3dc737b2
Merge pull request #30241 from poettering/journalctl-short-file-switch
journalctl: add short option "-i" for "--file="
2023-12-06 22:07:41 +01:00
Luca Boccassi f9a284f02d
Merge pull request #30214 from bluca/wants_mounts_for
Add WantsMountsFor= and use it in the cryptsetup generator
2023-12-06 21:00:37 +00:00
Yu Watanabe 5db7eb21f9 hostname: expose machine ID and boot ID through DBus
Fixes #30293.
2023-12-06 20:51:13 +09:00
Zbigniew Jędrzejewski-Szmek 329050c5e2 systemctl: add "edit --stdin"
This is a fancy wrapper around "cat <<EOF", but:
- the user doesn't need to figure out the file name,
- parent directories are created automatically,
- daemon-reload is implied,
so it's a convenient way to create units or drop-ins.

Closes https://github.com/systemd/systemd/issues/21862.
2023-12-05 18:47:19 +01:00
Mike Yuan 5b3562898a
systemctl: add support for Sleep() logind call 2023-12-05 22:18:32 +08:00
Mike Yuan cd4dd90b99
logind: introduce Sleep() call and action that automatically choose a sleep operation 2023-12-05 22:18:32 +08:00
huyubiao 3769ba7570 fix: The example2 in hwdb.xml is unreasonable
use evdev:atkbd:dmi:bvnAcer:bvr:bdXXXXX:bd08/05/2010:svnAcer:pnX123: instead of evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123
2023-12-05 14:09:18 +01:00
Zbigniew Jędrzejewski-Szmek 465a9d2af8 man/systemctl: fix indentation of <xi:include>'s 2023-12-02 21:21:52 +01:00
Mike Yuan 2b98926f98
networkctl: introduce --runtime for editing network config under /run/ 2023-12-02 17:04:57 +08:00
Zbigniew Jędrzejewski-Szmek ef126bbe89 man/ukify: link to competing tools
Right now each of the three invocations yields a part of the picture.
Let's make it easier for users to discover the right tools.
2023-12-01 10:29:39 +01:00
Joerg Behrmann d4506301f9 man: document how to properly use a target as the Unit= of a timer 2023-11-30 17:14:31 +00:00
Lennart Poettering dde54b8a85 journalctl: add short option "-i" for "--file="
I see myself frequently typing in "journalctl --file=…". That's a lot to
type. Let's add a short switch too. Unfortunately, "-f" and "-F" are
already taken, hence let's pick "-i".
2023-11-30 16:21:00 +01:00
Lennart Poettering 12f2576854 man: add '=' suffix to journalctl switches that take parameter
As per coding style recommendations.
2023-11-30 16:21:00 +01:00
Luca Boccassi c9be8e420e cryptsetup: use WantsMountsFor= for key/header when nofail is set
The header and keyfile are necessary only for opening the device, not
for closing, so it is not necessary to deactivate the generated
cryptsetup unit when the header or keyfile backing store are removed.

This is especially useful in the case of softreboot, when the new
mount root is setup under /run/nextroot/ but we don't want to close
the cryptsetup devices for encrypted /var/ or so, and we simply
mount it directly on /run/nextroot/var/ before the soft-reboot.
2023-11-29 11:04:59 +00:00
Luca Boccassi 9e615fa3aa core: add WantsMountsFor=
This is the equivalent of RequiresMountsFor=, but adds Wants= instead
of Requires=. It will be useful for example for the autogenerated
systemd-cryptsetup units.

Fixes https://github.com/systemd/systemd/issues/11646
2023-11-29 11:04:59 +00:00
Дамјан Георгиевски 51219be992 man: typo, it's DHCP not DCHP in DHCPPrefixDelegation= 2023-11-29 04:00:15 +09:00
Yu Watanabe 2601482b85 man: also SIGKILL is sent on soft-reboot 2023-11-28 18:28:17 +09:00
Zbigniew Jędrzejewski-Szmek 467cd9f0a5 man/systemd-vconsole-setup: improve markup 2023-11-25 13:15:31 +01:00
Zbigniew Jędrzejewski-Szmek 963ea30a5d man: reword the list of PE sections in systemd-stub
Let's put the section name at the beginning of each sentence. This way we
can avoid awkward constructs like "kernel is looked for in the .linux section".
Also, since the paragraph above says that this is a list of "PE sections", we
can just say "section". In other places, it is often useful to say "PE section"
to avoid ambiguity.

Also fix the off-by-one in the count of sections.
2023-11-24 15:21:58 +01:00
Zbigniew Jędrzejewski-Szmek 99ad526f2a man: drop recommendation to use absolute paths in ExecStart*=
The only reason to recommend this would be if people had multiple commands
with the same name in the search path. This probably was never the best idea,
and it happens rarely anyway. Since the patch that dropped requirement for full
paths was introduced, we have dropped support for unmerged-usr and we're planning
to drop support for split-bin at some point too. Many people effectively have just
one directory in the search path, so there is even less reason to use an absolute
path. So let's recommend just using the command name, which makes the unit file
shorter and nicer to read.
2023-11-23 13:23:44 +01:00
Zbigniew Jędrzejewski-Szmek 83d0edf565 man/sd_bus_process: fix confusion about "synchronous"
An event loop is not "synchronous". So we shouldn't say that the client must
"synchrounusly poll" if we recommend an event loop. Let's just say it should
poll, and say that "sd_bus_wait()" is blocking, which is clearer and more
correct than "synchronous".
2023-11-23 13:23:44 +01:00
Luca Boccassi 31897753fb
Merge pull request #30024 from keszybz/one-doc-thingy
Serialize units ratelimits and document StartLimitIntervalSec=infinity
2023-11-22 17:42:51 +00:00
Yu Watanabe cf289b1415 network/dhcp: disable RapidCommit= by default when AllowList=/DenyList= is specified
AllowList= and DenyList= filter only DHCPOFFER messages. So, if
RapidCommit= is enabled, then networkd unconditionally accepts a rapid
ACK message even if its sender is filtered out by the lists.

As AllowList=/DenyList= implemented earlier than RapidCommit=, so
enabling RapidCommit= unconditionally by default may break existing
setups that use AllowList=/DenyList=.

Let's disable RapidCommit= by default when AllowList=/DenyList= is
enabled. Still the setting can be enabled by setting explicitly even
AllowList=/DenyList= is also specified.
2023-11-22 05:24:18 +09:00
Yu Watanabe 24bb67ed12 man: [DHCPv4] RapidCommit= is disabled when Anonymize=yes 2023-11-22 04:57:05 +09:00
Nils K 76d2b8da96 Fix references to ReadOnly=
PartitionReadOnly is not a valid property and ReadOnly was meant instead.
2023-11-21 19:16:15 +00:00
Luca Boccassi b595fd62e4 man: correct version tags in systemd-vmspawn
We ended up merging some changes earlier

Fixes https://github.com/systemd/systemd/issues/30091
2023-11-21 09:01:40 +09:00
Vito Caputo 165fb931ea man: add note about journald forwarding being sync
This footgun should at least be documented, if there's not going
to be a shortcut setting to establish the async `journalctl
--follow` equivalent.

Fixes: https://github.com/systemd/systemd/issues/2815
2023-11-20 12:00:36 +00:00
Martin Joerg 42c50fdf31 man: Fix example for systemd-run 2023-11-20 11:58:44 +00:00
Frantisek Sumsal f1e02423a9 login: mark the TTY property as "emits change"
Triggered by the SetTTY() method.

Follow-up to 092e6cd19a.
Addresses: https://github.com/systemd/systemd/pull/30043#pullrequestreview-1733628935
2023-11-16 11:26:26 +00:00
Frantisek Sumsal 236cb01622 login: mark the Display property as "emits change"
With the introduction of SetDisplay() method in 4885d7490b the Display
property emits a "properties changed" message every time the display is
changed using this method, so mark it appropriately.

Caught by systemd/systemd#30029:

systemd-logind[1366]: Got message type=method_call sender=:1.165 destination=org.freedesktop.login1 path=/org/freedesktop/login1/session/_310 interface=org.freedesktop.login1.Session member=SetDisplay  cookie=8 reply_cookie=0 signature=s error-name=n/a error-message=n/a
systemd-logind[1366]: Assertion 'v->vtable->flags & SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE || v->vtable->flags & SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION' failed at src/libsystemd/sd-bus/bus-objects.c:2141, function emit_properties_changed_on_interface(). Ignoring.

Follow-up to 4885d7490b.
2023-11-15 22:41:24 +01:00
Zbigniew Jędrzejewski-Szmek ea97ec6cd0 man: document StartLimitIntervalSec=infinity
This seems to work as expected. In the issue, doubts were raised whether it
works fine with daemon-reload/daemon-reexec, and it seems to work fine.
(The property cannot be set via set-property, the dbus property is 'const'.
We could relax this, but that'd be a separate feature.)

Closes #29574.
2023-11-15 17:36:10 +01:00
Mike Yuan dfb210c8fb
man/systemd-creds: fix a typo 2023-11-15 22:28:52 +08:00
Yu Watanabe 58cde42f65 core: rename MemoryZswapCurrent -> MemoryZSwapCurrent
Follow-up for 26caa66867.
2023-11-13 13:54:56 +01:00
Florian Schmaus 26caa66867 cgroup: add support for memory.zswap.current 2023-11-12 21:10:40 +01:00
Yu Watanabe 228693af47 network/brvlan: remove unnecessary bridge vlan IDs
When an interface is being reconfigured with different bridge vlan
settings, this makes old vlan IDs on the interface removed.

This also makes the PVID= setting support negative boolean value, e.g. "no",
in which case, the currently assigned PVID (typically, assigned by the
kernel when an interface is joined to a bridge) is dropped.
This feature is requested by #15291.

Note, if a .network file has no settings about bridge vlan, networkd
keeps the currently assigned vlan IDs. That's intended, to make not
break existing setups.
When a .network file has only PVID=no line in [BridgeVLAN] section, then
all assigned vlan IDs are removed.

Fixes #29975.
Closes #15291.
2023-11-13 03:58:46 +09:00
Yu Watanabe f269016c3e network/brvlan: make [BridgeVLAN] settings support an empty string
This also renames Network.pvid and friends.
2023-11-13 03:58:46 +09:00
Mike Yuan 214bed77e8
Merge pull request #29941 from Flowdalic/cgroup-memory-swap-peak
cgroup: add support for memory.swap.peak and memory.swap.current
2023-11-12 16:21:44 +08:00
Florian Schmaus 37533c9432 cgroup: add support for memory.swap.current
In systemctl-show we only show current swap if ever swapped or non-zero. This
reduces the noise on swapless systems, that would otherwise always show a swap
value that never has the chance to become non-zero. It further reduces the
noise for services that never swapped.
2023-11-11 12:16:29 +01:00
Florian Schmaus aac3384e56 cgroup: add support for memory.swap.peak 2023-11-11 12:14:07 +01:00
cvlc12 f712b11df6 Update kernel-install man page, Ukify is the default UKI_GENERATOR
Ukify is the default generator, and will be used if UKI_GENERATOR is unset. See https://github.com/systemd/systemd/pull/28687
2023-11-11 12:25:37 +09:00
Luca Boccassi be0916f77c
Merge pull request #29955 from poettering/repart-seal-key
repart: add --tpm2-seal-key= support, matching the recently added support cryptenroll has
2023-11-10 16:52:00 +00:00
Luca Boccassi d8beda5023
Merge pull request #29947 from poettering/srk-beefup
tpm2: make SRK easily accessible for use with systemd-cryptenroll --tpm2-device-key=
2023-11-10 16:47:46 +00:00
Lennart Poettering 342c70da7c man: update --tpm2-device-key= docs to reference the new ways to get the SRK 2023-11-09 12:49:29 +01:00
Lennart Poettering d30693f39b analyze: add "srk" verb to extract current srk from TPM2 chip
This is pretty low-level functionality, hence placed in systemd-analyze.
This is useful for working with systemd-cryptenroll --tpm2-device-key=,
as it acquires the SRK without requiring the full tpm2-tss tool set.
2023-11-09 12:48:27 +01:00
Lennart Poettering fbe7db47f4 tpm2-setup: also save the SRK to the file system in TPM2_PUBLIC format
We already save it in PEM format, also store it TPM2_PUBLIC format next
to it. This is useful for usage with systemd-cryptenroll's
--tpm2-device-key= switch.
2023-11-09 12:47:24 +01:00
Lennart Poettering 78fdf0f68b repart: add --tpm2-device-key= to repart, too
This adds what was added to systemd-cryptenroll recently to
systemd-repart too.

Follow-up for: c3a2a681be
2023-11-09 12:27:43 +01:00
Sam Leonard 6b30cad5e9
vmspawn: update man page to include vsock options 2023-11-09 10:36:26 +00:00
Lennart Poettering b6be6a6721 man: document explicitly tha ReadWritePaths= cannot undo superblock read-only settings
Fixes: #29266
2023-11-09 09:39:12 +01:00
Michal Sekletar e5883df89f man: document nameserver= option 2023-11-08 17:45:35 +00:00
Yu Watanabe 0fd9bea38e man: fix typo
Follow-up for a9d54de66d.
2023-11-09 00:09:13 +09:00
Lennart Poettering d33121d27d man: document that changing --uid= doesn't work
Fixes: #28982
2023-11-08 14:28:10 +01:00
Lennart Poettering 28e3359fdc man: document that Domains=local bind the domain to unicast DNS, not mDNS
Fixes: #28983
2023-11-08 14:28:10 +01:00
Lennart Poettering 28562194c4 service: say explicitly that people should not use different NonBlocking= settings if they share socket units between multiple service units
Fixes: #29600
2023-11-08 14:28:10 +01:00
Lennart Poettering 244101876c man: explicitly document compat guarantees of cryptenroll vs. cryptsetup
Fixes: #29743
2023-11-08 14:28:10 +01:00
Lennart Poettering 7480859a11 man,doc: document some aspects of user record management/homed a bit better
Fixes: #29759
2023-11-08 12:40:08 +01:00
Lennart Poettering 3cb938bd12 man: be even clearer that tmpfiles user/group/mode are applied on existing inodes
I think it was clear already, but let's be even clearer.

Fixes: #29774
2023-11-08 12:39:19 +01:00
Lennart Poettering a9d54de66d man: update COREDUMP_xyz journal fields docs
This completes/corrects the documentation for the following fields:

    COREDUMP_CGROUP= - doc where wrong, actually covered COREDUMP_PROC_CGROUP=
    COREDUMP_CMDLINE= → undocumented so far
    COREDUMP_PROC_CGROUP= → docs where there but incorrectly assigned to COREDUMP_CGROUP=
    COREDUMP_PROC_AUXV= → undocumented so far
    COREDUMP_SESSION= → undocumented so far

Fixes: #29832
2023-11-08 12:38:27 +01:00
Lennart Poettering 2e290d55fd man: add missing unit file section name to example
Fixes: #29917
2023-11-08 12:37:26 +01:00
Lennart Poettering e3c5842732
Merge pull request #28519 from ddstreet/tpm2_external_seal
Update systemd-cryptenroll to enroll TPM using only public key
2023-11-08 10:28:28 +01:00
Yu Watanabe b2622db0df
Merge pull request #29910 from yuwata/rapid-commit
dhcp: about rapid commit
2023-11-08 12:20:17 +09:00
Luca Boccassi 9871279cde
Merge pull request #29913 from keszybz/vmspawn-ci
Build vmspawn in CI and fix one test failure
2023-11-07 23:35:48 +00:00
Luca Boccassi 00666ec71f
Merge pull request #6763 from kinvolk/iaguis/no-new-privs
core: allow using seccomp without no_new_privs when unprivileged
2023-11-07 21:34:49 +00:00
Zbigniew Jędrzejewski-Szmek 30247ea76e man: many fixes systemd-vmspawn(1)
- version information
- indentation and missing tags
- mkosi and qemu don't need root
2023-11-07 21:56:42 +01:00
Luca Boccassi 13339e72d2
Merge pull request #29909 from keszybz/documentation-cleanup
Two small documentation cleanups
2023-11-07 20:46:13 +00:00
Yu Watanabe 1fa0a4eff7 network: add [DHCPServer] RapidCommit= setting 2023-11-08 02:42:03 +09:00
Zbigniew Jędrzejewski-Szmek be57c17625 man: link to new btrfs website for btrfs man pages
https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/Manpage/btrfs(5).html
says "This wiki has been archived and the content is no longer updated."
and redirects to https://btrfs.readthedocs.io/en/latest/btrfs-man5.html.
Let's move all the btrfs links to btrfs.readthedocs.io.
2023-11-07 18:35:04 +01:00
Dan Streetman c3a2a681be cryptenroll: add support for calculated TPM2 enrollment
Instead of enrolling the local TPM to a luks volume, use the public key from a
TPM to enroll it into the luks volume. This is useful when enrolling a TPM that
is not currently accessible, for example if the TPM is located on a different
system.
2023-11-07 12:20:54 -05:00
Lennart Poettering 35f58f8c36 man: document /usr/lib/modules/ paths as recommend copy source for kernel-install 2023-11-07 16:08:06 +01:00
Lennart Poettering 758d14767d kernel-install: make "inspect" work more like "add" regarding omission of parameters
This makes "kernel-install inspect" work more "kernel-install add": if
the version or kernel image is specified as "-" or omitted we'll make it
up.
2023-11-07 16:07:57 +01:00
Lennart Poettering ec1399f567 kernel-install: add add-all verb 2023-11-07 16:07:55 +01:00
Lennart Poettering 9d9e99a8f0 kernel-install: make version/kernel image parameters optional for "add"
Let's make kernel-install a bit easier to use:

If the kernel version is not specified, let's imply "uname -r", so that
we regnerate the entries for the current kernel.

If the kernel image is not specified let's imply using
/usr/lib/modules/$version/vmlinuz, i.e. the location distros like Fedora
drop the kernel into, which we generally recommend people to use.

If the kernel is not found there, don't try to automatically pick the
kernel path, and fail, as before.
2023-11-07 16:07:25 +01:00
Lennart Poettering 658e6cc4ae kernel-install: add command to list installed kernels
This simply dumps the dirs in /usr/lib/modules/ and whether they contain
a vmlinuz binary.
2023-11-07 16:07:05 +01:00
Iago López Galeiras 24832d10b6 core: allow using seccomp without no_new_privs when unprivileged
Until now, using any form of seccomp while being unprivileged (User=)
resulted in systemd enabling no_new_privs.

There's no need for doing this because:

* We trust the filters we apply
* If User= is set and a process wants to apply a new seccomp filter, it
will need to set no_new_privs itself

An example of application that might want seccomp + !no_new_privs is a
program that wants to run as an unprivileged user but uses file
capabilities to start a web server on a privileged port while
benefitting from a restrictive seccomp profile.

We now keep the privileges needed to do seccomp before calling
enforce_user() and drop them after the seccomp filters are applied.

If the syscall filter doesn't allow the needed syscalls to drop the
privileges, we keep the previous behavior by enabling no_new_privs.
2023-11-07 11:31:53 +01:00
Mike Yuan e592bf5d11
Merge pull request #29879 from Flowdalic/cgroup-memory-peak
cgroup: add support for memory.peak
2023-11-07 09:53:57 +08:00
Daan De Meyer 04a8c2ce30 kernel-install: Add --root, --image and --image-policy
Currently only supported for the "inspect" verb as "add" and "remove"
require figuring out what to do with plugins.
2023-11-06 22:29:36 +01:00
Luca Boccassi 4a5bf4896f
Merge pull request #29882 from keszybz/documentation-cleanup
Documentation cleanup
2023-11-06 21:24:08 +00:00
Zbigniew Jędrzejewski-Szmek 0155b0657d man/systemd-stub: split and simplify a wall'o'text paragraph 2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek cae4ad367d man/networkctl,systemd-soft-reboot: capitalize and add periods
We added version information, so now each bullet point contains multiple
paragraphs, so we need proper sentences.
2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek de6d05d78d man: "Documentation" is not part of the title
<ulinks> contents are used to generate a SEE ALSO section at the
bottom of a man page, so we need to include the title, without additional
words, in the content.
2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek bf63dadbc6 man: more hyperlinks and other fixes
Closes https://github.com/systemd/systemd/issues/29814.
2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek c8cd6d7bab man: use meaningful titles for <ulink>s
As pointed out in https://github.com/systemd/systemd/issues/29814, we need to
use phrases are are meaningful on their own, because the man page formatter
creates a list at the bottom. With <ulink>see docs</ulink>, we end up with:
  NOTES:
    1. see docs
       https://some.url/page
    2. see docs
       https://some.url/page2
which is not very useful :(

Also, the text inside the tag should not include punctuation.

Python helper:
  from xml_helper import xml_parse
  for p in glob.glob('../man/*.xml'):
       t = xml_parse(p)
       ulinks = t.iterfind('.//ulink')
       for ulink in ulinks:
           if ulink.text is None: continue
           text = ' '.join(ulink.text.split())
           print(f'{p}: {text}')
2023-11-06 20:16:34 +01:00
Luca Boccassi dfb4a66fd0 man: fix typo
allows to -> allows one to
2023-11-06 18:50:30 +00:00
Florian Schmaus 6c71db763c cgroup: add support for memory.peak
Linux's Control Group v2 interfaces exposes memory.peak, which contains the
"max memory usage recorded for the cgroup and its descendants since the
creation of the cgroup."

This commit adds a new property "MemoryPeak" for units and makes "systemctl
show" display this value if it is available.

Fixes #29878.

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
2023-11-06 18:08:33 +01:00
Antonio Alvarez Feijoo 1bc116a14a man/bootctl: fix --dry-run entry
Fixes 8702496bfb
2023-11-06 16:35:31 +00:00
Antonio Alvarez Feijoo 4e72e15647 man/measure: document --uname
Follow up to b6f2e68602
2023-11-06 16:35:18 +00:00
Daan De Meyer bdd36c003d kernel-install: Add --json option for inspect verb
In mkosi, we can't use kernel-install directly but we do want to
mimick its behavior as much as possible. Let's make that easier by
making it easy to fetch data from kernel-install as JSON.

To get all the necessary data, we extend the inspect verb to also
allow passing in a kernel version and initrds, to mimick the "add"
verb. The kernel version is used to determine the "Entry Directory",
and in absence of auto-detection of kernel version in kernel-install
we have to allow users to pass it.

We also add --no-pager while we're at it.
2023-11-06 14:43:09 +01:00
Daan De Meyer 30dd8e749b kernel-install: Fix doc whitespace 2023-11-06 14:39:01 +01:00
Sam Leonard 4291f4461e vmspawn: extend kernel cmdline with extra args
This changes how the "extra" command line arguments passed to vmspawn
are handled.

Previously they were appended to the QEMU command line directly.
Now they are appended to the kernel command line using SMBIOS instead.
2023-11-06 11:46:38 +00:00
Yu Watanabe 986e182352 network: do not try to set invalid value for IPv6 hop limit 2023-11-06 15:53:25 +09:00
Luca Boccassi 53db2e057d
Merge pull request #29858 from bluca/news
man/NEWS update for sleep.conf
2023-11-04 10:43:35 +00:00
Luca Boccassi 2c9fa8d3f0 man: drop obsolete reference to SuspendMode=
Follow-up for 1f82c21dce
2023-11-04 10:43:08 +00:00
Yu Watanabe e423b40d35 tree-wide: fix typo 2023-11-04 11:58:12 +09:00
Maanya Goenka db776f6935 portable: add support for confext
Support confexts for portable services
2023-11-03 16:59:58 +00:00
Luca Boccassi 8d04721507
Merge pull request #28891 from poettering/pcrlock
new pcrlock tool for generating signed PCR policies for PCR 0, 1, 4, …
2023-11-03 16:07:43 +00:00
Luca Boccassi 1af46aecf5
Merge pull request #29508 from CodethinkLabs/systemd-vmspawn-pr
systemd-vmspawn implementation that only supports disk images
2023-11-03 16:04:38 +00:00
Lennart Poettering fe1f83e559
Merge pull request #29827 from yuwata/network-install-default-configs
network: add meson option to install default configs
2023-11-03 11:37:04 +01:00
Lennart Poettering e206210909 man: document pcrlock 2023-11-03 11:24:58 +01:00
Yu Watanabe 45a7ef454e man: mention DHCPv4 Router option is ignored when Classless Static Routes option is received
For #29564.
2023-11-03 10:14:59 +00:00
Yu Watanabe 2c4534854a man: mention that network files should be prefixed with number smaller than 70 2023-11-03 11:42:19 +09:00
Sam Leonard 5b1c37775b
vmspawn: created man page 2023-11-02 16:21:40 +00:00
Lennart Poettering eae4943afa man: add docs for new storagetm service 2023-11-02 14:19:32 +01:00
Lennart Poettering c2ba2625d7 man: run ninja update-man-rules again
Apparently this has been forgotten a couple of times.
2023-11-01 16:02:05 +01:00