[File] stratified / var / run

/ Var / run is used to do

(FHS) is defined according to the standard file system hierarchy of linux:

  • / Var / run directory is stored since the system startup describe system information file.
  • The more common use is to save their own daemon process pid into this directory.
  • This standard requires a file folder must be emptied at system boot time, in order to create a new file.

To meet this requirement, linux in / var / run using tmpfs file system, which is a temporary file system is stored in memory when the machine is closed, the file system is cleared naturally. Use the command df -Th can see similar output:

[root@test2 dbdata]# df -Th /var/run
Filesystem Type Size Used Avail Use% Mounted on
tmpfs tmpfs 2.0G 9.0M 2.0G 1% /run

  

Of course, / var / run in addition to the preservation process pid also have other effects, such as utmp file is used to record the machine's start-up time as well as the currently logged in user.

Why use / run instead of / dev

This is because the / var / run file system is not a system that is ready to start, and before this process has been started on their first run information is stored in / dev, / dev is also a tmpfs, and is in a system you can start with. But the / dev intention is to design storage device file, rather than to save the process runtime information, so as not to cause confusion, / dev process information stored in files with "." Start naming, that is, are hidden folder. But even so, as more and more number of folders, / dev which is more and more confusion, someone finally sit still, so the introduction of the alternative, which is / var / run.

Use / var / run What are the benefits

Mainly to solve the top say management is inconsistent, and finally to the releases unified management. Eventually / var / run and / var / lock are merged into / run in. And the do not use this trick hidden folders, and a lot easier for administrators. Also in / dev will not be irrelevant content.

 
Transfer: https: //blog.csdn.net/ibsfn/article/details/82010943 

Guess you like

Origin www.cnblogs.com/itplay/p/11094646.html