Skip to content

Instantly share code, notes, and snippets.

@quantum77
Created April 7, 2020 05:03
Show Gist options
  • Save quantum77/c70d33530833711091932d1e332d3d46 to your computer and use it in GitHub Desktop.
Save quantum77/c70d33530833711091932d1e332d3d46 to your computer and use it in GitHub Desktop.
#!/bin/sh
# In lieu of memory-log.sh
# mount /var/log on tmpfs to not wear down the eMMC flash chip
ISTMPFS=$(/bin/mount | /bin/grep -c "/var/log type tmpfs")
if [ "$ISTMPFS" = 0 ]; then
mount -t tmpfs -o size=100M tmpfs /var/log
#if we mount while the programs are still active and they keep their logfiles open, they keep on writing to the
#(now hidden) location on the eMMC, so we need to restart or send the HUP signal (if it's properly impemented)
mkdir /var/log/ntpstats /var/log/mgetty
chown ntp:ntp /var/log/ntpstats/
service ntp restart
pkill -HUP valhalla_server
restart rsyslog
ssh ic "mount -t tmpfs -o size=100M tmpfs /var/log"
ssh ic "mkdir /var/log/ntpstats /var/log/mgetty"
ssh ic "service ntp restart"
ssh ic "restart rsyslog"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment