AirNav Radar
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 


Author Topic: Don't want RB to fill my logfile daemon.log (raspberry)  (Read 16017 times)

0 Members and 1 Guest are viewing this topic.

jozg

  • New Member
  • *
  • Posts: 3
Don't want RB to fill my logfile daemon.log (raspberry)
« on: February 19, 2019, 06:41:17 PM »
Hello All,

I have a 20mb ramdrive for my logfiles, to save the SD card installed.
My daemon.log file is filling up every 30seconds with rbfeeder logs:
Feb 19 19:39:41 raspberrypi rbfeeder[602]: #033[35m[#033[33m2019-02-19 19:39:41#033[35m]#033[0m  Packets sent in the last 30 seconds: 1657, Total packets sent since startup: 1041273

Is there a way, to not have a logfile to be filled?. So turning of logfile.

Thanks.

Regards,

Runway 31

  • Moderator
  • Hero Member
  • *****
  • Posts: 34099
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #1 on: February 19, 2019, 06:54:09 PM »
Better asking [email protected]

Alan

wiedehopf

  • Jr. Member
  • **
  • Posts: 66
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #2 on: February 19, 2019, 09:02:28 PM »
I had the same problem and saw no configuration option, so i resorted to changing the service file:

/lib/systemd/system/rbfeeder.service

Code: [Select]
[Unit]
Description=RBFeeder Service
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/rbfeeder
ExecStop=/bin/kill -TERM $MAINPID
Restart=always
StandardOutput=null

[Install]
WantedBy=multi-user.target


I've added the
Code: [Select]
StandardOutput=null

line.


You can also do some fancy stuff so this change survives a reinstall or new version but i didn't bother.

abcd567

  • Hero Member
  • *****
  • Posts: 890
  • CYYZ - Toronto
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #3 on: February 19, 2019, 11:11:55 PM »
Code: [Select]
sudo nano /etc/rbfeeder.ini   

The above command will open following file.

Code: [Select]
[client]
network_mode=true
log_file=/var/log/rbfeeder.log

key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

sn=EXTRPIxxxxxx

[network]
mode=beast
external_port=30005
external_host=127.0.0.1

[mlat]


What about modifying the line:
log_file=/var/log/rbfeeder.log

To:
log_file=/dev/null

NOTE:
1. This is untested.
2.  This being a config/init file, logically this change should servive upgrades and reboots, but cannot say with 100% surety unless tested.


.
« Last Edit: February 19, 2019, 11:55:38 PM by abcd567 »

abcd567

  • Hero Member
  • *****
  • Posts: 890
  • CYYZ - Toronto
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #4 on: February 20, 2019, 01:34:57 AM »
I feel solution suggested by @wiedehopf is somewhat better than the one suggested by me. The reason is given below:

What I suggested will block both the normal log (stdout) and error messages (stderr).

What @wiedehopf suggested will block only stdout (normal log) which is the bulk user of memory, and the stderr (error messages) will continue to be logged.

The error messages are relatively very few in normal operation, and not heavy on memory. This will help in debugging in case of any problem/malfunction.

abcd567

  • Hero Member
  • *****
  • Posts: 890
  • CYYZ - Toronto
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #5 on: February 20, 2019, 07:00:38 AM »
Just now tested both methods.

Found:
(1) Editing file "/lib/systemd/system/rbfeeder.service" and adding line "StandardOutput=null" did NOT stop logging (very strange!).
New entries continue to be added every 30 seconds, and size of log file keeps increasing.

(2) Editing file "/etc/rbfeeder.ini" and changing line "log_file=/var/log/rbfeeder.log"  to  "log_file=/dev/null" completely stops logging.
No new entries are made in log file, and size of log file stopped increasing


« Last Edit: February 20, 2019, 07:04:17 AM by abcd567 »

