如何使Fedora Linux不清除/ tmp /中的某些文件?

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
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-make-fedora-linux-not-clean-some-files-in-tmp/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值