AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[tmp](ubuntu)

Martin Hope
Tomas Greif
Asked: 2024-04-30 15:53:51 +0800 CST

Appimage - 找到 SUID 沙箱帮助程序二进制文件,但配置不正确

  • 5

升级到 24.04 后,我收到“已找到 SUID 沙盒帮助程序二进制文件,但配置不正确”。当我尝试运行 AppImage 文件时出现消息。整个错误如下所示(黑曜石应用程序的示例):

./Obsidian-1.4.13.AppImage 
[21824:0430/094557.661436:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/.mount_ObsidiOpBPaM/chrome-sandbox is owned by root and has mode 4755.
Trace/breakpoint trap (core dumped)

我不确定它在要求什么,它/tmp/.mount_ObsidiOpBPaM/chrome-sandbox不存在。权限/tmp设置为 4777,所有者为 root。

如何再次运行该应用程序?

tmp
  • 2 个回答
  • 416 Views
Martin Hope
Elias Estatistics
Asked: 2022-04-14 16:27:06 +0800 CST

更改 sudo / root 命令的 tmp 文件夹

  • 0

更改 sudo / root 命令的 tmp 文件夹

在 .bashrc 文件中添加

export TMP=/new/tmp
export TEMP=/new/tmp
export TMPDIR=/new/tmp

还为 /tmp 创建了指向新位置的符号链接

我在没有 sudo 的情况下运行的应用程序会在新位置创建临时文件。但是,没有一个 sudo 程序在那里创建它们的临时文件。

权限 1777 根:根。

我应该做什么?

我试过例如。TMP=/NEWTMP sudo app 但没有成功。

tmp
  • 1 个回答
  • 157 Views
Martin Hope
Vladimir Kalachikhin
Asked: 2020-11-11 08:46:59 +0800 CST

/tmp 有什么特别的吗?

  • 0

Ubuntu 18.04

/ 在 ext4 上

我通过 php 脚本在 /tmp 中创建一个文件。好的,我是通过猫看到的。但是另一个脚本上的 php file_exists() 返回 FALSE。

我通过相同的脚本在 /var/www 中创建了一个文件。是的!file_exists() 返回 TRUE。

发生了什么?

tmp php
  • 1 个回答
  • 271 Views
Martin Hope
mcandril
Asked: 2020-08-18 05:26:03 +0800 CST

incron 作业不写入临时目录

  • 1

我有一个非常奇怪的问题,我可能没有正确煮熟,但我尝试了一个最小的例子:

在 20.04 的 20.04 lxd 容器中,我正在尝试运行由 incron 触发的作业。对于我的最小示例,这是我的 incron 行:

/home/scanfiler/test    IN_CLOSE_WRITE  /home/scanfiler/test.sh &>> /tmp/log-scanfiler-test

这是我的测试脚本

#!/bin/bash
logger "Starting"
touch /tmp/test/test-$(date +%s)-1
touch ~/test_out/test-$(date +%s)-1
sleep 20
touch /tmp/test/test-$(date +%s)-2
touch ~/test_out/test-$(date +%s)-2
logger "Done"

我正在写入日志,然后在主文件夹中创建一个文件,在 tmp 文件夹中创建一个文件,然后等待 20 秒(这让我有时间在运行时检查,以防 tmp 以某种方式立即被清除),然后我正在写入更多文件。

这就是发生的事情:

scanfiler ~scanfiler # rm test/testblah && touch test/testblah
scanfiler ~scanfiler # journalctl -xe|tail
Aug 17 14:59:26 scanfiler incrond[2526]: PATH (/home/scanfiler/test) FILE (testblah) EVENT (IN_CLOSE_WRITE)
Aug 17 14:59:26 scanfiler incrond[2526]: (scanfiler) CMD (/home/scanfiler/test.sh &>> /tmp/log-scanfiler-test)
Aug 17 14:59:26 scanfiler scanfiler[1250558]: Starting
scanfiler ~scanfiler # 
scanfiler ~scanfiler # ls /tmp/test 
scanfiler ~scanfiler # ls test_out 
test-1597669166-1
scanfiler ~scanfiler # journalctl -xe|tail
Aug 17 14:59:26 scanfiler incrond[2526]: PATH (/home/scanfiler/test) FILE (testblah) EVENT (IN_CLOSE_WRITE)
Aug 17 14:59:26 scanfiler incrond[2526]: (scanfiler) CMD (/home/scanfiler/test.sh &>> /tmp/log-scanfiler-test)
Aug 17 14:59:26 scanfiler scanfiler[1250558]: Starting
scanfiler ~scanfiler # journalctl -xe|tail
Aug 17 14:59:26 scanfiler incrond[2526]: PATH (/home/scanfiler/test) FILE (testblah) EVENT (IN_CLOSE_WRITE)
Aug 17 14:59:26 scanfiler incrond[2526]: (scanfiler) CMD (/home/scanfiler/test.sh &>> /tmp/log-scanfiler-test)
Aug 17 14:59:26 scanfiler scanfiler[1250558]: Starting
Aug 17 14:59:46 scanfiler scanfiler[1250627]: Done
scanfiler ~scanfiler # ls /tmp/test       
scanfiler ~scanfiler # ls test_out                                
test-1597669166-1  test-1597669186-2
scanfiler ~scanfiler # ls /tmp/log-scanfiler-test
ls: cannot access '/tmp/log-scanfiler-test': No such file or directory

如您所见,即使在运行时,也不会创建 tmp 文件,而主目录中的文件就在那里。最终,甚至应该在 tmp 中的日志文件都不存在。当由同一用户在控制台中运行时,一切正常,因此我的 tmp 权限可能不会以某种方式被破坏。

谁能告诉我这里发生了什么?我的脚本中有更多奇怪的问题(在控制台中运行时运行良好),但也许它们是相关的,所以我想先解决这个问题。

permissions tmp lxc lxd
  • 1 个回答
  • 139 Views
Martin Hope
N0rbert
Asked: 2020-08-02 10:00:32 +0800 CST

如何允许 snap 应用程序访问 /tmp 文件夹?

  • 14

通常我会避免使用基于 snap 的应用程序,但有时我需要它们。

例如 - Markdown Lint Tool 仅以 Snap 命名 mdl。

当文件在主文件夹中时它工作得很好 -

$ echo "# header" > ~/test.md
$ /snap/bin/mdl ~/test.md ; echo $?
0

但是当文件位于/tmp目录中时它会失败:

$ echo "# header" > /tmp/test.md
$ cat /tmp/test.md
# header
$ /snap/bin/mdl /tmp/test.md
/snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl/doc.rb:57:in `read': No such file or directory @ rb_sysopen - /tmp/test.md (Errno::ENOENT)
    from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl/doc.rb:57:in `new_from_file'
    from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:75:in `block in run'
    from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:73:in `each'
    from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/lib/mdl.rb:73:in `run'
    from /snap/mdl/140/lib/ruby/gems/2.4.0/gems/mdl-0.9.0/bin/mdl:10:in `<top (required)>'
    from /snap/mdl/140/bin/mdl:23:in `load'
    from /snap/mdl/140/bin/mdl:23:in `<main>'

对于此特定应用程序,没有以下选项snap connect:

$ snap connections | grep mdl
home                      mdl:home                             :home                                 -

我也不能将它安装为经典:

$ snap install mdl --classic 
Warning: flag --classic ignored for strictly confined snap mdl

mdl 0.9.0 from Snapcrafters installed

我应该怎么做才能让 Snap 应用程序完全访问该/tmp文件夹?
它是由 Snap 设计发生的吗?

permissions tmp tmpfs snap
  • 2 个回答
  • 4005 Views
Martin Hope
Stonecraft
Asked: 2020-06-17 23:03:11 +0800 CST

fstab 中 tmpfs 的 `size` 参数是否不起作用?

  • 3

我很困惑我的 /tmp 使用 tmpfs 是否尊重size我给它的参数/etc/fstab:

我的 fstab 条目现在显示为:

root_pool/var/tmp  /tmp /var/tmp zfs rw,nodev,nosuid 0 0
tmpfs /tmp tmpfs rw,nodev,nosuid,noexec,nr_inodes=5k,size=2G,mode=1777 0 0
tmpfs /dev/shm tmpfs   defaults,nodev,nosuid,nr_inodes=5k,mode=700,size=4G 0 0

但是根据 du 的说法,它使用了我一半的内存(我理解这是默认值)而不是我打算分配给它的大小。

 ~ df /tmp
Filesystem     1K-blocks  Used Available Use% Mounted on
tmpfs           65921428     0  65921428   0% /tmp

那么size参数根本没有任何影响吗?我正在使用 Ubuntu 20.04

编辑我可以手动安装它

sudo mount -oremount,size=4G /tmp

当我这样做时,这/tmp是预期的 20.04 GB。

编辑:系统状态:

● tmp.mount - Temporary Directory (/tmp)
     Loaded: loaded (/etc/systemd/system/tmp.mount; enabled; vendor preset: enabled)
     Active: active (mounted) since Wed 2020-06-17 13:30:35 EDT; 8min ago
      Where: /tmp
       What: tmpfs
       Docs: https://systemd.io/TEMPORARY_DIRECTORIES
             man:file-hierarchy(7)
             https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
      Tasks: 0 (limit: 154317)
     Memory: 76.0K
     CGroup: /system.slice/tmp.mount

Jun 17 13:30:35 virtland systemd[1]: Mounting Temporary Directory (/tmp)...
Jun 17 13:30:35 virtland systemd[1]: Mounted Temporary Directory (/tmp).

和journalctl -u tmp.mount

-- Reboot --
Jun 17 13:27:50 virtland systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting an>
Jun 17 13:27:50 virtland systemd[1]: Mounting Temporary Directory (/tmp)...
Jun 17 13:27:50 virtland systemd[1]: Mounted Temporary Directory (/tmp).
Jun 17 13:29:43 virtland systemd[1]: Unmounting Temporary Directory (/tmp)...
Jun 17 13:29:43 virtland systemd[1]: tmp.mount: Succeeded.
Jun 17 13:29:43 virtland systemd[1]: Unmounted Temporary Directory (/tmp).
-- Reboot --
Jun 17 13:30:35 virtland systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting an>
Jun 17 13:30:35 virtland systemd[1]: Mounting Temporary Directory (/tmp)...
Jun 17 13:30:35 virtland systemd[1]: Mounted Temporary Directory (/tmp).

Edit2:设置 tmpfs 的大小/dev/shm按预期工作:

# in fstab
tmpfs /dev/shm tmpfs   defaults,nodev,nosuid,nr_inodes=5k,mode=700,size=4G 0 0
tmpfs                                  13184288       2328   13181960   1% /run
tmpfs                                   4194304      41056    4153248   1% /dev/shm
tmpfs                                      5120          4       5116   1% /run/lock
tmpfs                                  65921432          0   65921432   0% /sys/fs/cgroup
tmpfs                                  65921432          0   65921432   0% /tmp
tmpfs                                  13184284          8   13184276   1% /run/user/1000

此外,尽管许多安全指南推荐使用 noexec 选项,但似乎存在问题,因为某些程序(包括 apt)需要从 /tmp 执行。我知道这可以解决,但我不想找出每个需要例外的程序。

fstab mount tmp tmpfs shm
  • 1 个回答
  • 2676 Views
Martin Hope
mikanim
Asked: 2020-06-03 22:38:50 +0800 CST

如何删除 /tmp/ 分区并将其保存在 RAM 中?

  • 0

我在 / /home /root /var 和 /boot 的分区旁边创建了 /tmp 分区。对 tmp/ 进行分区是错误的。有没有办法让 tmp/ 使用 RAM 而不是我在 SSD 上创建的指定空间?

tmp ram
  • 1 个回答
  • 344 Views
Martin Hope
Joel Deleep
Asked: 2020-04-06 01:41:56 +0800 CST

磁盘已满但找不到大文件

  • 0

我正在运行一个 bash 脚本,它在 tmp 目录中创建了一个 14G 的文件,我删除了它仍然找不到很大的目录或文件。

我的 df -h 输出


Filesystem      Size  Used Avail Use% Mounted on
udev            474M     0  474M   0% /dev
tmpfs            99M   11M   88M  11% /run
/dev/vda1        25G   25G     0 100% /
tmpfs           491M     0  491M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           491M     0  491M   0% /sys/fs/cgroup
/dev/vda15      105M  3.9M  101M   4% /boot/efi
/dev/loop0       90M   90M     0 100% /snap/core/7917
/dev/loop1       55M   55M     0 100% /snap/lxd/12211
/dev/loop2       94M   94M     0 100% /snap/core/8935
/dev/loop3       68M   68M     0 100% /snap/lxd/14194
tmpfs            99M     0   99M   0% /run/user/0
/dev/loop4       55M   55M     0 100% /snap/core18/1705
/dev/loop5       49M   49M     0 100% /snap/gtk-common-themes/1474
/dev/loop6      153M  153M     0 100% /snap/chromium/1071
tmpfs            99M     0   99M   0% /run/user/1000

我在 / 目录中的 du -sh 输出

du: cannot access './proc/19935/task/19935/fd/4': No such file or directory
du: cannot access './proc/19935/task/19935/fdinfo/4': No such file or directory
du: cannot access './proc/19935/fd/3': No such file or directory
du: cannot access './proc/19935/fdinfo/3': No such file or directory
4.7G    .

由于磁盘已满,我无法安装 ncdu 或任何其他工具,考虑到 du -sh 之后的汇总大小,剩余的空间在哪里,超出 25GB

我的 lsb 发布

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.10
DISTRIB_CODENAME=eoan
DISTRIB_DESCRIPTION="Ubuntu 19.10"

du -sh 的输出 /*/

119M    /bin/
97M /boot/
0   /dev/
5.9M    /etc/
212M    /home/
682M    /lib/
4.0K    /lib32/
4.0K    /lib64/
4.0K    /libx32/
16K /lost+found/
4.0K    /media/
4.0K    /mnt/
4.0K    /opt/
du: cannot access '/proc/20791/task/20791/fd/4': No such file or directory
du: cannot access '/proc/20791/task/20791/fdinfo/4': No such file or directory
du: cannot access '/proc/20791/fd/3': No such file or directory
du: cannot access '/proc/20791/fdinfo/3': No such file or directory
0   /proc/
72K /root/
11M /run/
30M /sbin/
1.9G    /snap/
4.0K    /srv/
0   /sys/
17M /tmp/
845M    /usr/
768M    /var/
bash tmp disk-usage 19.10
  • 2 个回答
  • 965 Views
Martin Hope
Ray Butterworth
Asked: 2019-07-28 11:54:56 +0800 CST

如何删除隐藏在 /tmp 挂载点下的文件?

  • 5

/tmp我最近通过将它添加到 /etc/fstab创建了一个 RAM :

tmpfs /tmp tmpfs rw,nosuid,nodev,noatime   0    0

一切正常,理论上系统现在运行得更快,但在启动时 /var/log/syslog 得到:

… tmp.mount: Directory /tmp to mount over is not empty, mounting anyway.

这种情况似乎是不可避免的,因为从来没有机会从 /tmp 的文件系统版本中删除文件。

浪费的空间是微不足道的,但作为一个有趣的问题,有没有简单的方法来清除隐藏在 /tmp 挂载点下的垃圾?

tmp mountpoint
  • 2 个回答
  • 1124 Views
Martin Hope
Adrian
Asked: 2019-04-03 08:43:39 +0800 CST

每秒在 tmp 目录中创建然后删除的文件

  • 13

我错误地注意到在 /tmp 目录中不断创建一些文件然后立即删除。使用一系列ls -l /tmp我设法捕获创建的文件:

-rw------- 1 root root       0 Apr  2 19:37  YlOmPA069G
-rw------- 1 root root       0 Apr  2 19:37  l74jZzbcs6

或另一个例子:

-rw------- 1 root root       0 Apr  2 19:44  AwVhWakvQ_
-rw------- 1 root root       0 Apr  2 19:44  RpRGl__cIM
-rw------- 1 root root       0 Apr  2 19:44  S0e72nkpBl
-rw------- 1 root root       0 Apr  2 19:44  emxIQQMSy2

这是关于带有 4.18.0-16-generic 的 Ubuntu 18.10。这是一个几乎全新的安装:我添加了一些服务器软件(nginx、mysql、php7.2-fpm),但即使关闭了这些软件,问题仍然存在。

创建的文件是什么,为什么?我将如何阻止这种行为?SSD上非常不受欢迎的

谢谢!

更新

问题是关于 RAM 中何时没有 /tmp (没有tmpfs)。
有罪的软件是x2goserver.service否则必须有一个。

tmp files
  • 5 个回答
  • 5262 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve