Jump to content

broodwich82

Members
  • Posts

    27
  • Joined

  • Last visited

Reputation Activity

  1. Like
    broodwich82 reacted to borombo in /var easily get full with log2ram   
    log2ram writes files from ramdisk to sdcard every hour (if they are updated) by cron task. Also at startup log2ram loads all content from /var/log.hdd to ramdisk.
     
    1. For improving situation with full ramdisk you can organize log rotation rules in /etc/logrotate.d to optimize logs by size. Log rotation is time dependent - daily, weekly. But, using log2ram, the best choice is to make it size-dependent.
     
    edit /etc/logrotate.d/rsyslog:
     
    /var/log/syslog
    {
        # rotate only once
        rotate 1
        # rotate only if syslog > 10 Mb
        size 10M
        missingok
        notifempty
        delaycompress
        compress
        postrotate
            invoke-rc.d rsyslog rotate > /dev/null
        endscript
    }
     
    /var/log/kern.log
    {
        # do not rotate, just purge file
        rotate 0
        # if size more than 1 Mb
        size 1M
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
            invoke-rc.d rsyslog rotate > /dev/null
        endscript
    }
     
    2. If your system spams a lot of messages, you can make log rotation more aggressive:
     
    move /etc/cron.daily/logrotate to /etc/cron.hourly/logrotate
     
    3. If you don't need detailed archived logging. You can protect your sdcard from hourly writes by telling log2ram to not write syslog and kern.log to disk. As a bonus at boot your ramdisk will not be filling with previous session's logs.
     
    a) activate rsync mode in /etc/default/log2ram (or in /etc/log2ram.conf):
    USE_RSYNC=true
     
    b) find your log2ram (delete duplicates, if there is) and edit
    whereis log2ram
     
    replace two lines
    rsync -aXWv --delete --links $RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
    and
    rsync -aXWv --delete --links $HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
     
    with
    rsync -aXWv --delete --delete-excluded --exclude-from '/etc/log2ram-exclude' --links $RAM_LOG $HDD_LOG 2>&1 | $LOG_OUTPUT
    and
    rsync -aXWv --delete --delete-excluded --exclude-from '/etc/log2ram-exclude' --links $HDD_LOG $RAM_LOG 2>&1 | $LOG_OUTPUT

    c) create new file /etc/log2ram-exclude and add lines:
    /log2ram.log
    /syslog*
    /kern.log*
     
  2. Like
    broodwich82 got a reaction from NicoD in fanless + SATA + 2GB RAM?   
    That NanoPi M4 looks really great, even though it's still pretty new and software support is still in the works. I might be willing to take a gamble on this board since I suspect the Rockchip 3399 will become fairly well supported.
     
    I forgot to mention that small form factor is important to me as my project is concealing a wifi-enabled server in an RGB accent lamp which I will carry around with me while living an "ultramobile" lifestyle So, the NanoPi M4 wins on form factor as well. I suspect I could arrive at a tolerable thermal situation by some combination of a copper shim to the heatsink, mounting non-horizontally and building the enclosure with convection in mind, and perhaps some tinkering with clock speeds as needed.
     
    Looks like wifi might still be a bit dodgy. I suppose I'll have to take my chances with that and fall back on a known good USB adapter if support is problematic for longer than I have to wait.
     
    Thanks so much for the pointers!
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines