[arm-allstar] Persistant HamVoIP logs
David McGough
kb4fxc at inttek.net
Wed Mar 15 09:29:43 EDT 2023
Hi Mark,
Okay, persistent logging to the SD card is easy to setup, there are 2
steps.
First, edit the /etc/systemd/journald.conf file and change:
[Journal]
Storage=volatile
...to...
[Journal]
#Storage=volatile
Storage=persistent
...and save the file.
Second, edit the /etc/fstab file and comment out the entry for the
/var/log tmpfs, like:
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
/dev/mmcblk0p1 /boot vfat defaults 0 0
#tmpfs /var/log tmpfs nodev,nosuid,size=50M 0 0
....Save the /etc/fstab file and reboot. That's it! Now, the logfiles
will all be in /var/log and that folder will be persistent across reboots.
NOTE: Now /var/log is part of the system "root" filesystem. If the
logfiles get too big, they could leave the root filesystem full, impairing
system operation until they get cleaned up!!! So, be careful!
If you decide to go back to volatile log files, just reverse the changes,
above, and reboot.
73, David K4FXC
On Tue, 14 Mar 2023, Mark VE3JMR via ARM-allstar wrote:
>
>
> Hi David;
>
> Saving the logs to the microSD card would suffice. As needed, I can back
> them up locally to the card and to an external backup server on my
> network with ease.
>
> My primary reason for log retention is that they are good tools for
> diagnosing issues. I've had a few strange connections that were not
> initiated by me and I'd like to be able to analyse the logs to see if
> there is a pattern. I tend to be a hacker/tinkerer that results in
> multiple reboots each week. When that happens, the logs are gone.
>
> Thanks so much.
>
> 73 75 de VE3JMR | VE3MR
> Mark
> Port Colborne, Ontario, CANADA
> https://www.qrz.com/db/VE3JMR
> Allstar# 531320 [1] | Echolink# 736666 | VE3JMR-L [2]
>
> [3] [4] [5]
> Ottawa ARC [3] Burlington
> ARC [4] Radio Amateur of Canada
> [5]
>
> LIFE has an expiry date.
> <if trumpet=%true then exit function>
>
> > ------------------------------
> >
> > Message: 3
> > Date: Tue, 14 Mar 2023 05:19:49 -0400 (EDT)
> > From: David McGough <kb4fxc at inttek.net>
> > To: Mark VE3JMR via ARM-allstar <arm-allstar at hamvoip.org>
> > Cc: Mark VE3JMR <ve3jmr at jmarkrobinson.ca>
> > Subject: Re: [arm-allstar] System logs retention
> >
> > Hi Mark,
> >
> > As you know, HamVoIP was setup to minimize writes to the SD card,
> > attempting to maximize SD card lifespan.
> >
> > In retrospect, this concern may have been unwarranted. I've got many
> > systems in use for years (5+) which perform frequent SD card writes and
> > still have not had a single actual SD card failure....I have seen
> > corrupted root (ext4) filesystems a few times, which once repaired
> > (fsck.ext4) were again fully usable. In the case where the filesystems
> > got
> > corrupted, the RPi units had crashed hard due to power problems. I
> > suspect that most of the reported "bad SD cards" are probably just
> > filesystem corruption.
> >
> > Anyhow, there are 2 primary places where log files get written in
> > HamVoIP:
> > The /var/log and /run/log/journal folders, both being volatile tmpfs
> > (RAM
> > drive) filesystems.
> >
> > Are you wanting to preserve the log contents on the SD card proper, or
> > on
> > an external device (e.g.: USB SSD, USB thumbdrive, NAS) ??
> >
> > 73, David K4FXC
> >
> > On Mon, 13 Mar 2023, Mark VE3JMR via ARM-allstar wrote:
>
> Is there a way to retain the systems logs between sessions? Each time
> the node is rebooted, the logs from the previous session are wiped. It
> would even be better if the system logs could be reopened and logging
> from the new session continue in the same log files.
>
> Thanks so much.
>
> 73 75 de VE3JMR | VE3MR
> Mark
> Port Colborne, Ontario, CANAD
>
> Links:
> ------
> [1] http://stats.allstarlink.org/stats/531320
> [2]
> https://www.echolink.org/links.jsp?lat_deg=42&lat_min=52.997999999999905&lat_NS=North&lon_deg=79&lon_min=13.99799999999999&lon_EW=West&gs=FN02jv&sel=city&city=Port+Colborne&state=ON&country=CA&d=1
> [3] https://oarc.net
> [4] https://www.barc.ca
> [5] https://www.rac.ca
> _______________________________________________
>
> ARM-allstar mailing list
> ARM-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3/4 web page - http://hamvoip.org
>
More information about the ARM-allstar
mailing list