summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* io-util: actually retry on failureYu Watanabe2023-11-221-0/+1
| | | | | | Follow-up for e22c60a9d5dfc5f0b260c7906f3546aef2925998. Fixes #30152.
* systemctl: distinguish reload and reexecChristian Hesse2023-11-221-2/+4
| | | | | This used to log about reload, for reload and reexecution. Let's distinguish the two cases.
* conf-parser: only read the first found main config fileMike Yuan2023-11-221-1/+3
| | | | | | | | | | Follow-up for 93f1da45566d064f4f053b37bbac2813631f58b1 and 8ea288db018c7dfe0016d51d4538539bab4ab6de 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.
* recurse-dir: correct commentLennart Poettering2023-11-221-1/+1
| | | | | The RECURSE_DIR_ENSURE_TYPE flag is actually interpreted by readdir_all() already, hence rearrange comments to say so.
* Merge pull request #30145 from poettering/reset-terminal-line-editingLuca Boccassi2023-11-222-5/+8
|\ | | | | make terminal line editing work with systemd-firstboot
| * firstboot: reset terminal settings right before asking a questionLennart Poettering2023-11-221-0/+2
| | | | | | | | | | We are about to do interactivity on the terminal, hence let's ensure we are in the TTY mode we expect to be in.
| * terminal-util: drop ECHOPRT flag from TTY settings when resettingLennart Poettering2023-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * terminal-util: trivial modernizations for reset_terminal_fd()Lennart Poettering2023-11-221-4/+5
| |
* | Merge pull request #30149 from yuwata/setlocaleLuca Boccassi2023-11-222-6/+7
|\ \ | | | | | | locale-util: do not call setlocale() when multi-threaded
| * | locale-util: drop unused init_gettext()Yu Watanabe2023-11-222-6/+0
| | | | | | | | | | | | The function has not been used since 96d9117ad2db7d8c13f7898127eee8939e88daf1.
| * | locale-util: do not call setlocale() when multi-threadedYu Watanabe2023-11-221-0/+7
| | | | | | | | | | | | Fixes #30141.
* | | Merge pull request #30143 from poettering/machine-credential-fixesLuca Boccassi2023-11-223-48/+31
|\ \ \ | | | | | | | | machine credential fixes
| * | | machine-credential: tweak --load-credential= use a bitLennart Poettering2023-11-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | machine-credential: simplify code a bitLennart Poettering2023-11-221-2/+4
| | | |
| * | | machine-credential: use word 'Credential' rather than 'MachineCredential'Lennart Poettering2023-11-221-3/+3
| | | | | | | | | | | | | | | | Probably some search/replace mistake.
| * | | machine-credential: fix GREEDY_REALLOC error handlingLennart Poettering2023-11-221-21/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | machine-credential: fix error loggingLennart Poettering2023-11-223-19/+8
| |/ / | | | | | | | | | | | | | | | Remove duplicate logging: let exclusively machine_credential_load()/machine_credential_set() log, and not the caller again.
* | | Merge pull request #30024 from keszybz/one-doc-thingyLuca Boccassi2023-11-229-39/+64
|\ \ \ | | | | | | | | Serialize units ratelimits and document StartLimitIntervalSec=infinity
| * | | core: serialize and deserialize trigger ratelimits for socket and pathZbigniew Jędrzejewski-Szmek2023-11-222-2/+12
| | | |
| * | | core: use uniform style for RateLimit initializationZbigniew Jędrzejewski-Szmek2023-11-225-14/+8
| | | | | | | | | | | | | | | | | | | | 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.
| * | | core: serialize and deserialize auto start/stop ratelimitZbigniew Jędrzejewski-Szmek2023-11-221-0/+4
| | | | | | | | | | | | | | | | | | | | The limit is not configurable, so the logic in the helper will always update the counters. The helper is a bit overkill, but it doesn't really matter.
| * | | core: serialize and deserialize unit start ratelimitsZbigniew Jędrzejewski-Szmek2023-11-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic is taken from dump ratelimit: if the config changes, we discard the counters. This allows the user apply new limits and "start from scratch" in that case. This actually makes StartLimitIntervalSec=infinity (or with a large interval) work as expected, because the counter is maintained even if daemon-reload operations are interleaved.
| * | | core: split out the helper to serialize/deserialize ratelimitsZbigniew Jędrzejewski-Szmek2023-11-173-23/+34
| | | |
* | | | fs-util: add comment explaining what xopenat() is forLennart Poettering2023-11-221-0/+10
| |/ / |/| |
* | | journal: sync immediately on shutting down journaldYu Watanabe2023-11-221-0/+6
| |/ |/| | | | | | | | | | | Otherwise, sd_event_add_time_relative() or sd_event_source_set_time_relative() below will trigger assert_return(). Prompted by #30029.
* | Merge pull request #30133 from yuwata/fix-draw-cylonYu Watanabe2023-11-225-37/+70
|\ \ | | | | | | pid1: fix draw_cylon()
| * | test: add test for draw_cylon()Yu Watanabe2023-11-221-0/+28
| | |
| * | pid1: move draw_cylong() to pretty-print.[ch]Yu Watanabe2023-11-223-38/+41
| | |
| * | pid1: terminate cylon stringYu Watanabe2023-11-221-1/+3
| | | | | | | | | | | | Fixes #30121.
| * | pid1: drop unnecessary spaceYu Watanabe2023-11-221-1/+1
| | |
* | | sd-journal: warn about seals may not be continuous only when the file is sealedYu Watanabe2023-11-221-1/+1
| | | | | | | | | | | | | | | | | | Follow-up for e375bc5fcc080815ce849261eb505d084c2fde3e. Fixes #30118.
* | | network/dhcp: disable RapidCommit= by default when AllowList=/DenyList= is ↵Yu Watanabe2023-11-214-3/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified AllowList= and DenyList= filter only DHCPOFFER messages. So, if RapidCommit= is enabled, then networkd unconditionally accepts a rapid ACK message even if its sender is filtered out by the lists. As AllowList=/DenyList= implemented earlier than RapidCommit=, so enabling RapidCommit= unconditionally by default may break existing setups that use AllowList=/DenyList=. Let's disable RapidCommit= by default when AllowList=/DenyList= is enabled. Still the setting can be enabled by setting explicitly even AllowList=/DenyList= is also specified.
* | systemctl: fix typoYu Watanabe2023-11-211-1/+1
| | | | | | | | Follow-up for f380473edfa899706d630bb64750ab50c5c04961.
* | tpm2-util: rename json field "tpm2-pcrlock" → "tpm2_pcrlock"Lennart Poettering2023-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | We generally want to avoid to include dashes in json field names. We historically made a mistake there which is hard to fix. But for new fields, let's get this right. We already got it right for a bunch of new fields, hence also make sure to use underscores rather dashes for new additions. This field was added post v254, and since we didn't release since then, let's just rename it.
* | bsod: install the signal handler only just before we need itFrantisek Sumsal2023-11-211-1/+2
| | | | | | | | | | | | | | Otherwise we might get stuck in sd_journal_wait(), since it handles EINTR internally. Resolves: #30084
* | kernel-install: do not resolve symlink in paths passed to pluginsYu Watanabe2023-11-211-27/+50
| | | | | | | | | | | | | | | | | | | | | | When we resolve symlinks, paths (especially filenames) may be changed, but plugins may expect to see the kernel added under the name specified, not under the final name that the symlink chain resolves to. This makes symlinks in specified paths that passed to plugins are not resolved when neither --root nor --image specified. Fixes #29317.
* | systemd.pc: Keep support for rootprefix and root_prefix (#30115)Arian van Putten2023-11-211-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * systemd.pc: Keep support for rootprefix and root_prefix We dropped support for split-usr in https://github.com/systemd/systemd/commit/b0d3095fd6cc1791a38f57a1982116b4475244ba but kept the `rootprefix` variable in meson but ignore it to make sure we do not break downstream builds that depend on systemd. This is fine because we had logic in our meson.build that rootprefix and prefix need to be the same when split-usr=false. However we never had this logic in our systemd.pc.in file. This leads to a nasty breaking problem downstream. Many packages [0,1,2] (there might be more!) rely on overriding rootprefix or root_prefix when calling pkg-config to configure where to install systemd units. This is because before split-usr we installed units in rootprefix. Setting prefix on the pkg-config file didn't work. Even when split-usr=false people had to set rootprefix to install units in the right position. E.g. they have a line like: systemdunitdir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define: ['rootprefix', systemd_root_prefix]) With https://github.com/systemd/systemd/commit/b0d3095fd6cc1791a38f57a1982116b4475244ba landing This would mean all these downstream packages need to be patched to use `prefix` next to `rootprefix`. (Both need to be kept to keep backwards compat with using older versions of systemd). This puts a big burden on downstream packages. Instead we should not break the existing behaviour and keep the old behaviour of systemd.pc.in around. I've changed systemd.pc.in such that either setting prefix, rootprefix or root_prefix will all have the same effect. This way we do not break any downstream packages. - [0](https://github.com/fwupd/fwupd/blob/caa788b37ff34334d83debb047335fd12f3a7836/meson.build#L464) - [1](https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blame/main/meson.build#L204) - [2](https://github.com/PipeWire/pipewire/blob/49cdb468c28ba366dbd08eef9cb6dbf2dea2a2e5/src/daemon/systemd/system/meson.build#L1)
* | systemctl-show: only show available memory if it was artifically limitedFlorian Schmaus2023-11-211-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Systemd 255 changed the semantic of MemoryAvailable with 3565c709f587 ("cgroup: Fix MemoryAvailable= by considering physical memory"). If there is no artificial constraint, it will hold the amount of available physical memory, while it previously contained UINT64_MAX. While the change in MemoryAvailable's semantic is sensible, it causes `systemctl status` to always display the available physical memory. This creates a lot of noise, especially since systemd recently started to also show the "peak" memory. For example $ systemctl status foo … Memory: 3.9G (available: 21.2G peak: 5.4G) … However, while peak memory is a unit specific value, the available memory, when not derived from artificial memory limits, is a generic property that holds the same value for all units that are not under memory accounting constraints. Displaying it under those circumstances can therefore be considered being noisy. Before 3565c709f587 ("cgroup: Fix MemoryAvailable= by considering physical memory") "systemctl status" would only show the available memory if it was caused by a explicit memory limitation due to MemoryHigh or MemoryMax. This commit restores this behavior by supressing displaying the available memory if is is merely the available phyiscal memory. For example $ systemctl status foo … Memory: 3.9G (peak: 5.4G) … Fixes #30102.
* | in-addr: improve log message for e.g. [DHCPv4] AllowList=Yu Watanabe2023-11-211-1/+2
| | | | | | | | Closes #30107.
* | Merge pull request #30074 from YHNdnzj/hibernate-unsupportedLuca Boccassi2023-11-201-4/+12
|\ \ | | | | | | hibernate-util: if asked to bypass space check, accept the case when we have no swap space at all
| * | hibernate-util: if asked to bypass space check, accept the case when weMike Yuan2023-11-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | have no swap space at all But I shall still recommend https://chrisdown.name/2018/01/02/in-defence-of-swap.html to everyone ;-) Fixes #30083
| * | hibernate-util: report no available swap as no enough swap spaceMike Yuan2023-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | Otherwise, ENOENT or ENXIO may be directly returned as error through bus. Should help to generate clearer error message for #30083.
* | | libsystemd-network: introduce triple_timestamp_from_cmsg()Yu Watanabe2023-11-206-55/+34
| | | | | | | | | | | | | | | | | | Follow-up for 461ef3981f1a45150b6e2047bb3c789ac50ba3cf. This should fix compile error on x32 and riscv32.
* | | Merge pull request #30104 from poettering/pcrlock-empty-object-fixLuca Boccassi2023-11-201-1/+10
|\ \ \ | | | | | | | | pcrlock: fix for parsing corrupted userspace event log
| * | | pcrlock: check for embedded NUL bytesLennart Poettering2023-11-201-0/+5
| | | |
| * | | pcrlock: make sure we don't choke on empty recordsLennart Poettering2023-11-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Follow-up for a43427013949 CID#1523832
* | | | Merge pull request #30095 from yuwata/kernel-install-exit-codeLuca Boccassi2023-11-202-9/+33
|\ \ \ \ | |/ / / |/| | | kernel-install: exit code
| * | | test: add test cases about plugin exit codeYu Watanabe2023-11-201-0/+25
| | | |
| * | | kernel-install: propagate failures in pluginsYu Watanabe2023-11-201-9/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression introduced by 42551ea7e923bac5df12b20e3e735a487d38dcd5. In the shell script version, plugin failures are propagated to the caller. But after the commit, failures in plugins are logged, but never propagated as the exit code of the execution. Fixes #30087.
* / / test-condition: skip group test during Debian package buildLuca Boccassi2023-11-201-5/+8
|/ / | | | | | | | | | | | | The group names won't match in a package build chroot and the test might fail, skip it. https://buildd.debian.org/status/fetch.php?pkg=systemd&arch=hppa&ver=255%7Erc2-2&stamp=1700424353&raw=0