Commit graph

8552 commits

Author SHA1 Message Date
Vito Caputo a7d8cacce0 man: fix typo s/veno/reno/ 2024-04-06 07:12:33 +02:00
Mike Yuan 36b21fac8f
sleep: rename SleepMemMode= to MemorySleepMode=
Addresses https://github.com/systemd/systemd/pull/31986#discussion_r1554053623
2024-04-06 02:16:54 +08:00
Mike Yuan 05d2a63139
man/kernel-command-line: document resume_offset= too 2024-04-05 03:03:09 +08:00
Luca Boccassi 2aef0ac819
Merge pull request #32097 from keszybz/sd-notify-cleanups
Small cleanups to sd_notify docs
2024-04-04 17:44:12 +01:00
Daan De Meyer 7b62a246a6
Merge pull request #32033 from DaanDeMeyer/unit-creds
debug-generator: Add unit and drop-in credentials
2024-04-04 18:27:20 +02:00
Daan De Meyer 8595f578fe debug-generator: Add unit and drop-in credentials
These allow adding extra units and drop-ins via credentials.
2024-04-04 16:17:38 +02:00
Zbigniew Jędrzejewski-Szmek 3a9259d93c man: align strings in sd_notify() examples
I think this way it's easier to see that they are part of the same argument.
2024-04-04 14:41:56 +02:00
Zbigniew Jędrzejewski-Szmek 4cbf560edf man/notify-selfcontained-example: check argument first
This is just good style. In this particular case, if the argument is incorrect and
the function is not tested with $NOTIFY_SOCKET set, the user could not get the
proper error until running for real.

Also, remove mention of systemd. The protocol is fully generic on purpose.
2024-04-04 12:18:30 +02:00
Zbigniew Jędrzejewski-Szmek a1887f8b48 man: regenerate rules
Fixup for dfad86b838.
2024-04-04 12:18:30 +02:00
Zbigniew Jędrzejewski-Szmek 19e980eb92 man: update fedora example to F40
F40 will be out soon, so we can update the man page already. The example should
already work.

The cloud link was dropped in fd571c9df0, so
drop the unused variable too.
2024-04-04 09:19:24 +01:00
Yu Watanabe 94ad70989f man/example: also build example code with C90
Unfortunately, sd-bus-vtable.h, sd-journal.h, and sd-id128.h
have variadic macro and inline initialization of sub-object, these are
not supported in C90. So, we need to silence some errors.
2024-04-04 03:23:20 +09:00
Yu Watanabe 3a6bee0510
Merge pull request #32043 from YHNdnzj/resume-clear-efi
units: introduce systemd-hibernate-clear.service that clears stale HibernateLocation EFI variable
2024-04-04 02:43:00 +09:00
Yu Watanabe 040cb66458 man/examples: set _GNU_SOURCE in source, rather than by compile option
Addresses https://github.com/systemd/systemd/pull/32057#issuecomment-2034408569.
2024-04-04 02:30:29 +09:00
Lennart Poettering 47fba8f925 notify-example: also send STOPPING=1 at exit
I think the example should reflect the full set of lifecycle messages,
including STOPPING=1, which tells the service manager that the service
is already terminating. This is useful for reporting this information
back to the user and to suppress repeated shutdown requests.

It's not as important as the READY=1 and RELOADING=1 messages, since we
actively wait for those from the service message if the right Type= is
set. But it's still very valuable information, easy to do, and completes
the state engine.
2024-04-03 15:52:07 +01:00
Mike Yuan 5f0cd5717f
man/kernel-command-line: be clear that resumeflags= is about timeout opts only 2024-04-03 22:08:11 +08:00
Mike Yuan dfad86b838
units: introduce systemd-hibernate-clear.service that clears
stale HibernateLocation EFI variable

Currently, if the HibernateLocation EFI variable exists,
but we failed to resume from it, the boot carries on
without clearing the stale variable. Therefore, the subsequent
boots would still be waiting for the device timeout,
unless the variable is purged manually.

There's no point to keep trying to resume after a successful
switch-root, because the hibernation image state
would have been invalidated by then. OTOH, we don't
want to clear the variable prematurely either,
i.e. in initrd, since if the resume device is the same
as root one, the boot won't succeed and the user might
be able to try resuming again. So, let's introduce a
unit that only runs after switch-root and clears the var.

