Commit Graph

68977 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
4704176795 units: disable start rate limit for systemd-vconsole-setup.service
The unit will be started or restarted a few times during boot, but but it has
StartLimitBurst = DefaultStartLimitBurst = 5, which means that the fifth
restart will already fail. On my laptop, I have exactly 4 restarts, so I don't
hit the limit, but on a slightly different system we will easily hit the limit.
In https://bugzilla.redhat.com/show_bug.cgi?id=2251394, there are five reloads
and we hit the limit.

Since 6ef512c0bb we propagate the start counter
over switch-root and daemon reloads, so it's easier to hit the limit during
boot.

In principle there might be systems with lots of vtcon devices, so let's just
allow the unit to be restarted without a limit.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2251394.
2023-11-25 13:27:17 +01:00
Zbigniew Jędrzejewski-Szmek
467cd9f0a5 man/systemd-vconsole-setup: improve markup 2023-11-25 13:15:31 +01:00
Zbigniew Jędrzejewski-Szmek
963ea30a5d man: reword the list of PE sections in systemd-stub
Let's put the section name at the beginning of each sentence. This way we
can avoid awkward constructs like "kernel is looked for in the .linux section".
Also, since the paragraph above says that this is a list of "PE sections", we
can just say "section". In other places, it is often useful to say "PE section"
to avoid ambiguity.

Also fix the off-by-one in the count of sections.
2023-11-24 15:21:58 +01:00
Lennart Poettering
ed272a9ff5 update TODO 2023-11-24 15:17:46 +01:00
Luca Boccassi
36f4476361
Merge pull request #30172 from yuwata/analyze-verify-unit-path
analyze: do not prepend CWD to SYSTEMD_UNIT_PATH needlessly
2023-11-24 10:35:28 +00:00
Lennart Poettering
c7896cecea pcrextend: fix minor memory leak
Also, simplify the code a bit by using json_dispatch_unbase64_iovec().
2023-11-24 12:21:43 +09:00
Yu Watanabe
2bab4caaf9 login: do not clear wall message before shutting down
This fixes a regression caused by 5ed73478e1
and aa6123e85e.

With these commits, when Reboot dbus method or friends is called,
reset_scheduled_shutdown() is called before shutting down the system,
so the wall message was cleared.

As the wall message itself is unrelated to the scheduling of shutting
down systems, let's keep the message.

Fixes #30167.
2023-11-24 11:11:57 +08:00
Yu Watanabe
2f6181ad4d analyze: do not prepend the current working directory to SYSTEMD_UNIT_PATH needlessly
If the requested unit is not in the current working directory, it is not
necessary to include the current working directory in SYSTEMD_UNIT_PATH.

Follow-up for 45519d13a4.

