Analog_Bridge#.log instance 2 and 3 was not auto-rotate


Komkit Listisard
 

Currently I have 3 running Analog_Bridge instance.

Only 1 Analog_Bridge.log (1st instance) were auto-rated.   Analog_Bridge2 and Analog_Bridge3 log files were not, there in one Analog_Bridge#.log.

My analog_bridge3.service,  all 3 service files are the same - well except the instance numbers. The log generate correctly for instance 2 and 3 but they never rotated.

[Unit]
Description=Analog_Bridge Service3
# Description=Place this file in /lib/systemd/system
# Description=N4IRS 03/25/2021
 
After=netcheck.service
Requires=netcheck.service
 
[Service]
Type=simple
Restart=on-failure
RestartSec=3
RestartPreventExitStatus=252 253 254
StandardOutput=null
WorkingDirectory=/opt/Analog_Bridge3
Environment=AnalogBridgeLogDir=/var/log/dvswitch3
ExecStartPre = /bin/sh -c 'echo "Starting Analog_Bridge: [`date +%%T.%%3N`]" >> /var/log/netcheck'
ExecStart=/opt/Analog_Bridge3/Analog_Bridge3 /opt/Analog_Bridge3/Analog_Bridge3.ini
ExecStartPost= -/usr/local/sbin/update-config.sh
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
 
[Install]
WantedBy=multi-user.target
 
# 254 matching IDs
# 253 ini parse errors
# 252 dv3000 not found, fallback not enabled
 
73, kit


Komkit Listisard
 

BTW AB instance 1 and 2 are for P25 bridge <-> DMR

Instance 3 is for ASL/Echolink <-> DMR

73, Kit


Steve N4IRS
 

You will have to copy/modify /etc/logrotate/Analog_Bridge

On 5/22/21 10:05 AM, Komkit Listisard via groups.io wrote:
Currently I have 3 running Analog_Bridge instance.

Only 1 Analog_Bridge.log (1st instance) were auto-rated.   Analog_Bridge2 and Analog_Bridge3 log files were not, there in one Analog_Bridge#.log.

My analog_bridge3.service,  all 3 service files are the same - well except the instance numbers. The log generate correctly for instance 2 and 3 but they never rotated.

[Unit]
Description=Analog_Bridge Service3
# Description=Place this file in /lib/systemd/system
# Description=N4IRS 03/25/2021
 
After=netcheck.service
Requires=netcheck.service
 
[Service]
Type=simple
Restart=on-failure
RestartSec=3
RestartPreventExitStatus=252 253 254
StandardOutput=null
WorkingDirectory=/opt/Analog_Bridge3
Environment=AnalogBridgeLogDir=/var/log/dvswitch3
ExecStartPre = /bin/sh -c 'echo "Starting Analog_Bridge: [`date +%%T.%%3N`]" >> /var/log/netcheck'
ExecStart=/opt/Analog_Bridge3/Analog_Bridge3 /opt/Analog_Bridge3/Analog_Bridge3.ini
ExecStartPost= -/usr/local/sbin/update-config.sh
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
 
[Install]
WantedBy=multi-user.target
 
# 254 matching IDs
# 253 ini parse errors
# 252 dv3000 not found, fallback not enabled
 
73, kit



Komkit Listisard
 

Steve,

I do not have  /etc/logrotate/ directory,  only have  /etc/logrotate.d/  directory.  There is an Analog_Bridge in the directory. Is it the same thing?

Do I add the lines into the same file or creates two more Analog_Bridge2 and Analog_Bridge3 then edit the line /var/log/dvswitch/Analog_Bridge.log with /var/log/dvswitch2/Analog_Bridge2.log then the same with AB3?

73, Kit


Komkit Listisard
 

Oh, I see . I missed the "Copy" part :D


Steve N4IRS
 

Yes, I forgot the .d Do the same you did for the systemd unit files.

On 5/22/21 10:39 AM, Komkit Listisard via groups.io wrote:
Steve,

I do not have  /etc/logrotate/ directory,  only have  /etc/logrotate.d/  directory.  There is an Analog_Bridge in the directory. Is it the same thing?

Do I add the lines into the same file or creates two more Analog_Bridge2 and Analog_Bridge3 then edit the line /var/log/dvswitch/Analog_Bridge.log with /var/log/dvswitch2/Analog_Bridge2.log then the same with AB3?

73, Kit


Komkit Listisard
 

Ummm,

In directories dvswitch2 and dvswitch3 logs still not rotate.

Am I doing correctly?  I creating 2 more files (Analog_Bridge2 and Analog_Bridge3) in logrotate.d directory or adding script into an existing Analog_Bridge for instance 2 and 3?

73, Kit


Steve N4IRS
 

look at the logrotate command man logrotate)

logrotate -vfd Might tell you something. don't just run it, look at the man page and understand it.

On 5/23/21 6:14 AM, Komkit Listisard via groups.io wrote:
Ummm,

In directories dvswitch2 and dvswitch3 logs still not rotate.

Am I doing correctly?  I creating 2 more files (Analog_Bridge2 and Analog_Bridge3) in logrotate.d directory or adding script into an existing Analog_Bridge for instance 2 and 3?

73, Kit


Komkit Listisard
 

Yes, I did look a the man a bit but TBH, it was way over my head, most of these things are anyway.

I have 3 instances of mmdvm_bridge running, I didn't do anything to the script and there was only one file in logrotate.d, they were auto-rotated nicely to their own directories. Maybe AB log is different.

No, big issue, I will get it through thick skull someday.  For now I can manage analog_bridge2 and 3 logs manually.

I will re-read the man again and see if I can get some where.

73, Kit