1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00
Commit Graph

806 Commits

Author SHA1 Message Date
Gaël PORTAY
51ac5cfc05 docs: add a missing : character
This adds the missing colon character to the section systemd-sysusers.

(cherry picked from commit 8ef5ea2bf6d8c9ef12b00ab3838b9af81e30bf5d)
(cherry picked from commit 6a288cd999090661461be74f24fd29cb90da1f3f)
(cherry picked from commit a2c6d50b64)
(cherry picked from commit 4b21746e21)
2024-11-16 10:30:57 +00:00
Lennart Poettering
18002c8364 man: document preference for secure_getenv() in coding style
(cherry picked from commit c9b477415a6293b74df67c8118bafb0ef8662819)
(cherry picked from commit 1f0d68c6e9dc7cc9bd14f47d03eec10389e2c845)
(cherry picked from commit 833a89efc7)
(cherry picked from commit 6bb1aba753)
2024-11-16 10:30:57 +00:00
Daan De Meyer
778f622380 docs: Mention the new mount API in the container interface doc
Let's mention that the new mount API may be used to establish new
mounts in a container without needing the /run/host/incoming directory.

(cherry picked from commit 74cc5e2041a2c32e1824b32316bd95f2c8a811f5)
(cherry picked from commit 65eff444c4fa7be5eb1be71c5d94ab8732167e11)
(cherry picked from commit 53d92de4b4)
(cherry picked from commit c12ef9e5dd)
2024-08-19 20:22:44 +02:00
Daan De Meyer
dffd9597fc docs: Add section to HACKING.md on distribution packages
(cherry picked from commit 17ef81a764995dfd0f43daf34dcf2ab04806e760)
(cherry picked from commit 0a97db87893e706011f0ed7e522a42fcd3767ac4)
(cherry picked from commit 3ced17fb98)
(cherry picked from commit 21184a6a82)
2024-07-07 00:15:21 +02:00
Mike Yuan
dfd7f210d3 docs/CODING_STYLE: document that we nowadays prefer (const char*) for func ret type
Addresses https://github.com/systemd/systemd/pull/33567#discussion_r1662818225

(cherry picked from commit 4b7249111a4c1d366f476bdbd6e03f7893eb9d42)
(cherry picked from commit 3c91ea49d249cda6e1fa84b53a42dee6d83339da)
(cherry picked from commit b8d993f029)
(cherry picked from commit 661fa2d832)
2024-07-07 00:15:21 +02:00
Zbigniew Jędrzejewski-Szmek
b33b1d459b docs/UID-GIDS: use the modern spellings of pkg-config variables
(cherry picked from commit 4e434bc096)
(cherry picked from commit dad12ab2a2)
(cherry picked from commit 588053817f)
2024-02-28 10:29:35 +00:00
Zbigniew Jędrzejewski-Szmek
27913c1aee docs/UID-GIDS: mention that ranges are actually configurable
It silly for our docs to say that they aren't when we added support for this a
few years ago.

Also, drop some mentions of "runtime". This implied that those values can be
changed almost at will, but actually, they can only be meaningfully changed
_before_ the allocations are made.

(cherry picked from commit 7e4f30c3d0)
(cherry picked from commit 00ed84c34b)
(cherry picked from commit 8992968463)
2024-02-28 10:29:35 +00:00
Colin Walters
b28b9db29b docs/CREDENTIALS: Don't write authorized_keys with executable bits
No reason to make this file executable.