Fixes #30166.
2023-11-24 05:28:14 +09:00
Yu Watanabe
ff7af46edb analyze: set SYSTEMD_UNIT_PATH in verify_generate_path()
Then, rename verify_generate_path() -> verify_set_unit_path().
2023-11-24 05:20:13 +09:00
Yu Watanabe
c131e8b706 analyze: shorten code a bit
No functional change, just refactoring.
2023-11-24 05:19:14 +09:00
Yu Watanabe
6636145b3e analyze: drop duplicated :
Before, this returns e.g. "/current_dir::",
After, this returns e.g. "/current_dir:".
2023-11-24 04:44:35 +09:00
Mike Yuan
b7c1f9eaf4 hibernate-resume: actually set HibernateInfo.offset
Follow-up for a628d933cc
2023-11-23 18:15:37 +00:00
Luca Boccassi
b83309da76
Merge pull request #30165 from YHNdnzj/executor-open-fix
core,analyze: several fixlets
2023-11-23 18:15:22 +00:00
Luca Boccassi
1e62a625db
Merge pull request #30163 from keszybz/some-docs-updates
Some docs updates
2023-11-23 13:17:15 +00:00
Mike Yuan
bed6bffc9a
analyze: don't open systemd-executor needlessly
Fixes #30162
2023-11-23 20:58:20 +08:00
Mike Yuan
9136de6934
analyze: use FOREACH_ARRAY more 2023-11-23 20:53:46 +08:00
Mike Yuan
57d3a6aaf8
core/manager: open our parent dir with O_PATH 2023-11-23 20:44:32 +08:00
Mike Yuan
9e743e7ea9
core/manager: correct and simplify errno handling
open_parent() is our own function that returns negative errno.
2023-11-23 20:42:44 +08:00
Mike Yuan
5cacac04fa
core/manager: rename result parameter to ret 2023-11-23 20:42:43 +08:00
Zbigniew Jędrzejewski-Szmek
99ad526f2a man: drop recommendation to use absolute paths in ExecStart*=
The only reason to recommend this would be if people had multiple commands
with the same name in the search path. This probably was never the best idea,
and it happens rarely anyway. Since the patch that dropped requirement for full
paths was introduced, we have dropped support for unmerged-usr and we're planning
to drop support for split-bin at some point too. Many people effectively have just
one directory in the search path, so there is even less reason to use an absolute
path. So let's recommend just using the command name, which makes the unit file
shorter and nicer to read.
2023-11-23 13:23:44 +01:00
Zbigniew Jędrzejewski-Szmek
83d0edf565 man/sd_bus_process: fix confusion about "synchronous"
An event loop is not "synchronous". So we shouldn't say that the client must
"synchrounusly poll" if we recommend an event loop. Let's just say it should
poll, and say that "sd_bus_wait()" is blocking, which is clearer and more
correct than "synchronous".
2023-11-23 13:23:44 +01:00
Mike Yuan
0f9267501b exec-util: don't say sd-executor to avoid ambiguity
We have a systemd-executor binary now.
2023-11-23 11:39:07 +00:00
Zbigniew Jędrzejewski-Szmek
205a30fa13 meson: always install network example files
I started working on integrating this in the Fedora package and realized that
the example files should be installed regardless of the renamed files when
default-network=true is used. This is because the renamed files become part of
a different package, and we want to have the other files which are used as
documentation in the main package anyway.
2023-11-23 10:02:36 +00:00
Luca Boccassi
a935f3dd7e Finalize NEWS for v255-rc3 2023-11-22 20:41:04 +00:00
Yu Watanabe
19f0a71ba0 io-util: actually retry on failure
Follow-up for e22c60a9d5.

Fixes #30152.
2023-11-22 20:38:38 +00:00
Luca Boccassi
fc88adc704
Merge pull request #30153 from bluca/news
Update NEWS and hwdb
2023-11-22 20:24:22 +00:00
Luca Boccassi
054042f8e1 NEWS: note about reexec on update, for sd-executor 2023-11-22 18:04:21 +00:00
Luca Boccassi
60142662a4 NEWS: update contributors list 2023-11-22 18:04:21 +00:00
Luca Boccassi
bf4b97abdb hwdb: update 2023-11-22 18:04:21 +00:00
Christian Hesse
0f1dcf9d79 systemctl: distinguish reload and reexec
This used to log about reload, for reload and reexecution. Let's
distinguish the two cases.
2023-11-22 17:45:04 +00:00
Mike Yuan
0ca66adfcc conf-parser: only read the first found main config file
Follow-up for 93f1da4556
and 8ea288db01

