summaryrefslogtreecommitdiffstats
path: root/units/user (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-05-22test: also flush and rotate journal before readYu Watanabe1-1/+12
Follow-up for a610ba00d923f148702e68b1661166e887759509. Fixes #32890.
2024-05-22test: replace journal checkers with journalctl --follow + grep -mYu Watanabe4-12/+17
Recently, for slow test environments, journalctl --sync was added to the loop in the timeout. However, journalctl --sync may be slow in such systems, and timeout easily triggered during syncing. Hopefully, reading journal with --follow and grep the output with an expected line should be efficient. Hopefully fixes #32712.
2024-05-21test: lock device during running cryptsetupYu Watanabe1-3/+4
On running cryptsetup, udevd detects two inotify events for the underlying device. Running the test on enough fast host, the expected symlinks based on UUID and disk label are created by the second event. During processing a uevent for a device, udevd disables the inotify watch for the device. If the test runs on slow system, the second inotify event may comes during a udev worker processing the synthesized uevent triggered by the first inotify event. Hence, no synthesized uevent for the second inotify event will be generated, and the expected symlinks will be never created. To prevent the issue, we need to lock the device during cryptsetup command is running. Fixes #32913.
2024-05-21Revert "test: wipe filesystem before moving to the next test case"Yu Watanabe1-2/+0
This reverts commit 301d7ee6112c6f766ee63d1daed3cd9535a65053. This does not solve issue #32913.
2024-05-21btrfs-util: add assert to fix Coverity warningLuca Boccassi1-0/+2
Coverity gets confused since the iterator change, so add an assert to indicate that this is allocated if n_old_groups is > 0 CID#1545922 Follow-up for 125cca1b51e19d9209a229fca4fb9d94d34c3e78
2024-05-21mkosi: explicitly install g++ in opensuseLuca Boccassi1-0/+1
Not pulled in by default at build time
2024-05-21pkg/opensuse: switch to SHA1 forkLuca Boccassi2-2/+2
src.opensuse.org switched to SHA256, which means it can no longer be used as a submodule in a SHA1 repository. Switch to a fork on Pagure that gets synced across and is still SHA1: https://code.opensuse.org/package/systemd.git
2024-05-21test: wait a bit before stopping/killing serviceYu Watanabe1-2/+3
Otherwise, when stopping the service, the last command may not be started yet, and the service manager may not send SIGTERM signal to the last command, but send SIGKILL on timeout. === May 21 08:23:24 test19-exit-cgroup.sh[437]: + disown May 21 08:23:24 test19-exit-cgroup.sh[438]: + sleep infinity May 21 08:23:24 test19-exit-cgroup.sh[437]: + systemd-notify --ready May 21 08:23:24 test19-exit-cgroup.sh[437]: + sleep infinity May 21 08:23:24 test19-exit-cgroup.sh[441]: + systemctl stop one May 21 08:23:24 test19-exit-cgroup.sh[443]: + sleep infinity (snip) May 21 08:23:24 systemd[1]: one.service: Changed running -> stop-sigterm May 21 08:23:24 systemd[1]: Stopping one.service - /tmp/test19-exit-cgroup.sh "systemctl stop one"... May 21 08:23:24 systemd[1]: Received SIGCHLD from PID 441 (systemctl). May 21 08:23:24 systemd[1]: Child 437 (bash) died (code=killed, status=15/TERM) May 21 08:23:24 systemd[1]: one.service: Child 437 belongs to one.service. May 21 08:23:24 systemd[1]: one.service: Main process exited, code=killed, status=15/TERM (success) May 21 08:23:24 systemd[1]: Child 439 (bash) died (code=killed, status=15/TERM) May 21 08:23:24 systemd[1]: one.service: Child 439 belongs to one.service. May 21 08:23:24 systemd[1]: Child 441 (systemctl) died (code=killed, status=15/TERM) May 21 08:23:24 systemd[1]: one.service: Child 441 belongs to one.service. May 21 08:23:24 systemd[1]: Child 442 (bash) died (code=killed, status=15/TERM) May 21 08:23:24 systemd[1]: one.service: Child 442 belongs to one.service. (snip) May 21 08:24:54 systemd[1]: one.service: State 'stop-sigterm' timed out. Killing. May 21 08:24:54 systemd[1]: one.service: Killing process 443 (sleep) with signal SIGKILL. May 21 08:24:54 systemd[1]: one.service: Changed stop-sigterm -> stop-sigkill May 21 08:24:54 systemd[1]: Received SIGCHLD from PID 443 (sleep). May 21 08:24:54 systemd[1]: Child 443 (sleep) died (code=killed, status=9/KILL) May 21 08:24:54 systemd[1]: one.service: Child 443 belongs to one.service. May 21 08:24:54 systemd[1]: one.service: Control group is empty. May 21 08:24:54 systemd[1]: one.service: Failed with result 'timeout'. May 21 08:24:54 systemd[1]: one.service: Service restart not allowed. May 21 08:24:54 systemd[1]: one.service: Changed stop-sigkill -> failed May 21 08:24:54 systemd[1]: one.service: Job 738 one.service/stop finished, result=done May 21 08:24:54 systemd[1]: Stopped one.service - /tmp/test19-exit-cgroup.sh "systemctl stop one". May 21 08:24:54 systemd[1]: one.service: Unit entered failed state. May 21 08:24:54 systemd[1]: one.service: Releasing resources... === Fixes #32947.
2024-05-21logind: use SD_BUS_ERROR_ACCESS_DENIEDZbigniew Jędrzejewski-Szmek1-1/+2
As requested in post-merge review https://github.com/systemd/systemd/pull/32869#pullrequestreview-2068161094: > NotInControl error is really about session controllers, but this here really > is different.
2024-05-21test: collect information about loopback device on failureYu Watanabe1-1/+9
2024-05-21test: wait for loop/backing_file attribute being removedYu Watanabe1-0/+5
Hopefully fixes issue like https://github.com/systemd/systemd/issues/32680#issuecomment-2120959238 https://github.com/systemd/systemd/issues/32680#issuecomment-2122074805
2024-05-21test: wait for unit generated from /proc/self/mountinfo to be unloadedYu Watanabe1-0/+3
Fixes https://github.com/systemd/systemd/issues/32680#issuecomment-2120974685. === May 21 02:45:08 TEST-74-AUX-UTILS.sh[2475]: + mountpoint /tmp/tmp.eaRV7lSbX2/mnt May 21 02:45:08 TEST-74-AUX-UTILS.sh[2476]: /tmp/tmp.eaRV7lSbX2/mnt is not a mountpoint May 21 02:45:08 TEST-74-AUX-UTILS.sh[2449]: + systemd-mount /dev/loop0 /tmp/tmp.eaRV7lSbX2/mnt May 21 02:45:08 systemd-mount[2477]: Failed to start transient mount unit: Unit tmp-tmp.eaRV7lSbX2-mnt.mount was already loaded or has a fragment file. ===
2024-05-21test: also run some basic test cases on nspawnYu Watanabe1-23/+23
2024-05-21test: stop container when it is not necessary anymoreYu Watanabe1-0/+2
2024-05-21man/systemd-run: beef up info regarding interaction between --pty, --pipe, ↵Mike Yuan1-6/+15
and --wait
2024-05-21run: when disconnected from PTY forwarder, exit event loop if not --waitMike Yuan1-3/+8
Follow-up for ade0789fabbf01b95bf54d32f8cab1217a753f03 The change in behavior was partly intentional, as I think if both --wait and --pty are used, manually disconnecting from PTY forwarder should not result in systemd-run exiting with "Finished with ..." log. But we should check for --wait here. Closes #32953
2024-05-21ptyfwd: add missing assertions for pty_forward_newMike Yuan1-0/+3
2024-05-21po: Translated using Weblate (Indonesian)Andika Triwidada1-3/+5
Currently translated at 100.0% (233 of 233 strings) Co-authored-by: Andika Triwidada <andika@gmail.com> Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/id/ Translation: systemd/main
2024-05-21shared/mountpoint-util: for old kernels, assume "norecovery" is supported by ↵Zbigniew Jędrzejewski-Szmek1-1/+5
btrfs Fixup for e3828d7103a99a15a1e947ba3063294ead590631, as requested in https://github.com/systemd/systemd/pull/32892#issuecomment-2117903328.
2024-05-21test: add a brief comment for the chattr checkFrantisek Sumsal1-0/+3
Addresses: https://github.com/systemd/systemd/pull/32907#discussion_r1605919598
2024-05-21test: make TEST-65-ANALYZE happy when built with gcovFrantisek Sumsal1-1/+3
systemd-analyze runs the generators in a sandbox, which makes gcov unhappy since it can't update its counters. Let's "silence" gcov in this particular case by telling it to look for gcov note files in /tmp (where shouldn't be any, so gcov won't try to update any counters).
2024-05-20test: extend timeout for DHCP/NDisc testsYu Watanabe3-3/+3
Fixes https://github.com/systemd/systemd/pull/32932#issuecomment-2120424121.
2024-05-20btrfs-util: check current offset before readYu Watanabe1-12/+37
Fixes #32936.
2024-05-20logind: make ReleaseSession "unprivileged" and allow closing of own sessionZbigniew Jędrzejewski-Szmek3-3/+13
Fixes https://github.com/systemd/systemd/issues/28514. Quoting https://github.com/systemd/systemd/issues/28514#issuecomment-1831781486: > Whenever PAM is enabled for a service, we set up the PAM session and then > fork off a process whose only job is to eventually close the PAM session when > the service dies. That services we run with service privileges, both to > minimize attack surface and because we want to use PR_SET_DEATHSIG to be get > a notification via signal whenever the main process dies. But that only works > if we have the same credentials as that main process. > > Now, if pam_systemd runs inside the PAM stack (which it normally does) it's > session close hook will ask logind to synchronously end the session via a bus > call. Currently that call is not accessible to unprivileged clients. And > that's the part we need to relax: allow users to end their own sessions. The check is implemented in a way that allows the kill if the sender is in the target session. I found 'sudo systemctl --user -M "zbyszek@" is-system-running' to be a convenient reproducer. Before: May 16 16:25:26 x1c systemd[1]: run-u24754.service: Deactivated successfully. May 16 16:25:26 x1c dbus-broker[1489]: A security policy denied :1.24757 to send method call /org/freedesktop/login1:org.freedesktop.login1.Manager.ReleaseSession to org.freedesktop.login1. May 16 16:25:26 x1c (sd-pam)[3036470]: pam_systemd(login:session): Failed to release session: Access denied May 16 16:25:26 x1c systemd[1]: Stopping session-114.scope... May 16 16:25:26 x1c systemd[1]: session-114.scope: Deactivated successfully. May 16 16:25:26 x1c systemd[1]: Stopped session-114.scope. May 16 16:25:26 x1c systemd[1]: session-c151.scope: Deactivated successfully. May 16 16:25:26 x1c systemd-logind[1513]: Session c151 logged out. Waiting for processes to exit. May 16 16:25:26 x1c systemd-logind[1513]: Removed session c151. After: May 16 17:02:15 x1c systemd[1]: run-u24770.service: Deactivated successfully. May 16 17:02:15 x1c systemd[1]: Stopping session-115.scope... May 16 17:02:15 x1c systemd[1]: session-c153.scope: Deactivated successfully. May 16 17:02:15 x1c systemd[1]: session-115.scope: Deactivated successfully. May 16 17:02:15 x1c systemd[1]: Stopped session-115.scope. May 16 17:02:15 x1c systemd-logind[1513]: Session c153 logged out. Waiting for processes to exit. May 16 17:02:15 x1c systemd-logind[1513]: Removed session c153. Edit: this seems to also fix https://github.com/systemd/systemd/issues/8598. It seems that with the call to ReleaseSession, we wait for the pam session close hooks to finish. I inserted a 'sleep(10)' after the call to ReleaseSession in pam_systemd, and things block on that, nothing is killed prematurely.
2024-05-20logind: group policy entries by interfaceZbigniew Jędrzejewski-Szmek1-8/+8
2024-05-20test: sync journal before readYu Watanabe3-4/+13
Similar to recent commits, e.g. f961f0e47c2caf9af735a22e7f23210e746d0c8b. Fixes #32926.
2024-05-20test: call journalctl --sync just before reading journalsYu Watanabe1-2/+2
Otherwise, journal entries comes during sleep may not be read. Follow-up for c22a112883a46e302dae587b809c459647363ceb.
2024-05-20analyze: do not print timestamps before "start of userspace"Zbigniew Jędrzejewski-Szmek1-8/+5
We have the following timestamp status: $ systemctl show systemd-fsck-root.service | grep InactiveExitTimestamp InactiveExitTimestamp=Thu 2023-11-02 12:27:24 CET InactiveExitTimestampMonotonic=15143158 $ systemctl show | grep UserspaceTimestamp UserspaceTimestamp=Thu 2023-11-02 12:27:25 CET UserspaceTimestampMonotonic=15804273 i.e. UserspaceTimestamp is before InactiveExit of systemd-fsck-root.service. This is fine, but on display, we'd subtract those values and print a huge negative value bogusly: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +137ms └─systemd-fsck-root.service @584542y 2w 2d 20h 1min 48.890s +45ms └─systemd-journald.socket └─system.slice └─-.slice In fact, list_dependencies_print() already had a branch where the check that 'times->activating > boot->userspace_time', but it didn't cover all cases. So make it cover both branches, and also change to '>=', since it's fine if something happened with the same timestamp. With the patch: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +42ms └─systemd-fsck-root.service └─systemd-journald.socket └─system.slice └─-.slice Fixes https://github.com/systemd/systemd/issues/17191.
2024-05-20test: wait for partition device rather than the whole diskYu Watanabe1-2/+2
Fixes #32931.
2024-05-20logind: do not fail creating a session when request is not from a unitLuca Boccassi1-4/+2
When running inside an LXC container the 'su' process will not be part of any unit or slice. manager_get_user_by_pid() which was used until v255 (included) does not fail if it cannot find a unit/slice, but simply returns 'not found'. Do the same in manager_get_session_by_pidref(). This was not detected as Semaphore CI does not reboot the testbed before the logind test, so the session is started by the old logind from the base distro, instead of the one being tested. Follow-up for 8494f562c8963d8a936b0598e23eab277ff29374 Follow-up for 5099a50d4398e190387d204f5df81cc176bd33e2 Fixes https://github.com/systemd/systemd/issues/32929
2024-05-20logind: add one more debug logLuca Boccassi1-1/+4
Helped track down issue with session tracking
2024-05-20semaphore: use variable for Salsa repo URLLuca Boccassi1-1/+2
Makes it easier to switch for debuggin
2024-05-20man: fix grammar for Name= option in systemd.linkdrewbug1-1/+1
2024-05-20test: install more kernel modules for Fedora imageYu Watanabe1-0/+2
Otherwise, several tests for networkd are skipped. Follow-up for #32666.
2024-05-20test-network: also set custom altternative name for netdevsim interfaceYu Watanabe5-14/+28
Due to the bug in kernel 6.9 caused by https://github.com/torvalds/linux/commit/8debcf5832c3e8a6baaea27c75ad8a6ba5077beb, the net_id udev builtin does not work for netdevsim interface. So, eni99np1 cannot be used with kernel 6.9 anymore. Workaround for #32910.
2024-05-20test-network: split out setup_netdevsim()Yu Watanabe1-11/+14
2024-05-19test: sync journal before starting testYu Watanabe1-2/+12
Follow-up for c22a112883a46e302dae587b809c459647363ceb. Hopefully fixes #32712.
2024-05-19machine-id-setup: acquire machine ID from /run/machine-id if possibleYu Watanabe1-13/+24
If machine ID is previously stored at /run/machine-id, then let's reuse it. This is important on switching root and /etc/machine-id was previously a mount point. Fixes #32908.
2024-05-19machine-id-setup: use empty_or_root()Yu Watanabe1-1/+1
2024-05-19machine: fix use-after-free in Rename() DBus methodYu Watanabe1-1/+9
Fixes a bug introduced by 1ddb263d21099ae42195c2bc382bdf72a7f24f82. Note, this requires the previous two commits, and cannot backport without them. Note, before the previous commit, the use-after-free could be triggered only by Rename() DBus method, and could not by RenameImage(), as we did not cache Image object when RenameImage() method is called. And machinectl always uses RenameImage(). Hence, the issue could be triggered only when Rename() DBus method is explicitly called by e.g. busctl. With the previous commit, the Image object passed to the function is always cached. Hence, the issue could be triggered even with machinectl command, and this fix is important.
2024-05-19machine: also acquire Image object from cache when a dbus method in the main ↵Yu Watanabe1-3/+2
interface is called Previously, Image objects were only cached when reading properties or methods in the org.freedesktop.machine1.Image interface are called. This makes that, when a method in the main interface (org.freedesktop.machine1) for an image is called, also acquire the Image object from the cache, and if not cached, create Image object and put into the cache, like we do for org.freedesktop.machine1.Image. Otherwise, if some properties of an image are updated by methods in the main interface, e.g. MarkImageReadOnly(), the changes do not applied to the cached Image object, and subsequent read of proerties through the interface for the image, e.g. ReadOnly property, may provide outdated values. Follow-up for 1ddb263d21099ae42195c2bc382bdf72a7f24f82. Fixes #32888.
2024-05-19machine: split out manager_acquire_image() from image_object_find()Yu Watanabe2-26/+45
Preparation for the next commit. No functional change.
2024-05-19discover-image: also update Image.limit in image_set_limit()Yu Watanabe1-14/+47
Same as the previous commit, but for SetLimit DBus method vs Limit property and friends.
2024-05-19discover-image: update Image.read_only flag in image_read_only()Yu Watanabe1-0/+1
Otherwise, ReadOnly DBus property in org.freedesktop.machine1.Image or org.freedesktop.portable1.Image will not be updated by MarkReadOnly DBus method.
2024-05-19test: sync journal before readYu Watanabe2-0/+9
Workaround for #32834 and #32890.
2024-05-19run: pass the pty slave fd to transient serviceMike Yuan1-3/+9
The rationale is similar to 40e1f4ea7458a0a80eaf1ef356e52bfe0835412e. Currently, we only pass TTYPath=/dev/pts/... to the transient service spawned by systemd-run. This is a bit problematic though, when ExecStartPre= or ExecStopPost= is used. Since when these control processes get to run, the main process is not yet started/has already exited, hence the slave suffers from the same vhangup problem as the mentioned commit. By passing the slave fd in, the service manager will hold the fd open as long as the service is alive. Fixes #32916
2024-05-19run: do not log "Error on PTY forwarding logic" when disconnected due to ↵Mike Yuan1-2/+4
user operation
2024-05-19vmspawn: use openpt_allocate where appropriateMike Yuan1-9/+2
2024-05-19ptyfwd: trivial coding style and log cleanupsMike Yuan1-13/+16
2024-05-18test: wipe filesystem before moving to the next test caseYu Watanabe1-0/+2