(cherry picked from commit 47374e0601)
(cherry picked from commit 30f9309fe5)
(cherry picked from commit e09ef87711)
2023-12-23 20:42:40 +01:00
Jeremy Fleischman
552c42c560 Fix some typos in RESOLVED-VPNS.md
(cherry picked from commit 121cb88292)
(cherry picked from commit e1b7f4af97)
2023-12-06 11:15:01 +01:00
Lennart Poettering
318c3afcba man,doc: document some aspects of user record management/homed a bit better
Fixes: #29759
(cherry picked from commit 7480859a11)
(cherry picked from commit 912fb76f3a)
2023-11-09 21:05:51 +00:00
Lennart Poettering
d5879d30c2 doc: document explicitly when we require specific top-level mounts to be established
(cherry picked from commit df586a49bb)
(cherry picked from commit 214a827fba)
2023-11-09 21:05:51 +00:00
Joerg Behrmann
e31805d26a credentials: document that their path is stable for system services
(cherry picked from commit cf37171890)
(cherry picked from commit 823216d61f)
2023-11-09 21:05:51 +00:00
Frantisek Sumsal
b9990ee4a7 tree-wide: use https for the 0pointer.de doc links
(cherry picked from commit dc7e580e64)
2023-07-07 19:30:52 +01:00
Zbigniew Jędrzejewski-Szmek
07523a0ea4 docs/CREDENTIALS: fix confusion of i.e. and e.g.
(cherry picked from commit 5811490a3f)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
e17d4351a7 docs: s/authorized_key/authorized_keys/
(cherry picked from commit 13bf321610)
2023-03-29 16:56:51 +02:00
Jan Engelhardt
c181761f9a doc: correct wrong use "'s" contractions
(cherry picked from commit 18fe76eba5)
2023-03-28 18:57:49 +02:00
Mike Yuan
7b5b85286f docs: update unit name for sd-tmpfiles-setup
(cherry picked from commit 7d33146dbc)
2023-03-28 18:16:46 +02:00
Dmitry V. Levin
30fd9a2dab treewide: fix a few typos in NEWS, docs and comments 2023-02-15 10:41:03 +00:00
Yu Watanabe
0b75493da0 tree-wide: fix typo and comment style update 2023-02-15 10:08:16 +09:00
Geert Lorang
d5e3d3465c docs/NETWORK_ONLINE: fix example
Type=oneshot is necessary for systemd to actually wait for the service
to return. With RemainAfterExit=yes it won't be started again.

Fixes #26342.
2023-02-08 16:53:53 +00:00
Zbigniew Jędrzejewski-Szmek
1e8f5f79e1 docs/CODING_STYLE: add sentence about redirection operators 2023-02-06 09:19:04 +01:00
Zbigniew Jędrzejewski-Szmek
7a17e41dcf test: drop whitespace after shell redirection operators
(The one case that is left unchanged is '< <(subcommand)'.)

This way, the style with no gap was already dominant. This way, the reader
immediately knows that ' < ' is a comparison operator and ' << ' is a shift.

In a few cases, replace custom EOF replacement by just EOF. There is no point
in using someting like "_EOL" unless "EOF" appears in the text.
2023-02-06 09:19:04 +01:00
wouter bolsterlee
3d3e51eff2 docs: tweak rsync flags for moving existing home dir to systemd-homed
The documentation on moving an existing homedir into a systemd-homed managed
one suggests using rsync(1) with a bunch of flags to preserve as much metadata
as possible: permissions, xattrs, timestamps, etc. The previously suggested
flags were:

    rsync -aHAXv --remove-source-files …

… which does include mtimes, but not ctimes and atimes, because -a does not
include those:

    --archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)

This change adds the -N and -U flags to preserve even more file timestamps,
turning the command into:

    rsync -aHANUXv --remove-source-files …

The new flags are:

    --crtimes, -N            preserve create times (newness)
    --atimes, -U             preserve access (use) times