Fixes #32021
2024-04-03 22:07:43 +08:00
Yu Watanabe e98d4c3599 man/meson: add simple build test for example code 2024-04-03 17:58:39 +09:00
Yu Watanabe 2548ce6a30 man/examples: fix sd- header path 2024-04-03 17:58:39 +09:00
Yu Watanabe e84f70e16d man/examples: use strerror() instead of %m 2024-04-03 17:58:35 +09:00
Yu Watanabe 06d0dcc009 man/example: fix build failure of hwdb-usb-device.c
STRLEN() and xsprintf() is our internal macros.
2024-04-03 17:44:41 +09:00
Luca Boccassi f98e2b33ea
Merge pull request #32030 from bluca/dlopen_document
man: document that using sd_journal APIs might cause dlopen to happen and add self-contained notify protocol example
2024-04-02 17:18:02 +01:00
Luca Boccassi 383917ac67 man: add self-contained example of notify protocol
We are saying in public that the protocl is stable and can be easily
reimplemented, so provide an example doing so in the documentation,
license as MIT-0 so that it can be copied and pasted at will.
2024-04-02 14:53:31 +01:00
Luca Boccassi 5aa8180392 man: document that using sd_journal APIs might cause dlopen to happen 2024-04-02 14:53:31 +01:00
Mike Yuan 9c96ffe003
man/tmpfiles.d: drop doubled space 2024-04-02 17:12:55 +08:00
Eisuke Kawashima 86f36e87ff doc(tmpfiles.d): remove deprecated F type
close #32044
2024-04-02 02:46:19 +01:00
Daan De Meyer 3799fa803e repart: Add DefaultSubvolume= setting
We already have Subvolumes= to create subvolumes, let's add
DefaultSubvolume= as well to set the default subvolume.
2024-03-30 00:08:12 +00:00
Luca Boccassi 8312b17a29 core: apply ReloadLimit to reexec too
Same reason as the reload, reexec is disruptive and it requires the
same privileges, so if somebody wants to limit reloads, they'll also
want to limit reexecs, so use the same setting.
2024-03-29 12:03:32 +00:00
Luca Boccassi 55c1a411c6 portable: the 'flags' parameter is now used in DetachImageWithExtensions() and ReattachImageWithExtensions() 2024-03-29 09:35:45 +09:00
Mike Yuan a2124b35e9
sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep
The setting is used when /sys/power/state is set to 'mem'
(common for suspend) or /sys/power/disk is set to 'suspend'
(hybrid-sleep). We default to kernel choice here, i.e.
respect what's set through 'mem_sleep_default=' kernel
cmdline option.
2024-03-28 17:19:35 +08:00
Mike Yuan 0a3fd5ce43
man/systemd-sleep: reorder options 2024-03-28 17:16:24 +08:00
Yu Watanabe a3ed665a29 network/dhcp-server: introduce PersistLeases= setting
Requested at https://github.com/systemd/systemd/pull/31772#issuecomment-2000053357.
2024-03-27 13:21:15 +00:00
Luca Boccassi 66f35161f6 core: add counter for soft-reboot iterations
Allow to query via D-Bus how many times the current booted system has
been soft rebooted
2024-03-27 01:27:35 +00:00
Luca Boccassi 54f86b86ba core: add SoftRebootStartTimestamp
Will be useful to calculate how long it took to shut down the system before starting
in the new root
2024-03-27 01:25:49 +00:00
Jakub Sitnicki 97df75d7bd socket: pass socket FDs to all ExecXYZ= commands but ExecStartPre=
Today listen file descriptors created by socket unit don't get passed to
commands in Exec{Start,Stop}{Pre,Post}= socket options.

This prevents ExecXYZ= commands from accessing the created socket FDs to do
any kind of system setup which involves the socket but is not covered by
existing socket unit options.

One concrete example is to insert a socket FD into a BPF map capable of
holding socket references, such as BPF sockmap/sockhash [1] or
reuseport_sockarray [2]. Or, similarly, send the file descriptor with
SCM_RIGHTS to another process, which has access to a BPF map for storing
sockets.

To unblock this use case, pass ListenXYZ= file descriptors to ExecXYZ=
commands as listen FDs [4]. As an exception, ExecStartPre= command does not
inherit any file descriptors because it gets invoked before the listen FDs
are created.