Before the offending commits, we only read the first found
main config file. If the main config file is symlinked to/as
a drop-in, we should break instead of continuing, for it to
be read later.
2023-11-22 17:44:54 +00:00
Lennart Poettering
40e1100283 recurse-dir: correct comment
The RECURSE_DIR_ENSURE_TYPE flag is actually interpreted by
readdir_all() already, hence rearrange comments to say so.
2023-11-22 17:44:29 +00:00
Luca Boccassi
61c232dc8b
Merge pull request #30145 from poettering/reset-terminal-line-editing
make terminal line editing work with systemd-firstboot
2023-11-22 17:43:51 +00:00
Luca Boccassi
7d4b61d287
Merge pull request #30149 from yuwata/setlocale
locale-util: do not call setlocale() when multi-threaded
2023-11-22 17:43:39 +00:00
Luca Boccassi
c1fd45d067
Merge pull request #30143 from poettering/machine-credential-fixes
machine credential fixes
2023-11-22 17:43:14 +00:00
Luca Boccassi
31897753fb
Merge pull request #30024 from keszybz/one-doc-thingy
Serialize units ratelimits and document StartLimitIntervalSec=infinity
2023-11-22 17:42:51 +00:00
Lennart Poettering
9b85e90780 fs-util: add comment explaining what xopenat() is for 2023-11-23 02:29:37 +09:00
Yu Watanabe
d54a45ad5f locale-util: drop unused init_gettext()
The function has not been used since 96d9117ad2.
2023-11-23 00:50:46 +09:00
Yu Watanabe
ca13432d60 locale-util: do not call setlocale() when multi-threaded
Fixes #30141.
2023-11-23 00:50:42 +09:00
Lennart Poettering
2105f79ed3 machine-credential: tweak --load-credential= use a bit
Let's try to recognize paths (i.e. those with a "/") as source for
credentials to load, and then read them from the file system. Also, only read
credentials from an inbound credentials directory if the source
qualifies as valid credential name.

Otherwise print a nice error.
2023-11-22 15:17:18 +01:00
Lennart Poettering
1311946233 machine-credential: simplify code a bit 2023-11-22 15:17:18 +01:00
Lennart Poettering
437f3e156d machine-credential: use word 'Credential' rather than 'MachineCredential'
Probably some search/replace mistake.
2023-11-22 15:17:18 +01:00
Lennart Poettering
d66c4d101e machine-credential: fix GREEDY_REALLOC error handling
We must check the return value of GREEDY_REALLOC for OOM, and the
pointer are updated already on success, hence it's a bad idea to make a
copy of the pointer beforehand.
2023-11-22 15:17:18 +01:00
Lennart Poettering
6045958bab machine-credential: fix error logging
Remove duplicate logging: let exclusively
machine_credential_load()/machine_credential_set() log, and not the
caller again.
2023-11-22 15:16:32 +01:00
Yu Watanabe
3197d778e0 journal: sync immediately on shutting down journald
Otherwise, sd_event_add_time_relative() or sd_event_source_set_time_relative()
below will trigger assert_return().

Prompted by #30029.
2023-11-22 14:07:19 +00:00
Zbigniew Jędrzejewski-Szmek
51ad723d20 core: serialize and deserialize trigger ratelimits for socket and path 2023-11-22 12:32:31 +00:00
Zbigniew Jędrzejewski-Szmek
fed25720ef core: use uniform style for RateLimit initialization
RateLimit is designed so that we can always initialize only the first two
fields explicitly. All other call sites use a single line for this.
2023-11-22 12:32:31 +00:00
Lennart Poettering
5fee4ac0f4 firstboot: reset terminal settings right before asking a question
We are about to do interactivity on the terminal, hence let's ensure we
are in the TTY mode we expect to be in.
2023-11-22 13:27:53 +01:00
Lennart Poettering
d5b6c6e378 terminal-util: drop ECHOPRT flag from TTY settings when resetting
Let's disable ECHOPRT for terminals we reset.

The feature only really makes sense for hardcopy terminals and we sure
as shit don't talk to one of those. It has the effect that when line
editing is on and you hit backspace it outputs "\" followed by the
removed character. This never makes sense on a TTY that can just erase
the character.

Hence turn of this flag.

We have carried this flag along for about forever, but it doesn't really
make sense. I guess we mostly tested the terminal reset stuff for output
only, not for input.

This change is in particular useful for tools such as
"systemd-firstboot" which interactively ask questions on the console,
and where line editing should really work.
2023-11-22 13:27:53 +01:00
Lennart Poettering
68e4c637f8 terminal-util: trivial modernizations for reset_terminal_fd() 2023-11-22 13:27:53 +01:00