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

9053 Commits

Author SHA1 Message Date
Luca Boccassi
1da80d2ca3
sd-daemon: some tweaks (#35011) 2024-11-05 00:56:28 +00:00
Daan De Meyer
b5dc805583 tmpfiles: Implement L? to only create symlinks if source exists
This allows a single tmpfiles snippet with lines to symlink directories
from /usr/share/factory to be shared across many different configurations
while making sure symlinks only get created if the source actually exists.
2024-11-04 19:04:21 +01:00
Lennart Poettering
cb42df5310 sd-daemon: add fd array size safety check to sd_notify_with_fds()
The previous commit removed the UINT_MAX check for the fd array. Let's
now re-add one, but at a better place, and with a more useful limit. As
it turns out the kernel does not allow passing more than 253 fds at the
same time, hence use that as limit. And do so immediately before
calculating the control buffer size, so that we catch multiplication
overflows.
2024-11-04 12:10:09 +01:00
Daan De Meyer
a07864a4fe bootctl: Add --secure-boot-auto-enroll
When specified, bootctl install will also set up secure boot
auto-enrollment. For now, We sign all variables using the same
certificate and key pair.
2024-11-03 10:46:17 +01:00
Andres Beltran
eae5127246 core: add id-mapped mount support for Exec directories 2024-11-01 18:45:28 +00:00
Lennart Poettering
acc35e5129
core/service: don't propagate stop jobs if RestartMode=direct (#34768)
Fixes https://github.com/systemd/systemd/issues/34758
2024-11-01 17:25:49 +01:00
Luca Boccassi
890bdd1d77 core: add read-only flag for exec directories
When an exec directory is shared between services, this allows one of the
service to be the producer of files, and the other the consumer, without
letting the consumer modify the shared files.
This will be especially useful in conjunction with id-mapped exec directories
so that fully sandboxed services can share directories in one direction, safely.
2024-11-01 10:46:55 +00:00
Lennart Poettering
cbddc201e5 man: <strong> is not a valid docbook tag, but <emphasis> is 2024-11-01 10:12:44 +01:00
Luca Boccassi
e4a4a5bd2b
Rework sysupdate meson options (#34832)
systemd-sysupdated is still unstable and we'd like to make breaking
changes to it even after the v257 release, so we document it as such and
disable building it by default in release builds. The distro can still
opt-in, and we still build it in developer mode so it has CI coverage
2024-10-31 21:10:28 +00:00
Zbigniew Jędrzejewski-Szmek
243b63d8a6 meson: add separate option for sysupdated, disable in release builds
This commit introduces a build-time option to enable/disable sysupdated
separately from sysupdate. 'auto' translated to enabled by default in
developer builds.
2024-10-31 21:08:08 +00:00
Yu Watanabe
2e612ce1b7 man: update documentation for 'networkctl reload' 2024-10-31 05:33:10 +09:00
Luca Boccassi
14b0fcdf6d logind: add BlockWeakInhibited property
Fixes https://github.com/systemd/systemd/issues/34091
Follow-up for 804874d26a
2024-10-30 17:41:52 +01:00
Luca Boccassi
58ada3eab2
coredump: AccessContainer= bunch of followups (#34333)
Fixes #34130
2024-10-30 14:37:44 +00:00
Adrian Vovk
89696521d2 man: warn that sysupdate's API is unstable
There's still some breaking changes we want to make to sysupdated, but
they'll potentially take months and we don't want to block the systemd
release for that long. So, we can instead mark sysupdate's API as
unstable
2024-10-30 14:45:16 +01:00
Michal Sekletar
e26a7e08f5 coredump: rename AccessContainer= to EnterNamespace= 2024-10-30 12:38:27 +00:00
Lennart Poettering
5c11f6e0a9
core/service: support sd_notify() MAINPIDFD=1 and MAINPIDFDID= (#34932) 2024-10-30 08:45:25 +01:00
Luca Boccassi
d140d478e2
sysusers: optionally create fully locked accounts (#34876)
Let's ramp up security for system user accounts, at least where
possible, by creating them fully locked (instead of just with an invalid
password). This matters when taking non-password (i.e. SSH) logins into
account.

Fixes: #13522
2024-10-29 18:46:14 +00:00
Luca Boccassi
a91c739a24
busctl: various bugfixes + tweaks (#34928)
Fixes: #34048
Replaces: #34796
Follow-up for: #33961
2024-10-29 18:15:16 +00:00
Mike Yuan
695323d90a
core/service: support sd_notify() MAINPIDFD=1 and MAINPIDFDID=
These serve as race-free alternatives for MAINPID= notification.
2024-10-29 18:42:15 +01:00
Zbigniew Jędrzejewski-Szmek
99996d5f5e
Merge pull request #34245 from bluca/logind_drop_weak_delay_inhibitor
logind: drop new delay-weak inhibitor
2024-10-29 17:13:11 +01:00
Lennart Poettering
8187515aab busctl: rename --num-matches= → --limit-messages=
We should avoid unnecessary abbreviations for such messages, and this
puts a maximum limit on things, hence it should indicate this in the
name.

Moreover, matches is a bit confusing, since most people will probably
call "busctl monitor" without any match specification, i.e. zero
matches, but that's not what was meant here at all.

Also, add a brief switch for this (-N) since I figure in particular
"-N1" might be a frequent operation people might want to use.

Follow-up for: 989e843e75
See: #34048
2024-10-29 16:50:06 +01:00
Lennart Poettering
ebc64de22f udevadm: automatically anable JSON-SEQ in case JSON is used for "udevadm info -a"
We are going to output a series of JSON objects, hence let's
automatically enable JSON-SEQ output mode, as we usually do.

"jq --seq" supports this natively, hence this should not really restrict
us.

Follow-up for: 67ea8a4c0e
2024-10-29 22:39:59 +09:00
Lennart Poettering
2ec7977e1b sysusers: add new ! line flag for creating fully locked accounts
Fixes: #13522
2024-10-29 11:00:13 +01:00
Lennart Poettering
b7f84f76fc man: fix return parameter type of sd_device_get_device_id() 2024-10-29 00:19:16 +01:00
David Michael
3eec82f6b3 socket: support setting ownership of message queues
This applies the existing SocketUser=/SocketGroup= options to units
defining a POSIX message queue, bringing them in line with UNIX
sockets and FIFOs.  They are set on the file descriptor rather than
a file system path because the /dev/mqueue path interface is an
optional mount unit.
2024-10-28 23:40:42 +01:00
Ryan Wilson
cd58b5a135 cgroup: Add support for ProtectControlGroups= private and strict
This commit adds two settings private and strict to
the ProtectControlGroups= property. Private will unshare the cgroup
namespace and mount a read-write private cgroup2 filesystem at /sys/fs/cgroup.
Strict does the same except the mount is read-only. Since the unit is
running in a cgroup namespace, the new root of /sys/fs/cgroup is the unit's
own cgroup.

We also add a new dbus property ProtectControlGroupsEx which accepts strings
instead of boolean. This will allow users to use private/strict via dbus
and systemd-run in addition to service files.

Note private and strict fall back to no and yes respectively if the kernel
doesn't support cgroup2 or system is not using unified hierarchy.

Fixes: #34634
2024-10-28 08:37:36 -07:00
Mike Yuan
7a13937007
core/service: don't propagate stop jobs if RestartMode=direct
The goal of RestartMode=direct is to make restarts invisible
to dependents, so auto restart jobs shouldn't bring them down
at all. So far we only skipped going through failed/dead states
in service_enter_dead(), i.e. the unit would never be considered
dead. But when constructing restart transaction, the stop job
would be propagated to dependents. Consider the following 2 units:

dependent.target:
[Unit]
BindsTo=a.service
After=a.service

a.service:
[Service]
ExecStart=bash -c 'sleep 100 && exit 1'
Restart=on-failure
RestartMode=direct

Before this commit, even though BindsTo= isn't triggered since
a.service never failed, when a.service auto-restarts, dependent.target
is also restarted. Let's suppress it by using JOB_REPLACE instead of
JOB_RESTART_DEPENDENCIES in service_enter_restart().

Fixes #34758

The example above is subtly different from the original report,
to illustrate that the new behavior makes sense for less exotic
use cases too.
2024-10-27 20:02:47 +01:00
Yu Watanabe
7354936ef7 core/cgroup: rename CGROUP_PRESSURE_WATCH_ON/OFF -> CGROUP_PRESSURE_WATCH_YES/NO
No functional change, but let's print yes/no rather than on/off in systemd-analyze.

Similar to 2e8a581b9c and
edd3f4d9b7.
(Note, the commit messages of those commits are wrong, as
 parse_boolean() supports on/off anyway.)
2024-10-27 03:04:35 +09:00
Yu Watanabe
ddeb701b55 man: fix typo
Follow-up for 115fac3c29.
2024-10-26 14:00:38 +09:00
Lennart Poettering
115fac3c29 run0: optionally show superhero emoji on each shell prompt
This makes use of the infra introduced in 229d4a9806 to indicate visually on each prompt that we are in superuser mode temporarily.
pick ad5de3222f userdbctl: add some basic client-side filtering
2024-10-25 17:31:06 +02:00
Lennart Poettering
edd10ab29c run0: add options to force allocation of PTY or of pipe use
Fixes: #33033
2024-10-25 14:14:26 +02:00
Lennart Poettering
c18ac81f17
Merge pull request #34877 from aafeijoo-suse/veritysetup-fixes
veritysetup-generator: minor man/code changes
2024-10-25 10:06:31 +02:00
Lennart Poettering
210fb8626f
Merge pull request #34875 from poettering/userdbctl-filter
userdbctl: add some basic client-side filtering
2024-10-24 22:36:22 +02:00
Mike Yuan
4e69da071d
Merge pull request #34799 from YHNdnzj/service-followups
core: follow-ups for live mount
2024-10-24 19:44:10 +02:00
Lennart Poettering
8bc86b1944 userdbctl: optionally hide UID range boundaries in output 2024-10-24 10:17:35 +02:00
Lennart Poettering
ad5de3222f userdbctl: add some basic client-side filtering
This adds some basic client-side user/group filtering to "userdbctl":

1. by uid/gid min/max
2. by user "disposition" (i.e. show only regular users with "userdbctl
   user -R")
3. by fuzzy name (i.e. search by substring/levenshtein of user name,
   real name, and other identifiers of the user/group record).

In the long run we also want to support this server side, but let's
start out with doing this client-side, since many backends won't support
server-side filtering anytime soon anyway, so we need it in either case.
2024-10-24 10:17:23 +02:00
Antonio Alvarez Feijoo
e98e3f856d
man/veritysetup-generator: document veritytab kernel command line option 2024-10-24 10:07:28 +02:00
Antonio Alvarez Feijoo
dcbfc7872e
man: fix links to veritysetup(8) 2024-10-24 09:54:48 +02:00
Yu Watanabe
e7c567cc78 man: insert a comma before 'and'
Follow-up for bd91f23acf.
2024-10-24 16:42:59 +09:00
Yu Watanabe
491c903dbe man/network: suggest to not request IA_NA when received RA with Managed bit unset
Follow-up for 1f5a052963.
2024-10-24 05:32:40 +09:00
Yu Watanabe
967c586e9c man/network: fix typo
Follow-up for 1f5a052963.
2024-10-23 17:25:37 +09:00
Mike Yuan
7e40b51a2e
man/org.freedesktop.systemd1: complete version info for ManagedOOMMemoryPressureDurationUSec
Follow-up for 63d4c4271c

Some unit types were left out.
2024-10-22 19:12:27 +02:00
Lennart Poettering
bd91f23acf logind: add CanIdle + CanLock dbus properties to session object
Clients should be able to know if the idle logic is available on a
session without secondary knowledge about the session class. Let's hence
expose a property for that.

Similar for the screen lock concept.

Fixes: #34844
2024-10-22 18:44:05 +02:00
Lennart Poettering
119252343e
Merge pull request #34848 from yuwata/network-dhcpv6-do-not-request-ia-pd-on-info-req
network/dhcp6: do not request IA_PD on information requesting mode
2024-10-22 18:00:12 +02:00
Lennart Poettering
2d74427a7c
Merge pull request #30952 from rpigott/resolved-dnr
RFC9463: Discovery of Network-designated Resolvers
2024-10-22 09:05:36 +02:00
Yu Watanabe
1f5a052963 man: suggest to use DHCPv6Client= when upstream provides RA with the Managed bit unset
Follow-up for daf9f42f91.
2024-10-22 04:35:03 +09:00
Ronan Pigott
9c683c0e1f network: Introduce IPv6RA UseDNR= option
Same as the DHCP v4/v6 options, this controls the use of DNR received
from ipv6ra.
2024-10-21 09:10:20 -07:00
Ronan Pigott
869381589d network: Introduce UseDNR DHCPv4 option
This option will control the use of DNR for choosing DNS servers on the
link. Defaults to the value of UseDNS so that in most cases they will be
toggled together.
2024-10-21 09:10:19 -07:00
Lennart Poettering
9c1fa3c235 ask-password-tool: add --user/--system flag to systemd-ask-password tool
This allows selecting which agents to ask about this: system-level
agents, or per-user agents.

Fixes: #1232 #2217
2024-10-21 14:14:10 +02:00
Lennart Poettering
6eabea49da
Merge pull request #33398 from AdrianVovk/sysupdate-optional
sysupdate: Add support for optional features
2024-10-21 12:36:43 +02:00