[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to stop reboot from delete'n directory



On Wed, Jul 01, 2020 at 02:33:07PM +0200, grumpy@mailfence.com wrote:
> i create a directory /run/foo to hold sockets for my application
> when i reboot the directory gets deleted
> is set'n the immutable flag the way to go

unicorn:~$ df /run
Filesystem     1K-blocks  Used Available Use% Mounted on
tmpfs            1219016 48132   1170884   4% /run

See where it says "tmpfs"?  The /run file system is entirely ephemeral,
existing only in memory while the system is running.

If you want to re-create something in /run at boot time, you'll need to
set up a task to do so, either by creating a systemd unit, or perhaps by
using rc.local (since this is a ridiculously small and simple one-shot
task, where a whole systemd unit would be overkill, rc.local is fine).

Or, if you prefer, you could add "create the directory in /run" to
your application's start-up code.


Reply to: