1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
Commit Graph

7122 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
e2d4456f43 man: fix method name 2022-10-17 13:50:17 +02:00
Franck Bui
d1d8786c5b analyze: extend the dump command to accept patterns
The new function DumpPatterns() can be used to limit (drastically) the size of
the data returned by PID1. Hence the optimization of serializing data into a
file descriptor should be less relevant than having the possibility to limit
the data when communicating with the service manager remotely.

NB: when passing patterns, the dump command omits the version of the manager as
well as the features and the timestamps.
2022-10-13 07:47:42 +09:00
Luca Boccassi
06768b90a3 portable: allow caller to override extension-release name check
When the --force flag is used, do not insist that the extension-release
file has to match the extension image name
2022-10-12 09:57:24 +01:00
Luca Boccassi
aad813bf17 portable: rename flag PORTABLE_FORCE -> PORTABLE_FORCE_ATTACH
The name is used only internally, also it was just added.
Allows adding different types of force flags.
2022-10-12 09:57:24 +01:00
Luca Boccassi
da60182759
Merge pull request #24933 from keszybz/erradicate-strerror
Erradicate strerror
2022-10-11 21:47:38 +02:00
Zbigniew Jędrzejewski-Szmek
b413d4fd3e man: use man7.org for strerror_r 2022-10-11 16:59:00 +02:00
Zbigniew Jędrzejewski-Szmek
2fd922afed man: recommend strerror_r() over strerror()
Let's nudge people towards the use of an anonymous buffer like we
do internally.

"errno" → "errnum", to match the man page for strerror, and also to avoid
confusion with the global variable. In general, I think that errno is a
terrible interface and we shouldn't encourage people to use it. Those functions
use errno-style error numbers, which are a different thing.
2022-10-11 16:59:00 +02:00
Zbigniew Jędrzejewski-Szmek
b4096cecff man: recommend %m over strerror()
The need to set errno is very very ugly, but at least it is thread-safe and
works correctly. Using strerror() is likely to be wrong, so let's not recommend
that. People who do a lot of logging would provide use some wrapper that sets
errno like we do, so nudge people towards %m.

I tested that all the separate .c files compile cleanly.
2022-10-11 16:59:00 +02:00
Zbigniew Jędrzejewski-Szmek
29c45dc434 man: use external .c files for three examples
This way it's much easier to test that the code compiles without issues.
It's also easier to edit the code.

Indentation in one of the examples is reduced to two spaces. This is what we
use in man pages to make them fit on screen better.
2022-10-11 16:59:00 +02:00
Daan De Meyer
32b61b0559
Merge pull request #24595 from rphibel/support-image-option-in-systemctl-and-coredumpctl
systemctl/coredumpctl: add support for --root and --image options
2022-10-10 11:35:20 +02:00
Zbigniew Jędrzejewski-Szmek
01f516314f man: use a list for description of ConditionFirmware=
Also reduce confusion of <replaceable> and <literal> and reword things for
legibility a bit.
2022-10-09 17:28:53 +02:00
Daan De Meyer
46fb302f72 Revert "journal: Add --convert= command to journalctl"
This reverts commit 721620e8a3.

This commit was accidentally merged as part of #22998
2022-10-08 03:24:25 +09:00
anarcat
9aafd310cc man/shutdown: document how to switch to single-user mode
Before Debian switched to systemd, `shutdown now` would reset the system into
single user mode, doing roughly the equivalent of `telinit 1`.

Now, systemd's `shutdown` command does not behave that way; it defaults to
`poweroff` which might be confusing for users (like me) used to the previous
method.

Because I don't use the command often, I keep being stumped by this behavior,
and every time I look at the `shutdown(1)` manpage, I don't understand why I
can't find what I am looking for. This patch should make sure that people like
me find their way back to some sort of reason.

Maybe the *proper* way to fix this would be to restore the more classic
behavior, but I'm definitely not going to climb that hill. Besides, I clearly
remember the time I found out about the `shutdown` command and was *really*
confused when it brought me back to a command-line prompt. That was really
counter-intuitive and I find that change to actually be a good thing. So I'm
not proposing to change this behavior, merely document it better.

I originally added this to the `-P` option but it was suggested adding a new
`COMPATIBILITY` section instead, where other such issues could be added.

The `COMPATIBILITY` section is not actually officially documented. `man(1)`
talks about a `CONFORMING TO` section, but `shutdown(1)` is not
POSIX (`shutdown(2)` is, of course), so there's no actual standard on how this
should work.

The other option I considered was to add a `BUGS` section, but that seemed to
inflammatory, and definitely counter-productive.
2022-10-07 17:54:31 +02:00
Aidan Dang
fd83c98e8a Implement --luks-sector-size for homed 2022-10-07 16:36:04 +02:00
Daan De Meyer
721620e8a3 journal: Add --convert= command to journalctl
--convert writes the journal files read by journalctl to the given
location. The location should be specified as a full journal file
path (e.g. /a/b/c/converted.journal). The directory specifies where
the converted journal files will be stored. The filename specifies
the naming convention the converted journal files will follow.
2022-10-07 12:28:09 +02:00
Richard Phibel
05d9465675 coredumpctl: Add support for the --image option 2022-10-03 12:19:34 +02:00
Richard Phibel
71bdc96ab7 coredumpctl: Add support for the --root option
With this option, coredumpctl looks for journal files under the
specified root directory
2022-10-03 12:19:28 +02:00
Yu Watanabe
2ff7862bf2 resolve: drop remaining references for Monitor=
Follow-up for b25d819aee.
2022-10-03 08:26:05 +02:00
Yu Watanabe
64ebc0da03 resolve: fix typo 2022-10-03 09:23:37 +09:00
Luca Boccassi
3cd1b8f403
Merge pull request #24878 from keszybz/condition-first-boot
Tweak condition first boot to use the same logic in pid1 and units
2022-10-01 19:30:21 +01:00
Clyde Byrd III
f63e259bb6 man: Update systemd.killMode docs 2022-10-01 16:58:48 +02:00
Zbigniew Jędrzejewski-Szmek
bfa769d185 man: add cross-links about preset operations 2022-10-01 11:35:46 +02:00
Zbigniew Jędrzejewski-Szmek
7cd43e34c5 manager: fix/change evaluation of ConditionFirstBoot
The code to evaluate the kernel command line option was busted because it
was doing 'return b == !!r' at a point where 'r > 0'. Thus we'd return "true"
in both cases:

$ SYSTEMD_PROC_CMDLINE=systemd.condition-first-boot build/systemd-analyze condition 'ConditionFirstBoot=true'
test.service: ConditionFirstBoot=true succeeded.
Conditions succeeded.
$ SYSTEMD_PROC_CMDLINE=systemd.condition-first-boot build/systemd-analyze condition 'ConditionFirstBoot=false'
test.service: ConditionFirstBoot=false succeeded.
Conditions succeeded.

We only use 'ConditionFirstBoot=true' in units, so this wasn't noticed.

But I think the logic is broken in general: the condition should evaluate as
true only during initial boot. If we rerun the units at later points, we should
not consider ConditionFirstBoot to be true.

Also, the first boot logic is also used in pid1 itself. AFAICT, for two
things: in first boot machine-id is initialized transiently (this allows
first-boot operations to be restarted if boot fails), and preset-all is
executed. But this logic was different and separate from the logic to
evaluate ConditionFirstBoot. The distinction is abolished, and the operations
in pid1 now use the same logic as ConditionFirstBoot, which means that the
kernel command line option is checked, and condition_test_first_boot()
just tests whether pid1 thinks we're in first boot.

This makes things easier to grok for the user: there's just one condition for
"first boot" and it applies to both pid1 and units.
2022-10-01 11:35:46 +02:00
Luca Boccassi
697f082697
Merge pull request #24853 from poettering/resolved-monitor-fixes
resolved: various monitor fixes
2022-09-30 15:46:13 +01:00
Luca Boccassi
ace212f577 portablectl: add --force attach/detach
Allows to skip check that ensures units must not be running.

I have a use case that would use reattach, except the orchestrator
is using a non-standard versioning scheme, so image matching cannot
work. As a workaround, need to be able to detach and then attach
manually, without stopping the units to avoid extended downtimes
and loss of FD store.
2022-09-30 13:25:31 +01:00
Lennart Poettering
fffbf1dc99 resolvectl: add new "monitor" verb 2022-09-30 14:24:08 +02:00
Lennart Poettering
b25d819aee resolved: don't make monitoring optional
The socket is only accessible to privileged clients anyway, no need to
add another (user unfriendly) restriction via opt-in setting. let's just
allow this for privileged clients, mirroring "busctl monitor", or
"tcpdump" and similar, which all just work if you have privs.

