xAppSoftware

the Blog

Ramlog-x

Ramlog was developed by tremende dot com.

I used it for a while with success, but some weeks ago the tremende web site went down, so with Alfredo we decided to make a fork .

 

Take a look at Two tricks to make your Raspberry Pi more reliable to understand why I use it.

 

Soon we will publish the github reference to download ramlog, in the meanwhile you can download it from here.

Ramlog act as a system daemon. On startup it creates ramdisk, it copies files from /var/log into ramdisk and mounts ramdisk as  /var/log.   All logs  after that will be updated on ramdisk. Logs on harddrive are kept in folder /var/log.hdd which is updated when  ramlog  is  restarted  or stopped.   On  shutdown it saves log files back to harddisk so logs are consistent.  Ramlog 2.x is using tmpfs by  default,  ramfs  and  kernel ramdisk  are  suppored as well.  Program rsync is used for log synchronization.
Note: Logs not saved to harddrive are lost in case of power  outage  or kernel panic.

Install  ramlog  if you have enough of free memory and you want to keep your logs on ramdisk. It is good for notebook users, for  systems  with UPS or for systems running from flash – to save some write cycles.

How it works and what it does:

  1. Ramlog starts among the first daemons (it depends on other daemons you have installed).
  2. Directory /var/log.hdd is created and hardlinked to /var/log.
  3. In case tmpfs (default) or ramfs is used, it is mounted over  /var/log
  4. If kernel ramdisk is used, ramdisk created in  /dev/ram9  and it is  mounted to /var/log, by default ramlog takes all ramdisk memory specified by kernel argument "ramdisk_size".
  5. All other daemons are started and all  logs  are  updated  in ramdisk. Logrotate works on ramdisk as well.
  6. In  case  ramlog  is restarted (by default it is one time per day), directory /var/log.hdd is  synchronized  with  /var/log using rsync. Frequency of the automatic log saves can be controller via cron, by default, the ramlog file is placed  into /etc/cron.daily
  7. On shutdown ramlog shuts among the last daemons.
  8. During ramlog stop phase files from /var/log.hdd are synchronized with /var/log, then /var/log is unmounted, /var/log.hdd is unmounted as well and empty directory /var/log.hdd is deleted.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.