在 Centos 7 上快速运行 Chromium
Name Version Rev Tracking Publisher Notes
chromium 80.0.3987.100 1026 stable canonical✓ -
记录错误:
/snap/chromium/1026/bin/desktop-launch:第 366 行:无法为此处文档创建临时文件:没有此文件或目录
运行 strace(sudo strace -u user /var/lib/snapd/snap/bin/chromium)显示 snap 检查 /tmp 上的权限,但无法创建目录 /tmp/sh-thd.dmraw1。
stat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=0, ...}) = 0
faccessat(AT_FDCWD, "/tmp", W_OK) = 0
statfs("/tmp", {f_type=EXT2_SUPER_MAGIC, f_bsize=4096, f_blocks=9778311, f_bfree=7162501, f_bavail=6660025, f_files=2493680, f_ffree=2256716, f_fsid={1298697036, 141663547}, f_namelen=255, f_frsize=4096, f_flags=ST_VALID|ST_RELATIME}) = 0
getpid() = 32094
openat(AT_FDCWD, "/tmp/sh-thd.dmraw1", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 ENOENT (No such file or directory)
fstat(2, {st_mode=S_IFREG|0664, st_size=2241070, ...}) = 0
write(2, "/snap/chromium/1026/bin/desktop-"..., 119/snap/chromium/1026/bin/desktop-launch: line 366: cannot create temp file for here-document: No such file or directory
/tmp 上的权限似乎正常(设置为 1777),我们有足够的空间和 inode。
drwxrwxrwt 450 root root 9680 Feb 19 15:07 /tmp
Filesystem Size Used Avail Use% Mounted on
tmpfs 10G 280M 9.8G 3% /tmp
Filesystem Inodes IUsed IFree IUse% Mounted on
tmpfs 16116906 13829 16103077 1% /tmp
我怀疑 Chromium 子进程无法共享 /tmp 中的文件,这在 snap 隔离中是正常现象。有人见过这种情况吗?
答案1
这是由双重安装的 /tmp 文件系统引起的;在同一位置两次安装 /tmp 后,权限似乎设置为全世界可写,但操作系统遵守底层 /tmp 文件系统的只读权限。