From 3e7185d21075062bf72db51ea40fd92a3fe63c30 Mon Sep 17 00:00:00 2001 From: Henri de Jong Date: Mon, 18 Dec 2017 18:23:23 +0000 Subject: [PATCH 1/2] Improved readability of the readme and comment in the config file --- README.md | 20 ++++++++++---------- log2ram.conf | 14 ++++++++------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b7a8bc8..422ecf9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Log2Ram Like ramlog for systemd (on debian 8 jessie for example). -Usefull for **Raspberry** for not writing all the time on the SD card. You need it because your SD card don't want to suffer anymore ! +Usefull for **RaspberryPi** for not writing on the SD card all the time. You need it because your SD card doesn't want to suffer anymore! The script [log2ram](https://github.com/azlux/log2ram) can work on every linux system. So you can use it with your own daemon manager if you don't have systemd. @@ -18,27 +18,27 @@ sudo ./install.sh ## Customize #### variables : -Into the file `/etc/log2ram.conf`, there are three variables : +In the file `/etc/log2ram.conf`, there are three variables: -- The first variable define the size the log folder will reserve into the RAM. -- The second variable can be set to `true` if you prefer "rsync" than "cp". I use the command `cp -u` and `rsync -X`, I don't copy the all folder every time for optimization. -- The last varibale disable the error system mail if there are no enought place on RAM (if set on false) +- `SIZE`: defines the size the log folder will reserve into the RAM. +- `USE_RSYNC`: Can be set to `true` if you prefer "rsync" rather than "cp". I use the command `cp -u` and `rsync -X`, I don't copy the all folder every time for optimization. +- `MAIL`: Disables the error system mail if there is not enough place on RAM (if set to `false`) #### refresh time: -The default is to write log into the HardDisk every hour. If you think this is too much, you can make the write every day by moving the cron file : `sudo mv /etc/cron.hourly/log2ram /etc/cron.daily/log2ram`. +By default Log2Ram writes to the HardDisk every hour. If you think this is too much, you can make the write every day by moving the cron file to daily: `sudo mv /etc/cron.hourly/log2ram /etc/cron.daily/log2ram`. -### It is working ? +### It is working? You can now check the mount folder in ram with (You will see lines with log2ram if working) ``` df -h mount ``` -If you have issue with apache2 , you can try to add `apache2.service` next to other services on the `Before` parameter into /etc/systemd/system/log2ram.service it will solve the pb +If you have issue with apache2, you can try to add `apache2.service` next to other services on the `Before` parameter in `/etc/systemd/system/log2ram.service` it will solve the pb -The log for log2ram will be write here : `/var/hdd.log/log2ram.log` +The log for log2ram will be written at: `/var/hdd.log/log2ram.log` -###### Now, muffins for everyone ! +###### Now, muffins for everyone! ## Uninstall :( diff --git a/log2ram.conf b/log2ram.conf index 1eb33f3..2636075 100644 --- a/log2ram.conf +++ b/log2ram.conf @@ -1,15 +1,17 @@ # Configuration file for Log2Ram (https://github.com/azlux/log2ram) under MIT license. # This configuration file is read by the log2ram service -# Size for the ram folder, it's define the size the log folder will reserve into the RAM. If it's not enough, log2ram will not be able to use ram. Check you /var/log size folder. The default is 40M and is basically enough for a lot of application. You will need to increase it if you have a server and a lot of log for example. +# Size for the ram folder, it defines the size the log folder will reserve into the RAM. +# If it's not enough, log2ram will not be able to use ram. Check you /var/log size folder. +# The default is 40M and is basically enough for a lot of applications. +# You will need to increase it if you have a server and a lot of log for example. SIZE=40M -# This variable can be set to true if you prefer "rsync" than "cp". I use the command cp -u and rsync -X, so I don't copy the all folder every time for optimization. +# This variable can be set to true if you prefer "rsync" rather than "cp". +# I use the command cp -u and rsync -X, so I don't copy the all folder every time for optimization. # You can choose which one you want. Be sure rsync is installed if you use it. - USE_RSYNC=false -# If there are some error with available RAM space, a system mail will be send -# Change it to false, and you will have only log if there are no place on RAM anymore. - +# If there are some errors with available RAM space, a system mail will be send +# Change it to false and you will have only a log if there is no place on RAM anymore. MAIL=true \ No newline at end of file From 737ffd1c194b2849fdc4ac06b09b27ba88b849d3 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Wed, 20 Dec 2017 22:41:45 +0100 Subject: [PATCH 2/2] install: Fixing code typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The last bracket shall not be glued to the directory. The actual code is generating a runtime error like the following : erwan@raspberrypi:~/download/log2ram $ sudo ./install.sh Created symlink /etc/systemd/system/sysinit.target.wants/log2ram.service → /etc/systemd/system/log2ram.service. ./install.sh: 19: [: missing ] ##### Reboot to activate log2ram ##### This patch simply adds the missing space to make this script work. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 32ce69d..f72b119 100644 --- a/install.sh +++ b/install.sh @@ -16,7 +16,7 @@ then chmod +x /etc/cron.hourly/log2ram # Remove a previous log2ram version - if [ -d /var/log.hdd]; then + if [ -d /var/log.hdd ]; then rm -r /var/log.hdd fi