On my Fedora 20, I find that the system automatically clean up file under /tmp/. This is convenient. However, it cause some problems for some programs.
在我的Fedora 20上,我发现系统会自动清理/ tmp /下的文件。 这很方便。 但是,它对某些程序造成一些问题。
For example, HDFS puts its DataNode pid file under /tmp/ by default like hadoop-hadoop-datanode.pid
. After it is cleaned up, the hadoop-daemon.sh
script will consider there is no DataNode running.
例如,HDFS默认将其DataNode pid文件放在/ tmp /下,就像hadoop -hadoop-datanode.pid
。 清理之后, hadoop-daemon.sh
脚本将认为没有DataNode正在运行。
How to make Fedora Linux not clean some files in /tmp/?
如何使Fedora Linux不清除/ tmp /中的某些文件 ?
systemd has a systemd-tmpfiles tool that creates, deletes and cleans up volatile and temporary files and directories.
systemd具有systemd-tmpfiles工具 ,该工具可以创建,删除和清除易失性和临时文件和目录。
You can control the behavior of the systemd-tmpfiles by configuring its configuration file located at
您可以通过配置位于以下位置的配置文件来控制systemd-tmpfiles的行为:
/usr/lib/tmpfiles.d/tmp.conf
Check the tmpfiles.d for the format of configuration.
检查tmpfiles.d以获取配置格式。
For the purpose of excluding *.pid files, you can add one line as follows
为了排除* .pid文件,可以如下添加一行
x /tmp/*.pid
翻译自: https://www.systutorials.com/how-to-make-fedora-linux-not-clean-some-files-in-tmp/