Ramlog runs as a system daemon. When the system starts it creates a virtual disk (ramdisk), copy the file / var / log down to the virtual disk while the virtual disk is mounted as / var / log. Then all the logs will be updated to the virtual disk. When ramlog restart or stop, you need to log on the hard disk recording will remain in the directory /var/log.hdd. The shutdown time, the log files will be re-saved (ramdisk on) to the hard disk, in order to ensure consistency log. Ramlog 2.x default tmpfs file system, but it can also support ramfs kernel and ramdisk. Use rsync (Annotation: Linux mirror data backup tool) tool to synchronize logs.
Note: If a sudden power outage or kernel crash (kernel panic), the log is not saved into the hard disk will be lost.
If you have enough memory available, but want to log into the virtual disk on the installation ramlog it. It is a notebook users, with a good selection of the UPS system or the system run directly in the flash, you can save time to write the log.
Ramlog operational mechanism and the steps are as follows:
Ramlog by the first daemon (depending on the other daemons you have installed) to start.
Then create a directory /var/log.hdd and hard segments to / var / log.
If you are using tmpfs (the default) or ramfs file system, mount it to the / var / log.
If you are using kernel ramdisk, ramdisk is created in the / dev / ram9 in and mount it to / var / log. By default ramlog occupy all ramdisk memory, the size specified by the kernel parameters "ramdisk_size".
Then the other daemon is started, and the update log in a ramdisk. Logrotate (Annotation: Linux log rotation tool) and ramdisk with the also very good.
Restart (default once a day) ramlog, the directory will /var/log.hdd With rsync and / var / log to keep pace. The frequency of the log is automatically saved by cron: to control (Annotation Linux routine job scheduling). By default, ramlog scheduling tasks placed in the directory /etc/cron.daily.
When the system is shut down, ramlog before the last daemon shut off.
During ramlog closed, / var / log.hdd the files will be synchronized to / var / log, then / var / log and /var/log.hdd are unloaded, and then delete the empty directory /var/log.hdd.
Note: - This article is only for advanced users
Ramlog installed in Ubuntu
We first need to use the following command to download a .deb package from here:
Download ramlog_2.0.0_all.deb installation package is complete, use the following command to install:
sudo dpkg -i ramlog_2.0.0_all.deb
This step will complete the installation, now you need to run the following command:
sudo update-rc.d ramlog start 22345. stop 99016.
Now, in order to update sysklogd initialization, so that it can stop ramlog before running properly closed:
sudo update-rc.d -f sysklogd remove
sudo update-rc.d sysklogd start 102345. stop 90016.
Then reboot the system:
System restart, run 'ramlog getlogsize' space to get your current / var / log in. On this basis, more than 40% of the allocated space, ramdisk to ensure that there is enough space (space as a whole will be the size of the ramdisk).
Editing boot configuration files, such as /etc/grub.conf,,/boot/grub/menu.lst or /etc/lilo.conf (Annotation: Which specific profile depending on the boot loader may be) to your current kernel new option 'ramdisk_size = xxx', where xxx is the size of the space ramdisk.
Deb-based systems, Ramlog configuration file located in / etc / default / ramlog, you can set the following variables in the configuration file:
RAMDISKTYPE = 0
# 0 - tmpfs (can be swapped out to the swap partition) - Default
# 1 - ramfs (old kernel can not set the maximum size of the space,
# Can not be swapped to the swap partition, and SELinux is not compatible)
# 2 - Vintage kernel ramdisk
# Maximum memory size can be used for the tmpfs or ramfs
# This value may be a percentage or value (in Mb), for example:
# TMPFS_RAMFS_SIZE = 40%
# TMPFS_RAMFS_SIZE = 100m
# The null value indicates that 50% of the size of the tmpfs / ramfs is the total amount of memory
# More options refer to 'man mount' in 'Mount options for tmpfs' a
# (Added in newer kernels, ramfs support the size limit,
# Although the man said no such mount option)
# This option is only for RAMDISKTYPE = 0 or 1
KERNEL_RAMDISK_SIZE = MAX
# In kb Specifies kernel ramdisk size, or use MAX to use the entire ramdisk.
# This option is only for RAMDISKTYPE = 2 Shi
LOGGING = 1
# 0 = off, 1 = on. Record their logs to / var / log / ramdisk
LOGNAME = ramlog
# Own log file name (for LOGGING = 1 Shi)
VERBOSE = 1
Calls teststartstop will detail when # 0 = off, 1 = on (set to 1, failed to start or stop
# Written to the log)
Uninstall ramlog in Ubuntu
Open a terminal, run the following command:
sudo dpkg -P ramlog
Note: If you are still running before you uninstall ramlog need to reboot the system to complete the uninstallation job.