wiedehopf

  • Jr. Member
  • **
  • Posts: 66
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #6 on: February 20, 2019, 11:24:33 AM »
I somehow assumed he was annoyed by the logging going to the system journal.
That is all my variant turns off.

If you want to avoid filling that log file as well, you need to change the config just as abcd567 suggested.

jozg

  • New Member
  • *
  • Posts: 3
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #7 on: February 20, 2019, 12:01:49 PM »
Hello wiedehopf and abcd567,

I used the method of wiedehopf to edit the service, and it worked.
Thanks all for helping!.

Regards

wiedehopf

  • Jr. Member
  • **
  • Posts: 66
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #8 on: February 20, 2019, 01:09:17 PM »
It is probably still logging to /var/log/rbfeeder.log

So you should change the rbfeeder.ini as well so that it doesn't write that log.

abcd567

  • Hero Member
  • *****
  • Posts: 890
  • CYYZ - Toronto
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #9 on: February 20, 2019, 05:37:46 PM »
I somehow assumed he was annoyed by the logging going to the system journal.

Your assumption was right.

I misunderstood that he wants to stop logging to the normal log file /var/log/rbfeeder.log.

jozg

  • New Member
  • *
  • Posts: 3
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #10 on: February 20, 2019, 06:30:13 PM »
Hello abcd567,

Actually i did both, so also your suggestion to log to /dev/null in the rbfeeder.ini file.
So no logs anymore in daemon.log and no logging in rbfeeder.log.

Thank you both!!.

Regards,

wiedehopf

  • Jr. Member
  • **
  • Posts: 66
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #11 on: February 20, 2019, 08:06:29 PM »
you can use iotop to check if you have still stuff writing to disk

sudo apt install iotop
sudo iotop -a

There you can check for disk writes.

You can also change the systemd journal to be volatile, so it will only be in RAM (i guess you having a tmpfs has the same outcome):

Change /etc/systemd/journald.conf so it has:

[Journal]
Storage=volatile

Should be applied after a reboot.

abcd567

  • Hero Member
  • *****
  • Posts: 890
  • CYYZ - Toronto
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #12 on: February 20, 2019, 10:33:13 PM »
Frankly speaking, I am against saving log in volatile memory or tmpfs.

Most people do it for increasing the life of a $8 microSD card, but forget by doing this they are shortening the life of RAM of of a $35 Pi.

I dont want to save $8 and waste $35 in doing so.

Note: Since for ADSB, an 8Gb microSD card is sufficient, all my microSD cards are only 8Gb Class 10 ($6~$8)

Two of these are 24/7 use in two RPi since begining of 2015.

Other 3 are for experimenting/testing, and have faced innumerable numbers of formatting & reimaging, and all have servived this torture.

And no tmpfs or volatile memory ever used on any of the 5 cards.
« Last Edit: February 20, 2019, 10:47:50 PM by abcd567 »

wiedehopf

  • Jr. Member
  • **
  • Posts: 66
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #13 on: February 20, 2019, 10:56:27 PM »
RAM works very different from Flash memory.

(If RAM would wear out, a bit of log being written to it would not be your problem. Decoding ADS-B data would be. The raw data travels over USB to the RAM. And that is 2.4MHz * 8bit. So that alone is 2.4 MByte/s that needs to be written to the RAM :) )

It seems most SD-cards don't fail because of excessive writes but just because the control circuitry goes bad after some time.
Log files are generally not a problem anyway because it isn't very much data.

But if you are fiddling around with it anyway and don't need permanent logs it doesn't hurt to make them non permanent.

abcd567

  • Hero Member
  • *****
  • Posts: 890
  • CYYZ - Toronto
Re: Don't want RB to fill my logfile daemon.log (raspberry)
« Reply #14 on: February 20, 2019, 11:43:52 PM »
Why to bother about logs when these dont take much space on microSD card (few Mb only).

Just as a cleanup operation, I usually manually delete log files once about every 6 months, although these are still not very big, and lot of spare storage capacity is still available on microSD card.