14

I am running a FC18 machine on which I am testing a piece of software (smf-sav, a milter) keeping part of its working files under /var/run/smf-sav/.

That directory keeps disappearing after reboots. Hence the question: what is removing it? Is there a way to mark it permanent?

MadHatter
  • 79,770
  • 20
  • 184
  • 232
Alien Life Form
  • 2,309
  • 2
  • 21
  • 32
  • Can you paste the output of `df -k` on that machine into your question? – MadHatter Oct 18 '13 at 11:30
  • 1
    If you software is keeping part in /var/run subdirectory, then repair your system. /var/run is supposed to be clear, period. Refer to http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#VARRUNRUNTIMEVARIABLEDATA – jirib Oct 18 '13 at 11:40
  • The software is by no means "mine". Also keeping sockets under /var/run//milter-name.sock appears to be somewhat of a standard for milters (see clmav-milter, spamass-milter, etc.) I just noticed their lates startup scripts recreate the dir at boot time. – Alien Life Form Oct 18 '13 at 13:16

2 Answers2

16

The software should define what directories it needs in /run (which replaced /var/run in Fedora 15) by placing a configuration file in /usr/lib/tmpfiles.d. During the boot process, systemd-tmpfiles populates /run based on that confguration.

sciurus
  • 12,678
  • 2
  • 31
  • 49
14

/var/run is usually mounted as tmpfs, which is a partition mapped into your RAM. Obviously RAM gets cleared on reboot, so do all tmpfs file systems.

http://fedoraproject.org/wiki/Features/var-run-tmpfs

You should consider storing your application data on a persistent file system e.g. mounted on a hard disk.

Pavel
  • 1,038
  • 1
  • 11
  • 30
  • The app is not mine. Also keeping sockets under /var/run//milter-name.sock appears to be somewhat of a standard for milters (see clmav-milter, spamass-milter, etc.) I just noticed their latest startup scripts recreate the dir at boot time. – Alien Life Form Oct 18 '13 at 13:17