Git Product home page Git Product logo

Comments (8)

StuartIanNaylor avatar StuartIanNaylor commented on May 29, 2024

The Reloading Log2Ram isn't really necessary as its debatable on a complete crash if anything up to an hour is lost then what use is the hour preceeding.
You can use the service reload function at anytime to sync to persistent bind directory.

So remove the cron job as that is all its doing and really Reloading Log2Ram means it is working.

[Service]
Type=oneshot
ExecStart= /usr/local/bin/log2ram start
ExecStop= /usr/local/bin/log2ram stop
ExecReload= /usr/local/bin/log2ram write

log2ram.hourly

#!/usr/bin/env sh

systemctl reload log2ram

from log2ram.

Barabba11 avatar Barabba11 commented on May 29, 2024

thank you for your kind reply and support! I?m not a linux expert so I'm trying to figure out correctly what you wrote..
the main question was about the fule syslog which keeps writing on the SD, and I expected to be sync only after reload, why?
Maybe log2ram is logging on RAM some logs but not all the log folder?
About reloading I'm fine with that, as well as lose the last hour of activity. Thank you

from log2ram.

StuartIanNaylor avatar StuartIanNaylor commented on May 29, 2024

Apols basically what log2ram does because you can not mount zram ontop of an existing directory.

Firstly it creates a bind mount so that /var/log can be moved elsewhere then you can create a /var/log in zram, but its empty.
So it copies all from the original /var/log now at a bind mount on start.
zram is completely volatile and non persistent and log2ram writes via a cron job every hour to update any changes and also on stop.

I sort of agree the hourly write is sort of pointless in terms of SD write so in /etc/cron.hourly delete the log2ram entry and no more hourly writes but sync will still happen on start or stop.

There are a few things with the service and method of log2ram that IMHO are mweh.
Have a look at https://github.com/StuartIanNaylor/zram-config as it sound like it might suit your needs better,

from log2ram.

Barabba11 avatar Barabba11 commented on May 29, 2024

sorry maybe I expressed myself wrongly, I'm fine with hourly writes on sd, I don't want to chenage them.
The problem is that the file var/log/syslog is keep written when an event is coming, I don't need to wait one hour to see the entry, I open anytime the file and see the new entries like before.
If you said that the entirely log folder is created on ram and updated only there, I don't know how this is possible.
I hope you understood my point, thanks for help!

from log2ram.

azlux avatar azlux commented on May 29, 2024

Hi
It's because with log2ram, the folder /var/log is a RAM folder (tmpfs to be exact).

The syslog system don't care I have change the type of this folder and continue to write all log as a simple directory.

Hope it help.
Az

from log2ram.

Barabba11 avatar Barabba11 commented on May 29, 2024

so if I understood right the path /var/log is now on RAM, and how and where can I see the real var/log on the sd?
thank you

from log2ram.

azlux avatar azlux commented on May 29, 2024

The data on Disk is on /var/hdd.log/

from log2ram.

Barabba11 avatar Barabba11 commented on May 29, 2024

very interesting, perfect! thanks

from log2ram.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.