2023-02-01 20:47:56 +00:00
cake03
98a6d8505d update footer to 2023 2023-01-29 20:26:28 +09:00
Daan De Meyer
246fd4d2ed docs: Update HACKING.md to mention latest mkosi is needed
Let's require users to run mkosi from git so we can fix any issues
forward instead of trying to keep the configs working with older
versions.
2023-01-24 22:05:49 +01:00
Luca Boccassi
6a21cb2b60 docs: update instructions for translation strings 2023-01-24 13:30:02 +00:00
Luca Boccassi
7fafa15049 docs: drop manual rc PR warning step
it is not automated, yay
2023-01-24 12:34:00 +00:00
Dmitry V. Levin
5c7a4f21dd docs, man: consistently use comma after "For example" 2023-01-23 22:52:34 +00:00
Dmitry V. Levin
bed1feaf3a docs: fix formatting a bit 2023-01-23 22:52:34 +00:00
Dmitry V. Levin
e347d53ace docs: fix grammar a bit 2023-01-23 22:52:34 +00:00
Dmitry V. Levin
d8b67e05fb docs: fix a few typos 2023-01-23 22:52:34 +00:00
Luca Boccassi
71c6f0ac52
Merge pull request #23309 from DaanDeMeyer/log-context
basic: Add log context
2023-01-20 15:01:03 +00:00
Lennart Poettering
f591cf66f0 doc: document how we expect empty lines to be used 2023-01-17 21:26:13 +01:00
Lennart Poettering
6c51b49ce0 tpm2: add common helper for checking if we are running on UKI with TPM measurements
Let's introduce a common implementation of a function that checks
whether we are booted on a kernel with systemd-stub that has TPM PCR
measurements enabled. Do our own userspace measurements only if we
detect that.

PCRs are scarce and most likely there are projects which already make
use of them in other ways. Hence, instead of blindly stepping into their
territory let's conditionalize things so that people have to explicitly
buy into our PCR assignments before we start measuring things into them.
Specifically bind everything to an UKI that reported measurements.

This was previously already implemented in systemd-pcrphase, but with
this change we expand this to all tools that process PCR measurement
settings.