This new behavior can potentially break existing configurations. Commands
invoked from ExecXYZ= might not expect to inherit file descriptors through
sd_listen_fds protocol.

To prevent breakage, add a new socket unit parameter,
PassFileDescriptorsToExec=, to control whether ExecXYZ= programs inherit
listen FDs.

[1] https://docs.kernel.org/bpf/map_sockmap.html
[2] https://lore.kernel.org/r/20180808075917.3009181-1-kafai@fb.com
[3] https://man.archlinux.org/man/socket.7#SO_INCOMING_CPU
[4] https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html
2024-03-27 01:41:26 +08:00
Luca Boccassi 14a5217679 resolved: support reloading configuration at runtime
Drop connections and caches and reload config from files, to allow
for low-interruptions updates, and hook up to the usual SIGHUP and
ExecReload=. Mark servers and services configured directly via D-Bus
so that they can be kept around, and only the configuration file
settings are dropped and reloaded.

Fixes https://github.com/systemd/systemd/issues/17503
Fixes https://github.com/systemd/systemd/issues/20604
2024-03-26 13:36:42 +00:00
Zbigniew Jędrzejewski-Szmek c38e4e2fda
Merge pull request #29721 from poettering/systemd-project
New capsule@.service feature
2024-03-26 13:19:33 +01:00
Luca Boccassi b1d18b96c4
Merge pull request #31801 from flatcar-hub/krnowak/sysext-config
systemd-sysext: Add support for env vars, ephemeral layers and some fixes
2024-03-26 09:23:19 +00:00
Gaël Donval 7b123f8186 Document SYSTEMD_REPART_MKFS_* in repart.d manual 2024-03-26 03:08:38 +09:00
Krzesimir Nowak 5ae2f83b3e man: Document sysext ephemeral-import mode 2024-03-25 08:30:09 +01:00
Krzesimir Nowak 504bdf08b5 man: Document sysext ephemeral mode 2024-03-25 08:19:48 +01:00
Krzesimir Nowak ca49d4c33d man: Install sysext man pages when ENABLE_SYSEXT is true 2024-03-25 08:14:36 +01:00
Luca Boccassi a2369b8be4
Merge pull request #31919 from YHNdnzj/analyze-verify
Some fixes/improvements for analyze
2024-03-24 11:50:44 +00:00
Mike Yuan 147e7b4446
analyze-dot: also show BindsTo= in --require 2024-03-24 01:28:28 +08:00
Adrian Vovk d94c7eef12 homework: Implement offline updates
This makes it possible to update a home record (and blob directory) of a
home area that's either completely absent (i.e. on a USB stick that's
unplugged) or just inaccessible due to lack of authentication
2024-03-23 01:05:13 +00:00
Adrian Vovk 5ec87d577f homework: Accept volume key from keyring
This bypasses authentication (i.e. user_record_authenticate) if the
volume key was loaded from the keyring and no secret section is
provided.

This also changes Update() and Resize() to always try and load the
volume key from the keyring. This makes the secret section optional for
these methods while still letting them function (as long as the home
area is active)
2024-03-23 01:05:13 +00:00
Luca Boccassi 1b5f3f5662
Merge pull request #31670 from CodethinkLabs/vmspawn/generate_ssh_keys
vmspawn: generate ssh keys
2024-03-22 16:28:03 +00:00
Daan De Meyer 16f182e59a
Merge pull request #31839 from DaanDeMeyer/log
log: Add per target log levels
2024-03-22 15:11:11 +01:00
Daan De Meyer e8815abff6 log: Add per target log levels
For CI in mkosi, I want to configure systemd to log at debug level
to the journal, but not to the console. While we already have max
level settings for journald's forwarding settings, not every log line
goes to the journal, specifically during early boot and when units
are connected directly to the console (think systemd-firstboot), so
let's extend the log level options we already have to allow specifying
a comma separated list of values and lets allow prefixing values with
the log target they apply to to make this possible.
2024-03-22 12:46:32 +01:00
Gerd Hoffmann 57ea8012d6 sd-boot: add support for support enrolling dbx
usage:
  (1) get latest revocation list for your architecture
      from https://uefi.org/revocationlistfile
  (2) copy the file to $ESP/loader/keys/$name/dbx.auth
2024-03-21 23:03:42 +00:00
Matthias Lisin 245bd4af99 man: fix minor issues 2024-03-21 02:49:38 +01:00