summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | base-filesystem: also set up /run/ mount point if missingLennart Poettering2023-05-161-0/+1
|/ / | | | | | | | | | | We don't support images without, hence create this one too, like we create all other relevant mount points we definitely require for booting.
* | watchdog: always disarm watchdog properly before closing itLennart Poettering2023-05-151-5/+10
|/ | | | | | | If we change the watchdog device we should disarm the old one first. Similar, if we open the watchdog, but then fail setting it up, disarm it before closing it again.
* machine-id-setup: Do not overwrite if /etc/machine-id contains uninitializedDaan De Meyer2023-05-151-4/+14
| | | | | | | | When we're building OS images, we never want /etc/machine-id to contain anything other than "uninitialized" until we actually boot the image. So let's allow image builders to write "uninitialized" to /etc/machine-id and if systemd-machine-id-setup is called after, make sure we don't overwrite it.
* nspawn: simplify error handlingFrantisek Sumsal2023-05-141-6/+4
|
* sd-dhcp-server: also send DNS servers or friends on DHCPOFFERYu Watanabe2023-05-131-30/+27
| | | | | | | | | | | | | | | From RFC 2131 section 4.3.1 (https://www.rfc-editor.org/rfc/rfc2131#section-4.3.1): ---- The server MUST return to the client: - Parameters requested by the client, according to the following rules: -- IF the server has been explicitly configured with a default value for the parameter, the server MUST include that value in an appropriate option in the 'option' field, ---- The sentence is not only for ACK, but for all (positive) responses, that is DHCPOFFER and DHCPACK. Fixes #27471.
* Merge pull request #27605 from YHNdnzj/dbus-activation-followupLuca Boccassi2023-05-134-18/+31
|\ | | | | core: only refuse Type=dbus service enqueue if dbus has pending stop job
| * Revert "core/manager: export manager_dbus_is_running" and partially "core: ↵Mike Yuan2023-05-123-11/+7
| | | | | | | | | | | | | | | | | | | | refuse dbus activation if dbus is not running" This reverts commit e8863150653931ae2ffc91757623f179ce763628 and partially 53964fd26b4a01191609ffc064aa8ccccd28e377. Specifically, changes to signal_activation_request() is not desired.
| * core: only refuse Type=dbus service enqueuing if dbus has stop jobMike Yuan2023-05-121-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up for #27579 In #27579 we refused all StartUnit requests for Type=dbus units if dbus is not running, which means if dbus is manually stopped, user can't use systemctl to start Type=dbus units again, which is incorrect. The only culprit that leads to the cancellation of the whole transaction mentioned in #26799 is job type conflict on dbus. So let's relax the restriction and only refuse job enqueuing if dbus has a stop job. To summarize, the case we want to avoid is: 1. dbus has a stop job installed 2. StartUnit/ActivationRequest is received 3. Type=dbus service gets started, which has Requires=dbus.socket 4. dbus is pulled in again, resulting in job type conflict What we can support is: 1. dbus is already stopped 2. StartUnit is received (possibly through systemctl, i.e. on private bus) 3. Type=dbus service gets started, which will wait for dbus to start 4. dbus is started again, thus the job for Type=dbus service Replaces #27590 Fixes #27588
* | Merge pull request #27634 from mrc0mmand/TEST-13-shenanigansLuca Boccassi2023-05-133-6/+4
|\ \ | | | | | | test: clean up & extend the nspawn/machinectl test suite
| * | machine,portable: fix a typo in an info messageFrantisek Sumsal2023-05-132-2/+2
| | |
| * | machine: fix a memory leak when showing multiple machinesFrantisek Sumsal2023-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + machinectl status long-running long-running long-running ================================================================= ==986==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1568 byte(s) in 2 object(s) allocated from: #0 0x7fe57caba097 in calloc (/lib64/libasan.so.8+0xba097) #1 0x7fe57b891e8e in message_from_header ../src/libsystemd/sd-bus/bus-message.c:372 #2 0x7fe57b892dfd in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:421 #3 0x7fe57b9089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fe57b90affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x40f71c in show_machine ../src/machine/machinectl.c:713 #10 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980 #12 0x42ebf9 in run ../src/machine/machinectl.c:3005 #13 0x42ed1f in main ../src/machine/machinectl.c:3008 #14 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 234 byte(s) in 2 object(s) allocated from: #0 0x7fe57cab95b5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xb95b5) #1 0x7fe57b909822 in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1214 #2 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #3 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #4 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #5 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109 #6 0x40f71c in show_machine ../src/machine/machinectl.c:713 #7 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103 #8 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980 #9 0x42ebf9 in run ../src/machine/machinectl.c:3005 #10 0x42ed1f in main ../src/machine/machinectl.c:3008 #11 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 4 byte(s) in 2 object(s) allocated from: #0 0x7fe57ca7243b in strdup (/lib64/libasan.so.8+0x7243b) #1 0x7fe57b8c1543 in message_parse_fields ../src/libsystemd/sd-bus/bus-message.c:4125 #2 0x7fe57b893586 in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:443 #3 0x7fe57b9089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fe57b90affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x40f71c in show_machine ../src/machine/machinectl.c:713 #10 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980 #12 0x42ebf9 in run ../src/machine/machinectl.c:3005 #13 0x42ed1f in main ../src/machine/machinectl.c:3008 #14 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) SUMMARY: AddressSanitizer: 1806 byte(s) leaked in 6 allocation(s).
| * | machine: fix a memory leak when showing multiple imagesFrantisek Sumsal2023-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + machinectl image-status container1 container1 container0 container1 container2 container3 container4 ================================================================= ==1354==ERROR: LeakSanitizer: detected memory leaks Direct leak of 4704 byte(s) in 6 object(s) allocated from: #0 0x7fc3670ba097 in calloc (/lib64/libasan.so.8+0xba097) #1 0x7fc365e91e8e in message_from_header ../src/libsystemd/sd-bus/bus-message.c:372 #2 0x7fc365e92dfd in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:421 #3 0x7fc365f089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fc365f0affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x413b76 in show_image ../src/machine/machinectl.c:1014 #10 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981 #12 0x42ebbd in run ../src/machine/machinectl.c:3006 #13 0x42ece3 in main ../src/machine/machinectl.c:3009 #14 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 666 byte(s) in 6 object(s) allocated from: #0 0x7fc3670b95b5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xb95b5) #1 0x7fc365f09822 in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1214 #2 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #3 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #4 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #5 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109 #6 0x413b76 in show_image ../src/machine/machinectl.c:1014 #7 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103 #8 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981 #9 0x42ebbd in run ../src/machine/machinectl.c:3006 #10 0x42ece3 in main ../src/machine/machinectl.c:3009 #11 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 12 byte(s) in 6 object(s) allocated from: #0 0x7fc36707243b in strdup (/lib64/libasan.so.8+0x7243b) #1 0x7fc365ec1543 in message_parse_fields ../src/libsystemd/sd-bus/bus-message.c:4125 #2 0x7fc365e93586 in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:443 #3 0x7fc365f089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fc365f0affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x413b76 in show_image ../src/machine/machinectl.c:1014 #10 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981 #12 0x42ebbd in run ../src/machine/machinectl.c:3006 #13 0x42ece3 in main ../src/machine/machinectl.c:3009 #14 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) SUMMARY: AddressSanitizer: 5382 byte(s) leaked in 18 allocation(s).
* | | sulogin: Read SYSTEMD_SULOGIN_FORCE from kernel cmdlineDaan De Meyer2023-05-131-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | This allows setting it on the kernel cmdline and having it work automatically without having to write any dropins or such. Also enable the option in mkosi so that we can debug the initrd properly with a locked root account.
* | | Merge pull request #27633 from DaanDeMeyer/repart-dropinLuca Boccassi2023-05-128-16/+18
|\ \ \ | | | | | | | | repart: Make sure we look up dropin files in the root directory
| * | | repart: Make sure we look up dropin files in the root directoryDaan De Meyer2023-05-121-1/+1
| | | |
| * | | conf-parser: Add root argument to config_parse_many()Daan De Meyer2023-05-128-7/+13
| | | |
| * | | repart: Make sure r is declared lastDaan De Meyer2023-05-121-1/+1
| | | |
| * | | repart: Read arguments directly instead of passing them inDaan De Meyer2023-05-121-8/+4
| | |/ | |/|
* | | core: fix memory leak during deserializationFrantisek Sumsal2023-05-131-3/+5
|/ / | | | | | | | | | | when activation-details-unit-name is encountered multiple times. Resolves: #27623
* | core: Try to initialize TERM from systemd.tty.term.console as wellDaan De Meyer2023-05-121-0/+6
| | | | | | | | | | | | We already have the systemd.tty.xxx kernel cmdline arguments for configuring tty's for services, let's make sure the term cmdline argument applies to pid1 as well.
* | Merge pull request #27565 from yuwata/static-destructDaan De Meyer2023-05-123-33/+108
|\ \ | | | | | | static-destruct: support clearing array on exit
| * | static-destruct: introduce STATIC_ARRAY_DESTRUCTOR_REGISTER()Yu Watanabe2023-05-092-8/+83
| | |
| * | static-destruct: several cleanupsYu Watanabe2023-05-091-21/+21
| | | | | | | | | | | | No functional changes, preparation for later commits.
| * | memory-util: make ArrayCleanup passed to array_cleanup() constYu Watanabe2023-05-091-4/+4
| | | | | | | | | | | | Should not change any behavior, preparation for later commits.
* | | mkfs-util: Add quiet argument to make_filesystem()Daan De Meyer2023-05-126-21/+56
| | | | | | | | | | | | | | | | | | | | | | | | We default to quiet operation everywhere except for repart, where we disable quiet and have the mkfs tools write to stdout. We also make sure --quiet or equivalent is implemented for all mkfs tools.
* | | core: Check if any init exists before switching rootDaan De Meyer2023-05-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we switch root and can't execute an init program afterwards, we're completely stuck as we can't go back to the initramfs to start emergency.service as it will have been completely removed by the switch root operation. To prevent leaving users with a completely undebuggable system, let's at least check before we switch root whether at least one of the init programs we might want to execute actually exist, and fail early if none of them exists.
* | | core: Make sure systemctl exit <X> works outside of a containerDaan De Meyer2023-05-122-7/+2
| | | | | | | | | | | | | | | | | | | | | When running in a VM, we now support propagating the exit status via a vsock notify socket, so drop the restrictions on propagating an exit status when not in a container to make sure this works properly.
* | | Merge pull request #27618 from DaanDeMeyer/fstab-generatorYu Watanabe2023-05-121-7/+19
|\ \ \ | | | | | | | | Fstab generator fixes
| * | | fstab-generator: Fix log messageDaan De Meyer2023-05-111-1/+1
| | | |
| * | | fstab-generator: Unset kernel cmdline options if empty value is givenDaan De Meyer2023-05-111-6/+6
| | | |
| * | | fstab-generator: Take systemd.verity= into accountDaan De Meyer2023-05-111-0/+12
| | | | | | | | | | | | | | | | Disable verity logic if systemd.verity= switch is disabled.
* | | | Merge pull request #27611 from yuwata/core-mount-escape-utf8Yu Watanabe2023-05-122-41/+61
|\ \ \ \ | | | | | | | | | | core/mount: escape invalid utf8 chars
| * | | | core/mount: escape invalid UTF8 char in dbus replyYu Watanabe2023-05-111-12/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When What= or Options= may contain invalid UTF8 chars. Replaces aaf7b0e41105d7b7cf30912cdac32820f011a219 (#27541).
| * | | | Revert "core/mount: replace invalid UTF-8 code points in "what" and "options""Yu Watanabe2023-05-111-29/+6
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit aaf7b0e41105d7b7cf30912cdac32820f011a219. Not only /proc/mountinfo, .mount units not started yet may contain invalid UTF-8 chars.
* | | | cryptenroll: actually allow using multiple "special" strings when wipingFrantisek Sumsal2023-05-111-5/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The systemd-cryptenroll man page states: Takes a comma separated list of numeric slot indexes, or the special strings ..., or any combination of these strings or numeric indexes, in which case all slots matching either are wiped. but we'd allow only one special string at any given time as the value was not ORed when assigning. So, for example, --wipe=recovery,password would actually become --wipe=password, etc.
* | | Merge pull request #27539 from esposem/ukify_pesignLuca Boccassi2023-05-112-50/+165
|\ \ \ | |_|/ |/| | ukify: support pesign as alternative to sbsign
| * | src/ukify/test/test_ukify: fix skipped testsEmanuele Giuseppe Esposito2023-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests are skipped because initrd extracted from bootctl is "/boot/initramfs-5.14.0-284.el9.x86_64.img $tuned_initrd" and not just "/boot/initramfs-5.14.0-284.el9.x86_64.img". Therefore split and remove the additional garbage. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
| * | src/ukify/test/test_ukify: add pesign unit testEmanuele Giuseppe Esposito2023-05-101-2/+53
| | | | | | | | | | | | Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
| * | ukify: support pesign as alternative to sbsignEmanuele Giuseppe Esposito2023-05-101-46/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sbsign is not available everywhere, for example RHEL does not have it. Add pesign as alternative to it. pesign will use options "--secureboot-certificate-name" (mandatory) and "--secureboot-certificate-dir" (optional), while sbsign will use "--secureboot-private-key" and "--secureboot-certificate". By default, use sbsign. If no key/cert is provided or sbsign is not found, try pesign. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
| * | ukify: typo in doc and print when package is missingEmanuele Giuseppe Esposito2023-05-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a package is missing, a subprocess is started with None as command argument. Error raised by subprocess is therefore not helpful at all to understand what needs to be done to fix that error. Also fix doc since systemd-stub will look for .cmdline files, and not .cmdline.efi files. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
* | | Merge pull request #27596 from yuwata/drop-pureYu Watanabe2023-05-114-13/+15
|\ \ \ | | | | | | | | drop two more inappropriate _pure_ attributes and several cleanups
| * | | core: replace hashmap_get() with hashmap_contains() where appropriateYu Watanabe2023-05-101-4/+4
| | | |
| * | | core: drop unused argumentYu Watanabe2023-05-101-5/+3
| | | |
| * | | core: several cleanups for job_get_timeout()Yu Watanabe2023-05-102-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | - add missing assertion, - rename the argument for storing result, - always initialize result on success.
| * | | tree-wide: drop _pure_ attribute from non-pure functionsYu Watanabe2023-05-102-2/+2
| | | | | | | | | | | | | | | | | | | | Prompted by #27595. Follow-ups for 6723c28f36ea566faf61d3610012cd89f95ee4a0.
* | | | tmpfiles: Add merge support for copy files actionDaan De Meyer2023-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | If '+' is specified with 'C', let's merge the tree with any existing tree.
* | | | repart: Fix deny list logicDaan De Meyer2023-05-101-91/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, we always excluded the top level directories that were covered by child partition mount points, regardless of the source directory and the target directory of the copy files operation. This means that even if we were populating a XBOOTLDR partition, if there was an EFI partition in the image, we'd exclude /boot unconditionally, leading to the XBOOTLDR partition to be empty. Also, because of the same cause, if we were copying a nested source directory (e.g. /abc/def) to the root directory in the root partition, if /abc/def/usr existed and was populated with files and directories, the root partition would have those files under /usr, even if a /usr partition was defined. To fix these issues, instead of unconditionally excluding the top level partition mount points under <source>, let's make sure that when we're copying files from any source directory to the root directory of a root partition, that we exclude the partition mount point directories under the source directory instead of the top level ones.
* | | | udev: do not set ID_PATH and by-path symlink for nvmf disksYu Watanabe2023-05-101-1/+9
|/ / / | | | | | | | | | Prompted by #27391.
* | | dirent: conditionalize dirent assert based on dirent64 existenceSam James2023-05-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: https://github.com/systemd/systemd/pull/25809
* | | network/tc: rename settings in log messages tooMike Yuan2023-05-101-3/+3
| | | | | | | | | | | | Follow-up for c03ef420fa7157b8d4881636fe72596a06e08bb6