The env var to override the check is renamed to SYSTEMD_FORCE_MEASURE,
to make it more generic (since we'll use it at multiple places now).
This is not a compat break, since the original env var for that was not
included in any stable release yet.
2023-01-17 09:42:16 +01:00
Luca Boccassi
f86d037623 docs/man: remove reference to default vsock CID
This was dropped on reviewers' request in the revision that got merged,
but reference in two documents was not updated. Fix it.

Follow-up for: https://github.com/systemd/systemd/pull/25918
2023-01-15 22:17:15 +00:00
Ludwig Nussel
2e76ca79b3 bootctl: honor $KERNEL_INSTALL_CONF_ROOT
Honor $KERNEL_INSTALL_CONF_ROOT for reading config files, as
kernel-install does.
2023-01-10 15:17:07 +01:00
Daan De Meyer
7c7a9138a2 basic: Add log context
This commit adds support for attaching extra metadata to log
messages written to the journal via log.h. We keep track of a
thread local log context in log.c onto which we can push extra
metadata fields that should be logged. Once a field is no longer
relevant, it can be popped again from the log context.

On top of this, we then add macros to allow pushing extra fields
onto the log context.

LOG_CONTEXT_PUSH() will push the provided field onto the log context
and pop the last field from the log context when the current block
ends. LOG_CONTEXT_PUSH_STRV() will do the same but for all fields in
the given strv.

Using the macros is as simple as putting them anywhere inside a block
to add a field to all following log messages logged from inside that
block.

void myfunction(...) {
	...

	LOG_CONTEXT_PUSH("MYMETADATA=abc");

	// Every journal message logged will now have the MYMETADATA=abc
        // field included.
}

For convenience, there's also LOG_CONTEXT_PUSHF() to allow constructing
the field to be logged using printf() syntax.

log_context_new()/log_context_free() can be used to attach a log context
to an async operation by storing it in the associated userdata struct.
2023-01-08 16:31:16 +01:00
Lennart Poettering
7122aee5ab
Merge pull request #25918 from bluca/smbios_sd_notify
Support AF_VSOCK in sd_notify and pick up notify_socket from creds
2023-01-06 15:21:27 +01:00
Sam James
4e11b54b31 CODING_STYLE: fix 'better' typo 2023-01-06 14:03:19 +01:00
Luca Boccassi
4a91ace5bc creds: import 'vmm.notify_socket' and use it to set
This is intended to be used with VSOCK, to notify the hypervisor/VMM, eg on the host:

qemu <...> -smbios type=11,value=io.systemd.credential:vmm.notify_socket=vsock:2:1234 -device vhost-vsock-pci,id=vhost-vsock-pci0,guest-cid=42

(vsock:2:1234 -> send to host on vsock port 1234, default is to send to 0 which is
the hypervisor itself)

Also on the host:

$ socat - VSOCK-LISTEN:1234,socktype=5
READY=1
STATUS=Ready.
2023-01-05 23:07:16 +01:00
Lennart Poettering
6ae5c39af1 docs: remove /dev/tty* confusion
The text said /dev/tty* as a whole was the VT subsystem and that VT is
not supported in containers.

But that's not accurate as /dev/tty* will match /dev/tty too and that
one device node is special and is not related to VT: it always points to
the current process own controlling tty, regardless what that is.

hence, rewrite /dev/tty* as /dev/tty[0-9]*.
2022-12-23 21:17:31 +01:00
Lennart Poettering
80ce8580f5 dissect-image: let's lock down fstypes a bit
When we dissect images automatically, let's be a bit more conservative
with the file system types we are willing to mount: only mount common
file systems automatically.

Explicit mounts requested by admins should always be OK, but when we do
automatic mounts, let's not permit barely maintained, possibly legacy
file systems.

The list for now covers the four common writable and two common
read-only file systems. Sooner or later we might want to add more to the
list.

Also, it might make sense to eventually make this configurable via the
image dissection policy logic.
2022-12-22 10:30:35 +09:00
Zbigniew Jędrzejewski-Szmek
254d1313ae tree-wide: use -EBADF for fd initialization
-1 was used everywhere, but -EBADF or -EBADFD started being used in various
places. Let's make things consistent in the new style.

Note that there are two candidates:
EBADF 9 Bad file descriptor
EBADFD 77 File descriptor in bad state

Since we're initializating the fd, we're just assigning a value that means
"no fd yet", so it's just a bad file descriptor, and the first errno fits
better. If instead we had a valid file descriptor that became invalid because
of some operation or state change, the other errno would fit better.

In some places, initialization is dropped if unnecessary.
2022-12-19 15:00:57 +01:00
Aidan Dang
8f30c00c50 Implement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for homed LUKS directories 2022-12-15 22:22:10 +01:00
Quentin Deslandes
523ea1237a journal: log filtering options support in PID1
Define new unit parameter (LogFilterPatterns) to filter logs processed by
journald.

This option is used to store a regular expression which is carried from
PID1 to systemd-journald through a cgroup xattrs:
`user.journald_log_filter_patterns`.
2022-12-15 09:57:39 +00:00
Yu Watanabe
a6e16d949c
Merge pull request #25723 from keszybz/generators-tmp
Run generators with / ro and /tmp mounted
2022-12-15 12:53:49 +09:00
Zbigniew Jędrzejewski-Szmek
9f563f2792 tree-wide: use mode=0nnn for mount option
This is an octal number. We used the 0 prefix in some places inconsistently.
The kernel always interprets in base-8, so this has no effect, but I think
it's nicer to use the 0 to remind the reader that this is not a decimal number.
2022-12-14 22:12:44 +01:00
Jiayi Chen
b1c4466bba doc: add language decorator on the code block
Add `c` decorator on the code block for applying syntax highlighting.
2022-12-14 18:07:07 +09:00
January
5537165879 doc: add an example code to lock the whole disk
add an example to leverage `libsystemd` infrastructure to get the whole disk of a block device and take BSD lock on it #25046
2022-12-13 14:55:57 +01:00
Lennart Poettering
09e917ea4d repart: support erofs
So, i think "erofs" is probably the better, more modern alternative to
"squashfs". Many of the benefits don't matter too much to us I guess,
but there's one thing that stands out: erofs has a UUID in the
superblock, squashfs has not. Having an UUID in the superblock matters
if the file systems are used in an overlayfs stack, as overlayfs uses
the UUIDs to robustly and persistently reference inodes on layers in
case of metadata copy-up.

Since we probably want to allow such uses in overlayfs as emplyoed by
sysext (and the future syscfg) we probably should ramp up our erofs game
early on. Hence let's natively support erofs, test it, and in fact
mention it in the docs before squashfs even.
2022-12-10 11:26:36 +01:00