Re: question on /var/run
On Thu, Mar 16, 2023 at 02:02:35AM +0800, coreyh@free.fr wrote:
> I am having the question that why the dir I created in /var/run disappears
> after rebooting the system? how to prevent that?
unicorn:~$ ls -ld /var/run
lrwxrwxrwx 1 root root 4 Jan 11 2018 /var/run -> /run/
unicorn:~$ df /run
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 1215596 1928 1213668 1% /run
Because /var/run is a symlink to /run which is a transient, in-memory
file system not backed by permanent storage.
This is intentional. All of the stuff in /run is meant to be discarded
upon shutdown or reboot.
If you want something to appear there the next time the computer is
booted, you need to set up an event to occur at boot time to create
it. This could be a systemd unit, an entry in rc.local, a crontab job
with @reboot, etc.
If you tell us what you want to happen at boot time, we might be able
to give more specific advice.
Reply to: