How to make Fedora Linux not clean some files in /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.

For example, HDFS puts its DataNode pid file under /tmp/ by default like After it is cleaned up, the script will consider there is no DataNode running.

How to make Fedora Linux not clean some files in /tmp/?

asked May 15, 2015 by Eric Z Ma (44,280 points)

1 Answer

Best answer

systemd has a systemd-tmpfiles tool that creates, deletes and cleans up volatile and temporary files and directories.

You can control the behavior of the systemd-tmpfiles by configuring its configuration file located at


Check the tmpfiles.d for the format of configuration.

For the purpose of excluding *.pid files, you can add one line as follows

x /tmp/*.pid
answered May 21, 2015 by Eric Z Ma (44,280 points)
How to manually kill HDFS DataNodes? asked Dec 6, 2015 by anonymous

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost