1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

8908 Commits

Author SHA1 Message Date
Lennart Poettering
0f0bed8be6 measure: introduce support for a new ".profile" section
This introduces the concept, and makes sure systemd-measure covers it.
See a later commit for details on the new section.
2024-09-06 11:15:45 +02:00
Lennart Poettering
41902bacc3
Merge pull request #34256 from YHNdnzj/pid1-followup
core: follow-ups for recent PRs
2024-09-05 17:01:10 +02:00
Yu Watanabe
8d78191a46 man: ARP=no also disables IPv6 Neighbor Discovery Protocol
Addresses https://github.com/systemd/systemd/issues/18063#issuecomment-2323410288.
2024-09-05 10:20:18 +09:00
Mike Yuan
7a9f0125bb
core: rename BindJournalSockets= to BindLogSockets=
Addresses https://github.com/systemd/systemd/pull/32487#issuecomment-2328465309
2024-09-04 21:44:25 +02:00
Daan De Meyer
2b9ced9072 network: Add support for mq qdisc 2024-09-04 14:56:40 +02:00
Daan De Meyer
3f14557ce0 network: Add support for multiq qdisc 2024-09-04 14:56:37 +02:00
Mike Yuan
368a3071e9
core: introduce BindJournalSockets=
Closes #32478
2024-09-03 21:04:50 +02:00
Daan De Meyer
27cacec939 repart: Add compression support
Now that mkfs.btrfs is adding support for compressing the generated
filesystem (https://github.com/kdave/btrfs-progs/pull/882), let's
add general support for specifying the compression algorithm and
compression level to use.

We opt to not parse the specified compression algorithm and instead
pass it on as is to the mkfs tool. This has a few benefits:

- We support every compression algorithm supported by every tool
  automatically.
- Users don't need to modify systemd-repart if a mkfs tool learns a
  new compression algorithm in the future
- We don't need to maintain a bunch of tables for filesystem to map
  from our generic compression algorithm enum to the filesystem specific
  names.

We don't add support for btrfs just yet until the corresponding PR
in btrfs-progs is merged.
2024-09-03 08:49:49 +02:00
Daan De Meyer
47acac6049
Merge pull request #34149 from DaanDeMeyer/btrfs
repart: Switch to new mkfs.btrfs subvolume API
2024-09-03 08:47:50 +02:00
Christoph Anton Mitterer
3e98472223 man: fix typos
Closes #34199.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2024-08-31 13:59:02 +09:00
Yu Watanabe
3722db214b man: fix typo
Follow-up for 1ff0164be5.
2024-08-31 11:19:15 +09:00
Daan De Meyer
562881c178 repart: Switch to new mkfs.btrfs subvolume API
In https://github.com/kdave/btrfs-progs/pull/877 the API is changing
to "--subvol <path>:ro,default" so let's adapt our usage to match.

This also adds support for read-only subvolumes.

Fixes #34134
2024-08-30 12:18:10 +02:00
Luca Boccassi
5162829ec8 core: do BindMount/MountImage operations in async control process
These operations might require slow I/O, and thus might block PID1's main
loop for an undeterminated amount of time. Instead of performing them
inline, fork a worker process and stash away the D-Bus message, and reply
once we get a SIGCHILD indicating they have completed. That way we don't
break compatibility and callers can continue to rely on the fact that when
they get the method reply the operation either succeeded or failed.

To keep backward compatibility, unlike reload control processes, these
are ran inside init.scope and not the target cgroup. Unlike ExecReload,
this is under our control and is not defined by the unit. This is necessary
because previously the operation also wasn't ran from the target cgroup,
so suddenly forking a copy-on-write copy of pid1 into the target cgroup
will make memory usage spike, and if there is a MemoryMax= or MemoryHigh=
set and the cgroup is already close to the limit, it will cause an OOM
kill, where previously it would have worked fine.
2024-08-29 12:48:55 +01:00
Yu Watanabe
3fe0fd20c9 udevadm/info: also show driver subsystem and device ID
This adds two more fields in 'udevadm info':
- J for device ID, e.g. b128:1, c10:1, n1, and so on.
- B for driver subsystem, e.g. pci, i2c, and so on.

These, especially the device ID field may be useful to find udev
database file under /run/udev/data for a device.
2024-08-28 05:26:26 +09:00
Yu Watanabe
1ff0164be5 sd-device: make device_get_device_id() public
We have already exposed sd_device_new_from_device_id(), but we have
never provide the way to get device ID from an existing sd_device
object.
2024-08-28 05:26:04 +09:00
Yu Watanabe
44bc6f3cab sd-device: introduce sd_device_get_driver_subsystem()
To create the sd_device object of a driver, the function
sd_device_new_from_subsystem_sysname() requires "drivers" for subsystem
and e.g. "pci:iwlwifi" for sysname. Similarly, sd_device_new_from_device_id()
also requires driver subsystem. However, we have never provided a
way to get the driver subsystem ("pci" for the previous example) from
an existing sd_device object.

Let's introduce a way to get driver subsystem.
2024-08-28 05:18:14 +09:00
Adrian Vovk
88261bcf3b
Merge pull request #33570 from AdrianVovk/sysupdate-incomplete
sysupdate: Handle incomplete versions
2024-08-27 13:04:02 -04:00
Luca Boccassi
7d8bbfbe08 service: add 'debug' option to RestartMode=
One of the major pait points of managing fleets of headless nodes is
that when something fails at startup, unless debug level was already
enabled (which usually isn't, as it's a firehose), one needs to manually
enable it and pray the issue can be reproduced, which often is really
hard and time consuming, just to get extra info. Usually the extra log
messages are enough to triage an issue.

This new option makes it so that when a service fails and is restarted
due to Restart=, log level for that unit is set to debug, so that all
setup code in pid1 and sd-executor logs at debug level, and also a new
DEBUG_INVOCATION=1 env var is passed to the service itself, so that it
knows it should start with a higher log level. Once the unit succeeds
or reaches the rate limit the original level is restored.
2024-08-27 12:24:45 +01:00
Luca Boccassi
23e3bddc48
Merge pull request #34114 from yuwata/resolvconf-p
resolve: support 'resolvconf -p'
2024-08-27 11:18:34 +01:00
Yu Watanabe
44eee910c0
Merge pull request #34124 from YHNdnzj/socket-accept-name
core: honor FileDescriptorName= too for Accept=yes sockets, plus several other cleanups
2024-08-27 12:11:20 +09:00
Yu Watanabe
374825ec05 resolvconf: disable default route when -p is specified
Internally, the switch triggers 'resolvectl default-route INTERFACE no'.

Closes #34112.
2024-08-27 05:30:06 +09:00
Allison Karlitskaya
2bdf027de1 man: document "web" session type
This has been supported since e9e74f28d7 but never got documented.
Add it to the man pages (plus one comment in a header).

Closes #34127.
2024-08-26 16:54:59 +01:00
Mike Yuan
daa78907af
core: honor FileDescriptorName= too for Accept=yes sockets
So far we manually hardcoded $LISTEN_FDNAMES to "varlink" in various
varlink service units we ship, even though FileDescriptorName=varlink
is specified in associated socket units already, because
FileDescriptorName= is currently silently ignored when combined with
Accept=yes. Let's step away from this, which seems saner.

Note that this is technically a compat break, but a mostly negligible
one as there shall be few users setting FileDescriptorName= but
still expecting LISTEN_FDNAMES=connection in the actual executable.

Preparation for #34080
2024-08-26 15:40:15 +02:00
Yu Watanabe
36f6e87dd3 man: reword about default route for DNS traffic
DefaultRoute is a D-Bus property, not a valid setting name in .network
files nor resolved.conf.
Whether a link is the default route or not is configured with
DNSDefaultRoute= setting in .network files.
2024-08-26 11:14:26 +01:00
Yu Watanabe
5537e4417c updatectl: fix typo and drop space in empty lines
Follow-ups for ec15bb71c2 (#32363).
2024-08-23 23:10:24 +09:00
Yu Watanabe
b6b9ddb2b5
Merge pull request #34087 from DaanDeMeyer/nspawn-init-revert
Revert "nspawn: Allow specifying custom init program"
2024-08-23 07:42:16 +09:00
Daan De Meyer
615226abd8 Revert "nspawn: Allow specifying custom init program"
I don't actually need this anymore since we're going with a
unit based approach for the containers stuff internally so
let's just revert it.

Fixes #34085

This reverts commit ce2291730d.
2024-08-22 22:20:42 +02:00
Adrian Vovk
631803cccd
sysupdate: Repair incomplete versions in-place
A previous commit made sysupdate recognize installed versions where some
transfers are missing. This commit teaches sysupdate how to correctly
repair these incomplete versions.

Previously, if you had a incomplete installation of the OS booted, and
ran sysupdate in an attempt to repair it, sysupdate would make things
worse by creating copies of the currently-booted partitions in the
inactive slots. Then at boot you have two identical partitions, with
identical labels an UUIDs, and end up with a mess.

With this commit, sysupdate is able to recognize situations where it can
simply download the missing transfers and leave the rest of the system
undistrubed.

Partial fix for https://github.com/systemd/systemd/issues/33339
2024-08-22 16:00:46 -04:00
Adrian Vovk
57ada07e7a
sysupdate: Track incompletely-installed versions
When enumerating what versions exist for a given target, sysupdate would
completely throw out any version that's incomplete (where some of the
transfers in the target have that version installed or available, and
other transfers do not).

If we're trying to find what versions we can offer for download, this is
great behavior. If the server side is advertising a partial update to
download, we shouldn't present it to the user.

On the other hand, if we're enumerating what versions we have currently
installed, this is a bad behavior. It makes sysupdate fragile. For
example, if a sysext introduces a new .conf file into
/usr/lib/sysupdate.d, suddenly the currently-installed OS stops being a
version that we've enumerated. Since it's not enumerated, it's not
protected, and so sysupdate will wipe the booted OS.

So if we're looking for installed versions, we now loosen the
restrictions and enumerate incomplete installations.

Partial fix for https://github.com/systemd/systemd/issues/33339
2024-08-22 16:00:45 -04:00
Adrian Vovk
0402bf682f
sysupdate: Check that --instances-max is in bounds
Otherwise user can pass in --instances-max=0 and crash sysupdate with an
assertion failure.
2024-08-22 16:00:44 -04:00
Mike Yuan
1aeea8a60a
logind: DesignatedMaintenanceTime is added in v257 and constant
Follow-up for 0e10c3d872

Addresses https://github.com/systemd/systemd/pull/25049#discussion_r1647513862
2024-08-22 20:06:31 +02:00
Lennart Poettering
d1b04f47e3 man: document .membership files that nss-systemd processes
This has been a glaring omission the docs: when people create
.user/.group/.user-privileged/.group-privileged drop-in files, they
should also create matching .membership files.
2024-08-22 15:16:00 +02:00
Yu Watanabe
80c9c81779
Merge pull request #34051 from rpigott/resolved-demote-fallback
resolved: demote only the fallback servers in the global scope
2024-08-22 20:21:33 +09:00
Adrian Vovk
d470a6c227
sysupdate: man: Cleanup sections about flags 2024-08-21 22:40:18 -04:00
Adrian Vovk
e0081f18a0
sysupdated: Fixup redundant constant name
SD_ stands for systemd, so SD_SYSTEMD_* is SYSTEMD_SYSTEMD_*
2024-08-21 22:33:16 -04:00
Adrian Vovk
38d7b8d3ff
Merge pull request #32363 from CodethinkLabs/sysupdate-dbus
sysupdate: Implement dbus service
2024-08-21 15:35:34 -04:00
Yu Watanabe
2ddf5bdece
Merge pull request #34053 from YHNdnzj/follow-ups
Two follow-ups for recent PRs
2024-08-22 04:34:11 +09:00
A. Wilcox
b9d326c568 man: Ensure notify example includes <string.h>
This ensures that memcpy and strerror are defined.  This is especially
important with GCC 14 as implicit function declarations are now an error.
2024-08-22 04:26:32 +09:00
Ronan Pigott
d229e282d6 resolved: demote the fallback dns servers
This softens the behavior originally introduced in eded61e410 to apply
only to the fallback dns servers.

The intent is that the global FallbackDNS (instead of DNS) can now be
used in conjunction with the per-link dns, providing a fallback behavior
without introducing a scope overlap.

References: eded61e410 (resolved: demote the global unicast scope, 2024-08-19)
2024-08-21 10:27:07 -07:00
Daan De Meyer
148b16cb2a
Merge pull request #33498 from DaanDeMeyer/btrfs
repart: Allow Subvolumes= when running offline
2024-08-21 17:19:09 +02:00
Ronan Pigott
bebec88653 Revert "resolved: demote the global unicast scope"
This commit may have been a breaking change for sd-resolved foreign
resolv.conf mode, where a legacy network management daemon directly
modifies resolv.conf and sd-resolved consumes that.

This reverts commit eded61e410.
2024-08-21 06:59:22 -07:00
Mike Yuan
988ca0953e
man: use standard-options for --no-ask-password everywhere 2024-08-21 15:17:02 +02:00
Luca Boccassi
bdf75118ba
Merge pull request #34049 from yuwata/network-routing-policy-rule
network: further rework for routing policy rule
2024-08-21 12:46:37 +02:00
Daan De Meyer
eca3d07dd1 repart: Allow Subvolumes= and DefaultSubvolume= when running offline
mkfs.btrfs has recently learned new options --subvol and --default-subvol
so let's stop failing when Subvolumes= and DefaultSubvolume= are used offline
and use the new --subvol and --default-subvol options instead to create subvolumes
in the generated root filesystem without root privileges or loop devices.
2024-08-21 11:29:47 +02:00
Adrian Vovk
ec15bb71c2
sysupdate: Implement updatectl
This is the command-line tool to manage systemd-sysudpated

Co-authored-by: Tom Coldrick <thomas.coldrick@codethink.co.uk>
Co-authored-by: Abderrahim Kitouni <abderrahim.kitouni@codethink.co.uk>
2024-08-21 09:31:41 +01:00
Adrian Vovk
bf2c741fd7
sysupdate: Implement systemd-sysupdated dbus service
Co-authored-by: Tom Coldrick <thomas.coldrick@codethink.co.uk>
Co-authored-by: Abderrahim Kitouni <abderrahim.kitouni@codethink.co.uk>
2024-08-21 09:31:41 +01:00
Yu Watanabe
ac1d8aa5bc network/routing-policy-rule: support all known type of rule
This also adds GoTo= to specify the target priority of goto rule.

Note, table was the default but could not be specified in Type=.
2024-08-20 21:02:31 +09:00
Yu Watanabe
489671d225 network/address-label: allow to configure IPv6 address label in networkd.conf
Closes #23159.
2024-08-20 20:50:56 +09:00
Lennart Poettering
8915e4aef5 man: fix ID_NET_LABEL_ONBOARD= documentation
We do not prefix the field with anything, since
8c053c83ae.
2024-08-20 20:30:39 +09:00
Luca Boccassi
a8d1f9da55
Merge pull request #34009 from yuwata/network-resolve-polkit
network,resolve: support interactive authentication
2024-08-20 12:14:03 +02:00