summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-19284-793/+792
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* sd-event: never pass negative errnos as signalfd to signalfdZbigniew Jędrzejewski-Szmek2022-12-191-1/+3
| | | | | We treat any negative value as "invalid fd", but signalfd only accepts -1.
* socket-proxyd: do not hardcode -1 in a check for fd validityZbigniew Jędrzejewski-Szmek2022-12-191-3/+3
|
* Merge pull request #25784 from poettering/bootctl-splitLennart Poettering2022-12-1917-2164/+2309
|\ | | | | bootctl: split up bootctl.c into multiple files
| * bootctl: split out "install" verb tooLennart Poettering2022-12-195-1188/+1184
| |
| * bootctl: split out "status" verb tooLennart Poettering2022-12-197-603/+647
| |
| * bootctl: split out "set-efivar" verbs, tooLennart Poettering2022-12-194-138/+156
| |
| * bootctl: also split out 'systemd-efi-options' verbLennart Poettering2022-12-194-32/+44
| |
| * bootctl: split out random seed verb, tooLennart Poettering2022-12-197-171/+235
| |
| * bootctl: let's start splitting up bootctl like we did for systemctl and othersLennart Poettering2022-12-194-34/+45
| |
* | unit: use underbar for module nameYu Watanabe2022-12-191-1/+1
|/ | | | For consistency with src/core/unit.c.
* Merge pull request #25779 from bluca/journa_remote_vacuumYu Watanabe2022-12-192-4/+4
|\ | | | | journal-remote: follow-ups for #25076
| * journal-remote: fix memory leak on initialization errorLuca Boccassi2022-12-181-3/+3
| | | | | | | | | | | | | | Follow-up for f12b399dd6362a03379cb769954ebfb9972236ed from https://github.com/systemd/systemd/pull/25076 CID#1501550
| * journal-remote: fix initialization of vacuum metricsLuca Boccassi2022-12-181-1/+1
| | | | | | | | | | | | | | Follow-up for f12b399dd6362a03379cb769954ebfb9972236ed from https://github.com/systemd/systemd/pull/25076 CID#1501551
* | meson: fix cross-compilation of LONG_MAXasavah2022-12-181-1/+5
|/ | | | https://github.com/systemd/systemd/pull/25618#issuecomment-1355019553
* vacuum journal remote (#25076)berenddeschouwer2022-12-176-7/+82
| | | | | * Support vacuuming for journal-remote Co-authored-by: Berend De Schouwer <berend@deschouwer.co.za>
* Merge pull request #25221 from enr0n/nic-rename-fallbackLuca Boccassi2022-12-176-27/+64
|\ | | | | udev: set link alternative name if link is already up during rename
| * test-network: add a test for renaming device to current altnameNick Rosbrook2022-12-152-0/+18
| |
| * sd-netlink: add a test for rtnl_set_link_name()Nick Rosbrook2022-12-151-0/+27
| | | | | | | | | | Add a test that verifies a deleted alternative name is restored on error in rtnl_set_link_name().
| * udev: attempt device rename even if interface is upNick Rosbrook2022-12-151-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently rename_netif() will not attempt to rename a device if it is already up, because the kernel will return -EBUSY unless live renaming is allowed on the device. This restriction will be removed in a future kernel version [1]. To cover both cases, always attempt to rename the interface and return 0 if we get -EBUSY. [1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=bd039b5ea2a9
| * sd-netlink: restore altname on error in rtnl_set_link_nameNick Rosbrook2022-12-151-3/+16
| | | | | | | | | | | | | | If a current alternative name is to be used to rename a network interface, the alternative name must be removed first. If interface renaming fails, restore the alternative name that was deleted if necessary.
| * sd-netlink: do not swap old name and alternative nameNick Rosbrook2022-12-151-13/+0
| | | | | | | | | | | | | | | | | | Commit 434a348380 ("netlink: do not fail when new interface name is already used as an alternative name") added logic to set the old interface name as an alternative name, but only when the new name is currently an alternative name. This is not the desired outcome in most cases, and the important part of this commit was to delete the new name from the list of alternative names if necessary.
| * udev/net: allow new link name as an altname before renaming happensNick Rosbrook2022-12-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | When configuring a link's alternative names, the link's new name to-be is not allowed to be included because interface renaming will fail if the new name is already present as an alternative name. However, rtnl_set_link_name will delete the conflicting alternative name before renaming the device, if necessary. Allow the new link name to be set as an alternative name before the device is renamed. This means that if the rename is later skipped (i.e. because the link is already up), then the name can at least still be present as an alternative name.
* | Merge pull request #25387 from yuwata/core-fix-gc-logicLuca Boccassi2022-12-172-72/+167
|\ \ | | | | | | core: fix logic of merging units
| * | core/unit: fix log messageYu Watanabe2022-12-161-27/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As you can see in the below, the dropped dependency Before=issue-24990.service is not logged, but the dependency Before=test1.service which is not owned by the units generated by the TEST-26 is logged. Before: systemd[1]: issue-24990.service: Dependency After=test1.service dropped, merged into issue-24990.service systemd[1]: issue-24990.service: Dependency Before=test1.service dropped, merged into issue-24990.service After: systemd[1]: issue-24990.service: Dependency After=test1.service is dropped, as test1.service is merged into issue-24990.service. systemd[1]: issue-24990.service: Dependency Before=issue-24990.service in test1.service is dropped, as test1.service is merged into issue-24990.service.
| * | core/unit: merge unit names after merging depsYu Watanabe2022-12-061-5/+5
| | | | | | | | | | | | | | | | | | | | | Before: systemd[1]: issue-24990.service: Dependency Before=n/a dropped, merged into issue-24990.service After: systemd[1]: issue-24990.service: Dependency Before=test1.service dropped, merged into issue-24990.service
| * | test: add test case for sysv-generator and invalid dependencyYu Watanabe2022-12-061-2/+114
| | |
| * | core/unit: merge two loops into oneYu Watanabe2022-12-061-32/+15
| | | | | | | | | | | | No functional change, just refactoring.
| * | core/unit: fix logic of dropping self-referencing dependenciesYu Watanabe2022-12-061-1/+2
| | | | | | | | | | | | Fixes a bug in 15ed3c3a188cf7fa5a60ae508fc7a3ed048d2220.
| * | core/unit: drop dependency to the unit being mergedYu Watanabe2022-12-061-8/+13
| | | | | | | | | | | | | | | | | | Fixes a bug in 15ed3c3a188cf7fa5a60ae508fc7a3ed048d2220. Fixes #24990. Also, hopefully fixes #24577.
| * | core/unit: drop doubled empty lineYu Watanabe2022-12-061-1/+0
| | |
* | | Add basic systemctl edit testнаб2022-12-172-3/+17
| | |
* | | TODOLennart Poettering2022-12-161-0/+7
| | |
* | | test: systemd-mount --list and systemd-umount requires the device is ↵Yu Watanabe2022-12-161-1/+7
| | | | | | | | | | | | | | | | | | initialized by udevd Fixes #25674.
* | | man/systemd-oomd.service: Document command line optionsJade Lovelace2022-12-161-1/+18
| | | | | | | | | | | | | | | | | | Previously these were not written down. This PR depends on #25670, since `--dry-run` prints at debug level in `main`, which is surprising behaviour.
* | | Merge pull request #25487 from poettering/systemctl-edit-newline-fixLennart Poettering2022-12-151-99/+156
|\ \ \ | | | | | | | | systemctl: simplify trim_edit_markers()
| * | | systemctl: don't unlink non-existing temporary filesLennart Poettering2022-12-151-2/+5
| | | |
| * | | systemctl: if we edit a single file only, jump to the right lineLennart Poettering2022-12-151-55/+115
| | | |
| * | | systemctl: stop using basename() at one more placeLennart Poettering2022-12-151-4/+7
| | | |
| * | | systemctl: line break string where the newlines areLennart Poettering2022-12-151-2/+4
| | | |
| * | | systemctl: minor modernizations/simplificationsLennart Poettering2022-12-151-6/+7
| | | |
| * | | systemctl: simplify trim_edit_markers()Lennart Poettering2022-12-151-37/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not performance sensitive, don#t try to be smart with realloc() Follow-up for: #25305 Fixes: #25303
* | | | Implement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for ↵Aidan Dang2022-12-157-11/+46
| | | | | | | | | | | | | | | | homed LUKS directories
* | | | repart: Always derive fs/luks UUIDs from generated partition UUIDDaan De Meyer2022-12-151-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating verity partitions, we only know the partition UUID of the verity data and hash partition after doing the verity formatting. This means we can't use the verity partition UUID as input for deriving the filesystem/luks UUIDs. Currently, we derive the filesystem/luks UUID from the null UUID instead, which isn't ideal. Instead, let's always generate a partition UUID and use it to derive the fs/luks UUIDs, but only use it as the actual partition UUID if we're not doing verity for the partition.
* | | | pcrphase: gracefully exit if TPM2 support is incompleteLennart Poettering2022-12-155-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If everything points to the fact that TPM2 should work, but then the driver fails to initialize we should handle this gracefully and not cause failing services all over the place. Fixes: #25700
* | | | test: show and check almost all journal entries since the relevant command ↵Yu Watanabe2022-12-161-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | being invoked For some reasons, journal timestamps from other sources sometimes inconsistent. For example, ``` $ journalctl --file system.journal -o short-monotonic -u resmontest.service [ 1112.168109] ns1.unsigned.test resolvectl[419]: → Q: ns1.unsigned.test IN AAAA [ 1112.168109] ns1.unsigned.test resolvectl[419]: ← S: success [ 1112.168109] ns1.unsigned.test resolvectl[419]: → Q: ns1.unsigned.test IN A [ 1112.168109] ns1.unsigned.test resolvectl[419]: ← S: success [ 1112.168109] ns1.unsigned.test resolvectl[419]: ← A: ns1.unsigned.test IN A 10.0.0.1 [ 1112.171961] ns1.unsigned.test systemd[1]: resmontest.service: Failed to load configuration: No such file or directory [ 1112.172223] ns1.unsigned.test systemd[1]: resmontest.service: Trying to enqueue job resmontest.service/start/fail [ 1112.179866] ns1.unsigned.test systemd[1]: resmontest.service: Installed new job resmontest.service/start as 312 [ 1112.179894] ns1.unsigned.test systemd[1]: resmontest.service: Enqueued job resmontest.service/start as 312 [ 1112.180389] ns1.unsigned.test systemd[1]: resmontest.service: Will spawn child (service_enter_start): /usr/bin/resolvectl [ 1112.180418] ns1.unsigned.test systemd[1]: resmontest.service: Passing 0 fds to service [ 1112.180447] ns1.unsigned.test systemd[1]: resmontest.service: About to execute /usr/bin/resolvectl monitor [ 1112.180477] ns1.unsigned.test systemd[1]: resmontest.service: Forked /usr/bin/resolvectl as 419 [ 1112.180619] ns1.unsigned.test systemd[1]: resmontest.service: Changed dead -> start [ 1112.180651] ns1.unsigned.test systemd[1]: Starting resmontest.service... [ 1112.180799] ns1.unsigned.test systemd[419]: resmontest.service: Kernel keyring access prohibited, ignoring. [ 1112.180895] ns1.unsigned.test systemd[419]: resmontest.service: Executing: /usr/bin/resolvectl monitor [ 1112.181383] ns1.unsigned.test systemd[1]: resmontest.service: Got notification message from PID 419 (READY=1) [ 1112.181413] ns1.unsigned.test systemd[1]: resmontest.service: Changed start -> running [ 1112.181441] ns1.unsigned.test systemd[1]: resmontest.service: Job 312 resmontest.service/start finished, result=done [ 1112.181469] ns1.unsigned.test systemd[1]: Started resmontest.service. ``` In such case, `journalctl -f` may not show the entries what we are interested in. Fixes #25749. (At least, workarond for the issue.)
* | | | network: wifi: check SSID when AP interfaces go upAlvin Šipraga2022-12-163-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an AP goes up, the kernel may emit a netlink event indicating that the interface has gained carrier. In that event, we should check if the SSID has changed before attempting to reconfigure. Not doing so means that the link->ssid member is not updated, leading to a potential mismatch if some of the .network configurations match on SSID=. There are however scenarios where the above heuristic is not enough. Specifically, if the interface carrier state flip-flops within a short enough interval, the internal throttling of netlink events inside the kernel may suppress intermediate linkdown+linkup events (cf. Linux net/core/link_watch.c). So there is no linkup event to react on. To improve on the latter scenario, it is proposed to make newer kernels emit an NL80211_CMD_START_AP multicast event when an AP goes up. This event will not be dropped by link_watch. systemd-networkd can then react to such events as well, and optionally reconfigure the link if the SSID has changed. This will only work with newer kernels though.
* | | | man: add two signature key example to systemd-measureLennart Poettering2022-12-151-0/+58
|/ / / | | | | | | | | | | | | | | | | | | @keszybz asked for an example with --append= used in the systemd-measure man page. Here it is. As requested: https://github.com/systemd/systemd/pull/25224#pullrequestreview-1190709772
* | | test: fix typoYu Watanabe2022-12-161-1/+1
| | |
* | | Merge pull request #25756 from yuwata/test-resolve-1Yu Watanabe2022-12-161-9/+4
|\ \ \ | | | | | | | | test: several cleanups for TEST-75-RESOLVE