summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* core/systemctl: when switching root default to /sysroot/Lennart Poettering2023-04-285-29/+41
| | | | | | | | | We hardcode the path the initrd uses to prepare the final mount point at so many places, let's also imply it in "systemctl switch-root" if not specified. This adds the fallback both to systemctl and to PID 1 (this is because both to — different – checks on the path).
* libsystemd: Add missing memory pressure functions to public symbolsDaan De Meyer2023-04-281-0/+4
|
* Merge pull request #27445 from poettering/reflink-fixMike Yuan2023-04-291-9/+11
|\ | | | | remove duplication reflink ioctl invocation
| * copy: shortcut reflink_range() to reflink() in some casesLennart Poettering2023-04-281-0/+6
| |
| * copy: don't call clone ioctls twiceLennart Poettering2023-04-281-9/+5
| | | | | | | | | | The btrfs name and the generic name have the same values, hence there's no point in bothering with the former.
* | systemctl: rework 'if' to 'switch' statementLennart Poettering2023-04-291-11/+17
| |
* | Merge pull request #27437 from mrc0mmand/pstoreLuca Boccassi2023-04-282-3/+227
|\ \ | |/ |/| test: add a couple of tests for systemd-pstore
| * test: add a couple of tests for systemd-pstoreFrantisek Sumsal2023-04-281-0/+221
| |
| * pstore: avoid opening the dmesg.txt file if not requestedFrantisek Sumsal2023-04-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even with Storage=journal we would still attempt to open the final dmesg.txt file which causes a lot of noise in the journal: ``` [ 5.764111] H testsuite-82.sh[658]: + systemctl start systemd-pstore [ 5.806385] H systemd[1]: Starting modprobe@efi_pstore.service... [ 5.808656] H systemd[1]: modprobe@efi_pstore.service: Deactivated successfully. [ 5.808971] H systemd[1]: Finished modprobe@efi_pstore.service. [ 5.818845] H kernel: audit: type=1130 audit(1682630623.637:114): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=modprobe@efi_pstore comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termin> [ 5.818865] H kernel: audit: type=1131 audit(1682630623.637:115): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=modprobe@efi_pstore comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termin> [ 5.816052] H systemd[1]: Starting systemd-pstore.service... [ 5.840703] H systemd-pstore[806]: PStore dmesg-efi-168263062313014. [ 5.841239] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.841428] H systemd-pstore[806]: PStore dmesg-efi-168263062312014. [ 5.841575] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.841712] H systemd-pstore[806]: PStore dmesg-efi-168263062311014. [ 5.841839] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.841989] H systemd-pstore[806]: PStore dmesg-efi-168263062310014. [ 5.842141] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.842274] H systemd-pstore[806]: PStore dmesg-efi-168263062309014. [ 5.842423] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.842589] H systemd-pstore[806]: PStore dmesg-efi-168263062308014. [ 5.842722] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.842865] H systemd-pstore[806]: PStore dmesg-efi-168263062307014. [ 5.843003] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.843153] H systemd-pstore[806]: PStore dmesg-efi-168263062306014. [ 5.843280] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.843434] H systemd-pstore[806]: PStore dmesg-efi-168263062305014. [ 5.843570] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.843702] H systemd-pstore[806]: PStore dmesg-efi-168263062304014. [ 5.843831] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.843958] H systemd-pstore[806]: PStore dmesg-efi-168263062303014. [ 5.844093] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.844250] H systemd-pstore[806]: PStore dmesg-efi-168263062302014. [ 5.844412] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.844619] H systemd-pstore[806]: PStore dmesg-efi-168263062301014. [ 5.844781] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.844956] H systemd-pstore[806]: PStore dmesg-efi-168263062300014. [ 5.845168] H systemd-pstore[806]: Failed to open file /var/lib/systemd/pstore/1682630623/014/dmesg.txt: Operation not permitted [ 5.851101] H systemd[1]: Finished systemd-pstore.service. ```
| * pstore: explicitly set the base when converting record IDFrantisek Sumsal2023-04-281-3/+3
| |
* | Merge pull request #27440 from yuwata/reflink-follow-upsLuca Boccassi2023-04-284-7/+7
|\ \ | | | | | | copy: follow ups for reflink()
| * | missing_fs: mention commit hash and version of ioctl commands introducedYu Watanabe2023-04-281-3/+3
| | |
| * | copy: rename reflink_full() -> reflink_range()Yu Watanabe2023-04-283-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit b640e274a7c363a2b6394c9dce5671d9404d2e2a introduced reflink() and reflink_full(). We usually name function xyz_full() for fully parameterized version of xyz(), and xyz() is typically a inline alias of xyz_full(). But in this case, reflink() and reflink_full() call different ioctl(). Moreover, reflink_full() does partial reflink, while reflink() does full file reflink. That's super confusing. Let's rename reflink_full() to reflink_range(), the new name is consistent with ioctl name, and should be fine.
* | | network-generator: shorten code a bitYu Watanabe2023-04-281-25/+11
| | |
* | | Merge pull request #27424 from dtardon/auto-cleanupYu Watanabe2023-04-2815-112/+106
|\ \ \ | |/ / |/| | More automatic cleanup
| * | logind-session-dbus: use _cleanup_David Tardon2023-04-282-7/+7
| | |
| * | logind-session-device: modernize session_device_free()David Tardon2023-04-282-4/+6
| | |
| * | homed-manager-bus: use _cleanup_David Tardon2023-04-281-4/+4
| | |
| * | transaction: make transaction_free() staticDavid Tardon2023-04-282-2/+1
| | | | | | | | | | | | ... as it's not needed outside transaction.c anymore.
| * | manager: use _cleanup_ in manager_propagate_reload()David Tardon2023-04-281-9/+4
| | |
| * | manager: use _cleanup_ in manager_add_job()David Tardon2023-04-281-11/+6
| | |
| * | transaction: introduce transaction_abort_and_free()David Tardon2023-04-282-0/+11
| | | | | | | | | | | | Will be used in following commits.
| * | transaction: modernize transaction_free()David Tardon2023-04-272-3/+7
| | |
| * | initctl: use _cleanup_David Tardon2023-04-271-6/+5
| | |
| * | initctl: add assertDavid Tardon2023-04-271-0/+1
| | |
| * | specifier: use _cleanup_David Tardon2023-04-271-5/+4
| | |
| * | path-util: use _cleanup_David Tardon2023-04-271-5/+3
| | |
| * | logind: rename function to avoid confusionDavid Tardon2023-04-271-5/+5
| | |
| * | logind-core: drop unneeded check for NULLDavid Tardon2023-04-271-7/+3
| | |
| * | logind-core: modernize button_free()David Tardon2023-04-272-4/+6
| | |
| * | env-util: use more _cleanup_ in replace_env_argv()David Tardon2023-04-271-5/+4
| | |
| * | env-util: use _cleanup_ in replace_env_argv()David Tardon2023-04-271-7/+3
| | |
| * | env-util: rename variableDavid Tardon2023-04-271-26/+26
| | |
| * | env-util: use _cleanup_ in strv_env_delete()David Tardon2023-04-271-5/+3
| | |
* | | xdg-autostart-service: handle gnome autostart phase better on other desktopsDavid Edmundson2023-04-281-10/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autostart files which contain the line gnome-autostart-phase are currently completely skipped by systemd. This is because these are handled internally by gnome startup through other means. The problem is a number of desktop files that need to run on KDE too have this flag set. Ideally they should just create systemd user units, but we're not at this point universally yet. This patch changes the logic so if the flag is set, we set NotShowIn-gnome, which in turn would just not load decided at runtime. As an optimisation if we would get conflicting OnlyShowIn lines we still skip the file completely. Example: $ rg 'Exec|Autostart-Phase' /etc/xdg/autostart/gnome-keyring-pkcs11.desktop Exec=/usr/bin/gnome-keyring-daemon --start --components=pkcs11 X-GNOME-Autostart-Phase=PreDisplayServer $ cat '/tmp/xxx/app-gnome\x2dkeyring\x2dpkcs11@autostart.service' # Automatically generated by systemd-xdg-autostart-generator [Unit] SourcePath=/etc/xdg/autostart/gnome-keyring-pkcs11.desktop ... [Service] ... ExecCondition=/usr/lib/systemd/systemd-xdg-autostart-condition "Unity:MATE" "GNOME" Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
* | | copy: Introduce reflink() and reflink_full()Daan De Meyer2023-04-288-43/+66
| | | | | | | | | | | | | | | | | | The kernel has had filesystem independent reflink ioctls for a while now, let's try to use them and fall back to the btrfs specific ones if they're not supported.
* | | Merge pull request #27346 from poettering/pam-fixesLuca Boccassi2023-04-274-56/+135
|\ \ \ | | | | | | | | pam-systemd: be more careful with sharing bus connections
| * | | pam-systemd: disconnect bus connection when leaving session hook, even on errorLennart Poettering2023-04-274-54/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for systematically destroying connections in pam_sm_session_open() even on failure, so that under no circumstances unserved dbus connection are around while the invoking process waits for the session to end. Previously we'd only do this on success, now do it in all cases. This matters since so far we suggested people hook pam_systemd into their pam stacks prefixed with "-", so that login proceeds even if pam_systemd fails. This however means that in an error case our cached connection doesn't get disconnected even if the session then is invoked. This fixes that.
| * | | pam-util: include PID in PAM data field idLennart Poettering2023-04-271-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's systematically avoid sharing cached busses between processes (i.e. from parent and child after fork()), by including the PID in the field name. With that we're never tempted to use a bus object the parent created in the child. (Note this is about *use*, not about *destruction*. Destruction needs to be checked by other means.)
* | | | shutdown: paranoia – close all fds we might get passed inLennart Poettering2023-04-271-0/+6
|/ / / | | | | | | | | | | | | We don't expect any fds (beyond 0…2) to be passed from the service manager into systemd-shutdown, but let's better be safe then sorry.
* | | test: dont use anchor char '$' to match a part of a stringFranck Bui2023-04-271-2/+2
| | | | | | | | | | | | | | | When anchoring the pattern using '$' regular expression operator it forces '=~' operator to match the entire string.
* | | Merge pull request #25622 from YHNdnzj/tmpfiles-X-bit-supportMike Yuan2023-04-277-24/+283
|\ \ \ | | | | | | | | tmpfiles: add conditionalized execute permission (X) support
| * | | test: tmpfiles: add tests on conditionalized execute bitMike Yuan2023-04-273-0/+62
| | | |
| * | | tmpfiles: add conditionalized execute bit (X) supportMike Yuan2023-04-274-24/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to setfacl(1), "the character X stands for the execute permission if the file is a directory or already has execute permission for some user." After this commit, parse_acl() would return 3 acl objects. The newly-added acl_exec object contains entries that are subject to conditionalized execute bit mangling. In tmpfiles, we would iterate the acl_exec object, check the permission of the target files, and remove the execute bit if necessary. Here's an example entry: A /tmp/test - - - - u:test:rwX Closes #25114
* | | | Merge pull request #27376 from poettering/subcgroupLennart Poettering2023-04-2719-77/+294
|\ \ \ \ | | | | | | | | | | pid1: add DelegateSubgroup= option
| * | | | test: extend test 19 to also verify DelegateSubgroup= worksLennart Poettering2023-04-271-0/+18
| | | | |
| * | | | nspawn: port over to /supervisor/ subcgroup being delegated to nspawnLennart Poettering2023-04-272-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's make use of the new DelegateSubgroup= feature and delegate the /supervisor/ subcgroup already to nspawn, so that moving the supervisor process there is unnecessary.
| * | | | udev: port to DelegateSubgroup=Lennart Poettering2023-04-272-51/+9
| | | | |
| * | | | units: make system service manager create init.scope subcgroup for user ↵Lennart Poettering2023-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | service manager This one is basically for free, since the service manager is already prepared for being invoked in init.scope. Hence let's start it in the right cgroup right-away.
| * | | | core: change ownership of subcgroup we create recursively, it shall be owned ↵Lennart Poettering2023-04-273-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by the user delegated to If we create a subcroup (regardless if the '.control' subgroup we always created or one configured via DelegateSubgroup=) it's inside of the delegated territory of the cgroup tree, hence it should be owned fully by the unit's users. Hence do so.