Page 1 of 1

Need to make sure contents of /dev/shm are restored on reboot - but it seems something is doing that automagically?

Posted: 2022-04-18 08:57
by gloomish
Hello to all,
I have been running a server for a while, and one software has always relied on a directory under /dev/shm to exist & be writable.
I noticed that the application fails when the directory doesn't exist or when it doesn't have permissions to access/create it. I can create such a situation easily.
However, I never noticed this to be an issue after a reboot.
Now I noticed that something is restoring the contents of /dev/shm after a reboot. It's very obvious because after the reboot they all have the same timestamps. I presume systemd is doing that, but there is no obvious dev-shm or tmpfile or tmpfs service.

How can I clarify what is doing that, so I can rest in peace about my crucial web app?

And yes, /dev/shm is a tmpfs.

Re: Need to make sure contents of /dev/shm are restored on reboot - but it seems something is doing that automagically?

Posted: 2022-07-28 09:37
by lindi
/dev/shm and others are created in https://sources.debian.org/src/elogind/ ... l=251#L239

If an application relies on a directory to always exist in /dev/shm then it really should create that directory itself if it is missing. You should probably open a bug upstream?