[Bug 1891858] [NEW] Race condition in mounting /tmp at boot
Panther
1891858 at bugs.launchpad.net
Mon Aug 17 07:17:07 UTC 2020
Public bug reported:
I have configured a separate /tmp partition, which is a LVM volume and create at boot via an /etc/crypttab entry
vol-tmp_crypt /dev/mapper/vol-tmp /dev/urandom cipher=aes-xts-plain64,size=256,tmp,discard
and mounted via an fstab entry
/dev/mapper/vol-tmp_crypt /tmp ext2 defaults 0 2
At about every third boot /tmp is not mounted and then gnome-shell cannot start, because it is not allowed to write in not mounted /tmp directory. One or two restart are required to fix this problem.
###############
Independent of the success of the boot process, the log message related to the problem seem to be:
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found ordering cycle on systemd-cryptsetup at vol\x2dtmp_crypt.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Job systemd-cryptsetup at vol\x2dtmp_crypt.service/start deleted to break ordering cyc>
Aug 17 07:11:02 hostname systemd[1]: Unnecessary job for /dev/mapper/vol-tmp was removed.
[...]
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found ordering cycle on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on systemd-cryptsetup at vol\x2dtmp_crypt.>
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Job systemd-random-seed.service/start deleted to break or>
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found ordering cycle on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on systemd-cryptsetup at vol\x2dtmp_crypt.>
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Job cryptsetup.target/start deleted to break ordering cyc>
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found ordering cycle on systemd-cryptsetup at vol\x2dtmp_crypt.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Job systemd-cryptsetup at vol\x2dtmp_crypt.service/start deleted to break ordering cyc>
###############
Only in a unsuccessful boot up i see:
Aug 17 07:11:02 hostname systemd[1]: Reached target Block Device Preparation for /dev/mapper/vol-tmp_crypt.
Aug 17 07:11:02 hostname systemd[1]: Stopped target Block Device Preparation for /dev/mapper/vol-tmp_crypt.
[...]
Aug 17 07:11:17 hostname gnome-shell[3387]: failed to create lock file /tmp/.X1071-lock: Permission denied
Aug 17 07:11:17 hostname gnome-shell[3387]: failed to create lock file /tmp/.X1072-lock: Permission denied
Aug 17 07:11:17 hostname gnome-shell[3387]: failed to create lock file /tmp/.X1073-lock: Permission denied
Aug 17 07:11:17 hostname gnome-shell[3387]: Failed to create an X lock file
Aug 17 07:11:17 hostname gnome-shell[3387]: Failed to start X Wayland
###############
I am running an up-to-date 20.04 on amd64
with uname -a:
Linux hostname 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
and systemd --version:
systemd 245 (245.4-4ubuntu3.2)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
** Affects: systemd (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1891858
Title:
Race condition in mounting /tmp at boot
Status in systemd package in Ubuntu:
New
Bug description:
I have configured a separate /tmp partition, which is a LVM volume and create at boot via an /etc/crypttab entry
vol-tmp_crypt /dev/mapper/vol-tmp /dev/urandom cipher=aes-xts-plain64,size=256,tmp,discard
and mounted via an fstab entry
/dev/mapper/vol-tmp_crypt /tmp ext2 defaults 0 2
At about every third boot /tmp is not mounted and then gnome-shell cannot start, because it is not allowed to write in not mounted /tmp directory. One or two restart are required to fix this problem.
###############
Independent of the success of the boot process, the log message related to the problem seem to be:
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found ordering cycle on systemd-cryptsetup at vol\x2dtmp_crypt.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Job systemd-cryptsetup at vol\x2dtmp_crypt.service/start deleted to break ordering cyc>
Aug 17 07:11:02 hostname systemd[1]: Unnecessary job for /dev/mapper/vol-tmp was removed.
[...]
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found ordering cycle on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on systemd-cryptsetup at vol\x2dtmp_crypt.>
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Job systemd-random-seed.service/start deleted to break or>
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found ordering cycle on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Found dependency on systemd-cryptsetup at vol\x2dtmp_crypt.>
Aug 17 07:11:02 hostname systemd[1]: systemd-cryptsetup at vol\x2dtmp_crypt.service: Job cryptsetup.target/start deleted to break ordering cyc>
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found ordering cycle on systemd-cryptsetup at vol\x2dtmp_crypt.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on systemd-random-seed.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-mount.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on zfs-import-cache.service/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Found dependency on cryptsetup.target/start
Aug 17 07:11:02 hostname systemd[1]: cryptsetup.target: Job systemd-cryptsetup at vol\x2dtmp_crypt.service/start deleted to break ordering cyc>
###############
Only in a unsuccessful boot up i see:
Aug 17 07:11:02 hostname systemd[1]: Reached target Block Device Preparation for /dev/mapper/vol-tmp_crypt.
Aug 17 07:11:02 hostname systemd[1]: Stopped target Block Device Preparation for /dev/mapper/vol-tmp_crypt.
[...]
Aug 17 07:11:17 hostname gnome-shell[3387]: failed to create lock file /tmp/.X1071-lock: Permission denied
Aug 17 07:11:17 hostname gnome-shell[3387]: failed to create lock file /tmp/.X1072-lock: Permission denied
Aug 17 07:11:17 hostname gnome-shell[3387]: failed to create lock file /tmp/.X1073-lock: Permission denied
Aug 17 07:11:17 hostname gnome-shell[3387]: Failed to create an X lock file
Aug 17 07:11:17 hostname gnome-shell[3387]: Failed to start X Wayland
###############
I am running an up-to-date 20.04 on amd64
with uname -a:
Linux hostname 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
and systemd --version:
systemd 245 (245.4-4ubuntu3.2)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1891858/+subscriptions
More information about the foundations-bugs
mailing list