(This does not break API, since we never did a release witht the
"Monitor" dbus property or config setting in place, i.e. with
cb456374e0)
2022-09-30 14:20:28 +02:00
Lennart Poettering
baf3fdec27 sd-event: add helper for exiting event loop on SIGTERM/SIGINT
In many (most?) of our event loops we want to exit once SIGTERM/SIGINT
is seen. Add a common helper for that, that does the right things in a
single call.
2022-09-30 14:18:43 +02:00
Lennart Poettering
897448bd37 sd-event: if signal nr has high bit set sd_event_add_signal() auto-block it via sigprocmask()
So far we expected callers to block the signals manually. Which is
usually a good idea, since they should do that before forking off
threads and similar. But let's add a mode where we automatically block
it for the caller, to simplify things.
2022-09-30 14:17:46 +02:00
Lennart Poettering
0df8512124 man: document the Dump() calls of the PID 1 D-Bus interface, and what they are 2022-09-30 11:32:24 +02:00
Richard Phibel
8aa3894eae systemctl: add support for --image option
All tools that support --root= should also learn --image=
so that they can operate on disk images directly.
2022-09-27 09:47:01 +02:00
Lennart Poettering
fc70944301 man: document that setting Storage= in namespaces journald menas LogDirectory= in unit file needs setting too
Replaces: #24789
2022-09-26 19:29:49 +01:00
Yu Watanabe
3b51a183af tree-wide: fix typo 2022-09-24 10:43:58 +09:00
Luca Boccassi
542e6eb38d
Merge pull request #24799 from poettering/initrd-ftw
use "initrd" rather than "initial RAM disk" or "initramfs" to refernce the concept
2022-09-23 20:43:15 +01:00
Daan De Meyer
354dc913c5
Merge pull request #24635 from DaanDeMeyer/repart-verity-sig
repart: Add support for generating verity sig partitions
2022-09-23 18:53:04 +02:00
Daan De Meyer
b456191d3c repart: Add support for generating verity sig partitions 2022-09-23 16:15:37 +02:00
Lennart Poettering
dd5533801b
Merge pull request #24700 from poettering/ssh-creds
support easy provisioning for SSH key of root user
2022-09-23 16:01:09 +02:00
Lennart Poettering
55c041b4e4 tree-wide: also settle on "initrd" instead of "initial RAM disk"
With this the concept is now called the same way everywhere except where
historical info is relevant or where the other names are API.
2022-09-23 15:12:18 +02:00
Lennart Poettering
32e2767080 tree-wide: use the term "initrd" at most places we so far used "initramfs"
In most cases we refernced the concept as "initrd". Let's convert most
remaining uses of "initramfs" to "initrd" too, to stay internally
consistent.

This leaves "initramfs" only where it's relevant to explain historical
concepts or where "initramfs" is part of the API (i.e. in
/run/initramfs).

Follow-up for: b66a6e1a58
2022-09-23 15:10:53 +02:00
Lennart Poettering
addc84ec91
Merge pull request #24686 from d4nuu8/delta_output
shared/logs-show: add new --output= format "short-delta"
2022-09-23 13:33:55 +02:00
Daniel Braunwarth
893bcd3d07 shared/logs-show: add new --output= format "short-delta"
This new output formatting option is similar to "short-monotonic" but
also shows the time delta between two messages.

This fixes #24641.
2022-09-23 10:07:03 +02:00
Lennart Poettering
0bbc5a5674 man: add man page decribing well known system credentials 2022-09-23 09:33:00 +02:00
Lennart Poettering
fdc4b8b1e0 man: document new : modified for uid/gid/access mode in tmpfiles.d 2022-09-23 09:30:57 +02:00
Luca Boccassi
c9d65b921b
Merge pull request #24771 from poettering/destroy-pcr11
extend boot phase information into PCR 11 during boot
2022-09-22 20:08:27 +01:00
Antonio Alvarez Feijoo
b5f8a35f39 man/portablectl: fix references to options 2022-09-22 20:04:49 +01:00
Lennart Poettering
a434e25f52 measure: make --public-key= optional if "sign" is called
We can derive the public key from the private key, so let's do that, to
make things a bit easier.
2022-09-22 16:55:56 +02:00
Lennart Poettering
6ca0016398 measure: allow pre-calculating PCR values for multiple boot phases 2022-09-22 16:54:48 +02:00
Lennart Poettering
708d752479 boot: add new pcrphase tool to measure barrier strings into PCR 11 2022-09-22 16:52:06 +02:00
Daan De Meyer
4cee83331c repart: Add --split option to generate split artifacts
For use with sysupdate or other systemd tooling, it's useful to be
able to generate split artifacts from disk images, where each
partition is written to a separate file. Let's support this with
a --split switch for repart and a SplitName= configuration option.

--split enables split artifacts generation, and SplitName= configures
for which partition to generate split artifacts, and which suffix to
add to the split artifact name.

For SplitName=, we add support for some extra specifiers, more specifically
the partition Type UUID and the partition UUID.
2022-09-22 15:10:03 +02:00
Joost Heitbrink
63ed97efc3 man: don't mention Socket files in Scope man page 2022-09-22 08:09:05 +09:00