• /var/run disappear after reboot

    From coreyh@free.fr@21:1/5 to All on Mon Jul 22 14:10:02 2024
    I found that after I rebooted the system, the dir /var/run/***
    disappeared.
    I put my app's web sessions under /var/run. so they got lost.
    Is there an effective tool to manage /var/run dirs?

    Thank you

    --
    corey hickman

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Henning Follmann@21:1/5 to All on Mon Jul 22 14:30:02 2024
    On Jul 22, 2024, at 08:08, coreyh@free.fr wrote:

    I found that after I rebooted the system, the dir /var/run/*** disappeared.


    Yes,
    /var/run
    is a symlink to /run
    And /run is a tmpfs

    I put my app's web sessions under /var/run. so they got lost.

    Well that was a bad idea if you wanted to have persistent session ids.

    Is there an effective tool to manage /var/run dirs?

    Thank you

    --
    corey hickman


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Mon Jul 22 14:30:02 2024
    Greg Wooledge (12024-07-22):
    The contents of /run (which /var/run points to) are temporary.

    And even before /var/run was a link to /run, it was meant to be cleaned
    at boot.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to coreyh@free.fr on Mon Jul 22 14:20:01 2024
    On Mon, Jul 22, 2024 at 20:07:38 +0800, coreyh@free.fr wrote:
    I found that after I rebooted the system, the dir /var/run/*** disappeared.
    I put my app's web sessions under /var/run. so they got lost.
    Is there an effective tool to manage /var/run dirs?

    hobbit:~$ ls -ld /var/run
    lrwxrwxrwx 1 root root 4 Feb 17 12:28 /var/run -> /run/

    hobbit:~$ df /run
    Filesystem 1K-blocks Used Available Use% Mounted on
    tmpfs 1603720 1412 1602308 1% /run

    The contents of /run (which /var/run points to) are temporary.
    They're only stored in RAM, not on disk. They are *meant* to go away
    at boot time.

    If you need to store data permanently, put it somewhere else.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From George at Clug@21:1/5 to All on Mon Jul 22 14:50:02 2024
    On Monday, 22-07-2024 at 22:15 Henning Follmann wrote:


    On Jul 22, 2024, at 08:08, coreyh@free.fr wrote:

    I found that after I rebooted the system, the dir /var/run/*** disappeared.


    Yes,
    /var/run
    is a symlink to /run
    And /run is a tmpfs

    I put my app's web sessions under /var/run. so they got lost.

    Well that was a bad idea if you wanted to have persistent session ids.

    Would it be appropriate to use the /opt directory?

    https://eitca.org/cybersecurity/eitc-is-lsa-linux-system-administration/linux-filesystem/filesystem-layout-continued/examination-review-filesystem-layout-continued/what-is-the-significance-of-the-opt-directory-in-the-linux-filesystem-layout/

    To summarize, the "/opt" directory holds significant importance in the Linux filesystem layout. It provides a designated location for optional software installations, separating them from the core operating system components. This separation enhances
    system management, security, and integrity.

    https://linuxhandbook.com/linux-directory-structure/
    /opt – Optional software
    Traditionally, the /opt directory is used for installing/storing the files of third-party applications that are not available from the distribution’s repository.
    The normal practice is to keep the software code in opt and then link the binary file in the /bin directory so that all the users can run it.



    Is there an effective tool to manage /var/run dirs?



    Thank you

    --
    corey hickman




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Mon Jul 22 15:10:02 2024
    George at Clug (12024-07-22):
    Would it be appropriate to use the /opt directory?

    No. If it is VARiable, then it should go under /var. /var/lib/somehting
    is traditional, /var/opt/something is an option if you installed under /opt/something.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Charles Curley@21:1/5 to coreyh@free.fr on Mon Jul 22 16:20:01 2024
    On Mon, 22 Jul 2024 20:07:38 +0800
    coreyh@free.fr wrote:

    I found that after I rebooted the system, the dir /var/run/***
    disappeared.

    As others have pointed out, stuff in /var/run is supposed to disappear
    on reboot.

    I put my app's web sessions under /var/run. so they got lost.
    Is there an effective tool to manage /var/run dirs?

    Given the above, a more fruitful question might be, where should I put
    my session data? To which I would reply, what's wrong with where your
    web server put them before you changed it?


    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From coreyh@free.fr@21:1/5 to All on Mon Jul 22 22:00:02 2024
    For coreyh, here is the link to Linux Filesystem Hierarchy, v3: <https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf>. And here
    is Wikipedia's page digesting it: <https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard>. The
    documents discuss where various bits should go, including 11 pieces
    for various /var locations.


    Thanks for all your help. Now it make sense to me.

    --
    corey hickman

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)