summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* battery-util: be more careful when determining whether we are in a low ↵Lennart Poettering2023-06-051-3/+24
| | | | | | | battery state Let's avoid assuming a low battery battery state if in doubt. That means, handle errors reading battery state gracefully.
* battery-util: move battery_is_discharging_and_low() to battery-util.[ch]Lennart Poettering2023-06-055-81/+89
| | | | | | | | | | This moves a first batch of functions from sleep-config.[ch] over to battery-util.[ch]. In the long run we should probably move even more stuff over, i.e. anything that deals with the battery sysfs driver interface. No code change.
* battery-util: split out code that checks AC power state into its own .c/.h pairLennart Poettering2023-06-0510-177/+189
| | | | | | | | No code change, just some splitting out of the relevant code from udev-util.[ch]. This makes sense on its own, but is also prepartion to move the code that checks for low battery state into battery-util.[ch], too.
* add support for KSMStefan Roesch2023-06-0511-0/+65
| | | | | | This adds support for KSM (kernel samepage merging). It adds a new boolean parameter called MemoryKSM to enable the feature. The feature can only be enabled with newer kernels.
* chase: fix triggering assertionYu Watanabe2023-06-051-1/+1
|
* ci: Report results from CIFuzz using SARIFjonathanmetzman2023-06-051-0/+12
| | | | | | Upload results from CIFuzz using SARIF. This will allow CIFuzz to report issues in the security tab. This is a better UI than having to look through logs. TODO(google/oss-fuzz#10452): Add proper descriptions of UBSAN bugs.
* path-util: fix typo in commentGaël PORTAY2023-06-051-1/+1
| | | | | | | | | | | | | | | The comment makes a reference to the function fchmod_path() but this function does not exist in the source tree. However, the function fchmod_opath() exists; it was introduced by the commit 4dfaa528d451aa7926be4f1b4cf8d0ffe338421d. As the comment tells, the function futimens_opath() introduced by the commit f25bff5eaf6881717e873f27c26f2e8264517c16 is similar to the function fchmod_opath(); therefore, it should reference it. This fixes the typo in the comment by referencing the proper function fchmod_opath().
* Merge pull request #27907 from mrc0mmand/quick-test-tweaksYu Watanabe2023-06-032-1/+2
|\ | | | | test: a couple of tweaks for recent CI fails
| * test: drop the --recursive=no testFrantisek Sumsal2023-06-031-1/+0
| | | | | | | | | | As the outcome also depends on availability of the PID namespace, so the test might (and does) unexpectedly pass in some environments.
| * test: ignore missing coverage in TEST-82-SOFTREBOOTFrantisek Sumsal2023-06-031-0/+2
| | | | | | | | As we temporarily mount rootfs read-only there.
* | Merge pull request #27908 from weblate/weblate-systemd-masterFrantisek Sumsal2023-06-033-5/+887
|\ \ | | | | | | Translations update from Fedora Weblate
| * | po: Translated using Weblate (Korean)김인수2023-06-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently translated at 100.0% (193 of 193 strings) Co-authored-by: 김인수 <simmon@nplob.com> Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/ Translation: systemd/main
| * | po: Translated using Weblate (Basque)Asier Sarasua Garmendia2023-06-032-0/+882
|/ / | | | | | | | | | | | | | | | | | | Currently translated at 16.5% (32 of 193 strings) po: Added translation using Weblate (Basque) Co-authored-by: Asier Sarasua Garmendia <asier.sarasua@gmail.com> Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/eu/ Translation: systemd/main
* / umount: /usr/ should never be unmounted regardless of HAVE_SPLIT_USR or notLennart Poettering2023-06-031-5/+4
|/ | | | | | | Whether we put some binaries in /bin or in /usr/bin should not have any effect on unmounting during shutdown. Even if people split /usr/ off we should not try to unmount it, no matter what as it is simply where binaries are placed.
* sysupdate.d: Add way to drop binaries into $BOOTAdrian Vovk2023-06-035-39/+148
| | | | | | | | | | As described in the BLS, we should place binaries into the XBOOTLDR directory if it is available, otherwise into the ESP. Thus, we might need to put binaries into /boot or into /efi depending on the existence of the XBOOTLDR partition. With this change, we introduce a new PathRelativeTo= config option that makes this functionality possible
* Merge pull request #27904 from DaanDeMeyer/lsmLuca Boccassi2023-06-033-0/+14
|\ | | | | mkosi: Enable more options
| * mkosi: Enable more optionsDaan De Meyer2023-06-023-0/+14
| | | | | | | | | | | | We build with support for selinux/apparmor where applicable but disable them at runtime as even in permissive mode they're horribly broken.
* | Merge pull request #27903 from mrc0mmand/test-followupsLuca Boccassi2023-06-034-16/+61
|\ \ | | | | | | test: a couple of systemd-{coredump,pstore,run} followups
| * | test: probe a couple more paths in systemd-runFrantisek Sumsal2023-06-021-9/+22
| | |
| * | coverage: add a wrapper for execvpe()Frantisek Sumsal2023-06-021-6/+17
| | | | | | | | | | | | | | | It's the exactly same stuff as for execveat() - gcov doesn't have a wrapper for execvpe() so introduce our own.
| * | test: sync with the fake binary before killing itFrantisek Sumsal2023-06-021-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On faster machines we might be too fast and kill the fake binary during fork() which then makes kernel report a "wrong" binary in the coredump, e.g.: [ 31.408078] testsuite-74.sh[548]: + /tmp/make-dump /tmp/test-dump SIGTRAP [ 31.409720] testsuite-74.sh[560]: + bin=/tmp/test-dump [ 31.409720] testsuite-74.sh[560]: + sig=SIGTRAP [ 31.409720] testsuite-74.sh[560]: + ulimit -c unlimited [ 31.409720] testsuite-74.sh[560]: + pid=561 [ 31.409720] testsuite-74.sh[560]: + sleep 1 [ 31.409720] testsuite-74.sh[560]: + kill -s SIGTRAP 561 [ 31.409720] testsuite-74.sh[560]: + wait 561 [ 31.491757] systemd[1]: Created slice system-systemd\x2dcoredump.slice. [ 31.524488] systemd[1]: Started systemd-coredump@0-563-0.service. [ 31.616372] systemd-coredump[564]: [🡕] Process 561 (make-dump) of user 0 dumped core. Stack trace of thread 561: #0 0x00007ff86bb49af7 _Fork (libc.so.6 + 0xd4af7) #1 0x00007ff86bb4965f __libc_fork (libc.so.6 + 0xd465f) #2 0x000055e88011b0ad make_child (bash + 0x550ad) #3 0x000055e8800fd05f n/a (bash + 0x3705f) #4 0x000055e880100116 execute_command_internal (bash + 0x3a116) #5 0x000055e8801011f2 execute_command_internal (bash + 0x3b1f2) #6 0x000055e8801025b6 execute_command (bash + 0x3c5b6) #7 0x000055e8800f134b reader_loop (bash + 0x2b34b) #8 0x000055e8800e757d main (bash + 0x2157d) #9 0x00007ff86ba98850 n/a (libc.so.6 + 0x23850) #10 0x00007ff86ba9890a __libc_start_main (libc.so.6 + 0x2390a) #11 0x000055e8800e83b5 _start (bash + 0x223b5) ELF object binary architecture: AMD x86-64 [ 31.666617] testsuite-74.sh[560]: /tmp/make-dump: line 12: 561 Trace/breakpoint trap (core dumped) "$bin" infinity ... $ coredumpctl list --file system.journal TIME PID UID GID SIG COREFILE EXE SIZE Fri 2023-06-02 10:42:10 CEST 561 0 0 SIGTRAP journal /usr/bin/bash - Fri 2023-06-02 10:42:11 CEST 570 0 0 SIGABRT journal /tmp/test-dump - Fri 2023-06-02 10:42:12 CEST 582 0 0 SIGTRAP missing /tmp/test-dump - Fri 2023-06-02 10:42:13 CEST 593 0 0 SIGABRT missing /tmp/test-dump -
| * | test: clean up our mess after the pstore testFrantisek Sumsal2023-06-021-0/+11
| | |
* | | Merge pull request #27435 from poettering/renew-rebootLennart Poettering2023-06-0244-134/+828
|\ \ \ | | | | | | | | pid1: add a new method of rebooting: userspace only under the name "soft-reboot"
| * | | update TODOLennart Poettering2023-06-021-0/+9
| | | |
| * | | test: add integration test for soft reboots incl. fdstore passingLennart Poettering2023-06-024-0/+180
| | | |
| * | | test: disable SoftReboot() in dfuzzer test for nowLennart Poettering2023-06-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | As requested: https://github.com/systemd/systemd/pull/27435#issuecomment-1527810336
| * | | man: document the soft reboot operationLennart Poettering2023-06-0210-61/+301
| | | |
| * | | fstab-util: consider /run/nextroot/ among extrinsic mountsLennart Poettering2023-06-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way we'll not add deps for the mount point that unmount it during shutdown. This is similar as for /run/initramfs/ which we want to transition into during shutdown. This way we don't have to add "-o x-initrd.mount" to all bind mounts for /run/nextroot anymore to make it survive the reboot, it will be implied.
| * | | mount-setup: exclude /run/nextroot/ from relabellingLennart Poettering2023-06-021-2/+3
| | | | | | | | | | | | | | | | | | | | Just like /run/initramfs/ the data in /run/nextroot/ should be a self-contained OS tree, and not require labelling, hence don't.
| * | | switch-root: automatically make target switch root dir a mount pointLennart Poettering2023-06-022-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's make sure implicitly that the target directory is a mount point, instead of doing so manually beforehand. This allows us to drop this step from the transition into the /run/initramfs/ dir at shutdown. During the initrd→host transition the switch root operations so far where towards pre-existing mount points, but there are cetrainly usecases where it might make sense to siwtch into arbitrary subdirectories, too.
| * | | mount-util: add fd_make_mount_point() helperLennart Poettering2023-06-023-0/+68
| | | |
| * | | switch-root: disable sync() again when we switch root during shutdownLennart Poettering2023-06-023-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our shutdown binary that takes over as PID 1 when shutting down puts great efforts into a sync() that comes with a time-out once sync'ing process stops. If we'd add another dumb sync() here, we kinda defeat all it is good for. Hence, let's keep the sync() in for most codepats, but let's disable it for the final shutdown logic when we transition back into the exitrd. After all we sync()ed more than enough here, no need to sync() even more.
| * | | switch-root: introduce SwitchRootFlags flags parameter to switch_root()Lennart Poettering2023-06-024-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's replace the current boolean param with a proper flags param. With a single flag this doesn't appear to make much sense, though it does already make things more readable I think. However, once we add a second flag, it starts to make more sense. Also, while we are at it, condition the "istmp" determinaton with this flag too, since we only need it when the flag is set.
| * | | switch-root: always use MS_BIND to move api vfs overLennart Poettering2023-06-024-31/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously would use MS_MOVE to move the old procfs, sysfs, /dev/ and /run to the new place in some places, and MS_BIND in others. The logic when to use MS_MOVE and when to use MS_BIND was pretty arbitrary so far: we'd use MS_MOVE during the initrd → host transition and MS_BIND when transitioning from host into the exitrd during shutdown. Traditionally, using MS_MOVE was preferable, because we didn't bother with unmounting the old mount hierarchy before the switch root, and thus using MS_MOVE did some clean-up as side-effect (because the old mounts went away this way). But since we nowadays properly umount all remaining mount points (since 268d1244e87a35ff8dff56c92ef375ebf69d462e) when transitioning it's pointless. Let's just use MS_BIND always. Let's tweak it though: let's use MS_BIND|MS_REC for the kernel API VFS, and MS_BIND without MS_REC for /run/. The latter reflects the fact that the submounts /run/ has usually are not so much about just accessing kernel APIs but about auxiliary user resources. Hence let's only move the main mount over for that. While we are at it, also set up the base filesystem *before* we move the mounts from the old to the new root, since the base filesystem setup logic creates various needed inodes for us, which we really should make use of instead of creating on our own.
| * | | systemctl: add "systemctl soft-reboot" commandLennart Poettering2023-06-026-2/+11
| | | |
| * | | logind: add support for 'soft-reboot' rebootsLennart Poettering2023-06-024-4/+33
| | | |
| * | | pid1: add "soft-reboot" reboot methodLennart Poettering2023-06-0213-26/+161
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new mechanism for rebooting, a form of "userspace reboot" hereby dubbed "soft-reboot". It will stop all services as in a usual shutdown, possibly transition into a new root fs and then issue a fresh initial transaction. The kernel is not replaced. File descriptors can be passed over, thus opening the door for leaving certain resources around between such reboots. Usecase: this is an extremely quick way to reset userspace fully when updating image based systems, without going through a full hardware/firmware/boot loader/kernel/initrd cycle. It minimizes "grayout time" for OS updates. (In particular when combined with kernel live patching)
* | | Merge pull request #27896 from poettering/umount-detach-reworkLennart Poettering2023-06-0213-561/+757
|\ \ \ | | | | | | | | shutdown: refactoring + tone down log message a bit
| * | | shutdown: tone down failure messages a bitLennart Poettering2023-06-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we are not able to detach all MD/DM/loopback devices this is not necessarily a failure, it's simply because we might be running off them. Hence let's tone down our language a bit, and just say "Unable to" rather than "Failed to".
| * | | detach-loopback: also don't bother detaching loopback block device /usr/ is ↵Lennart Poettering2023-06-021-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | running off While we are at it, let's also clean this up a bit: unlike DM/MD devices loopback devices are likely partitioned, hence trace the block device through the partition layer and LUKS.
| * | | detach-md: similar to the DM case, also don't try to detach MD device ↵Lennart Poettering2023-06-021-2/+5
| | | | | | | | | | | | | | | | backing /usr/
| * | | shutdown: don't attempt to detach DM volume backing /usr/Lennart Poettering2023-06-021-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we run off /usr/ it makes no sense to attempt to try to detach any DM device backing it. Hence skip it just like we skip detaching the DM device backing the root fs. Addresses: https://github.com/systemd/systemd/issues/27682#issuecomment-1573328188
| * | | detach-loopback: also decouple from umount.hLennart Poettering2023-06-024-16/+37
| | | | | | | | | | | | | | | | | | | | Let's introduce LoopbackDevice as replacement for MountPoint, with just the fields we actually need.
| * | | detach-md: also decouple structures from umount.hLennart Poettering2023-06-021-11/+33
| | | |
| * | | detach-dm: decouple from umount.[ch]Lennart Poettering2023-06-021-11/+33
| | | | | | | | | | | | | | | | | | | | Let's also define our own little structure here with just the fields we need.
| * | | detach-swap: decouple from umount.hLennart Poettering2023-06-023-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So far detach-swap.[ch] were still using the MountPoint structure to store swap device info in. Since it was only using a single field of it sharing the whole structure is kinda pointless. Hence, let's decouple this and only add the field we really need.
| * | | umount: split out swap detachment code tooLennart Poettering2023-06-027-86/+111
| | | |
| * | | umount: split out loopback detach codeLennart Poettering2023-06-026-197/+211
| | | | | | | | | | | | | | | | | | | | Like the similar commits, no actual code changes, just splitting up large C files.
| * | | umount: similar as previous commit, split out DM detachingLennart Poettering2023-06-026-125/+155
| | | |
| * | | umount: split out MD detaching code from umount.cLennart Poettering2023-06-026-135/+166
| | | | | | | | | | | | | | | | | | | | umount.c does so much stuff, and MD detaching is relatively separate, hence split it out into its own .c/.h file pair.