[AGW][logrotate] fix logrotate config#7159
Conversation
|
Thanks for opening a PR! 💯 Please note that all commits must be signed off. This is enforced by the Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
Codecov Report
@@ Coverage Diff @@
## master #7159 +/- ##
=======================================
Coverage 34.15% 34.15%
=======================================
Files 1163 1163
Lines 104564 104564
Branches 1321 1321
=======================================
+ Hits 35713 35715 +2
+ Misses 65433 65431 -2
Partials 3418 3418
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Any idea what this comment |
lte/gateway/release/build-magma.sh
Outdated
| $(glob_files "${ANSIBLE_FILES}/envoy.yaml" /var/opt/magma/ ) \ | ||
| $(glob_files "${ANSIBLE_FILES}/logrotate_oai.conf" /etc/logrotate.d/oai) \ | ||
| $(glob_files "${ANSIBLE_FILES}/logrotate_rsyslog.conf" /etc/logrotate.d/rsyslog.magma) \ | ||
| $(glob_files "${ANSIBLE_FILES}/logrotate_rsyslog.conf" /etc/logrotate.d/rsyslog) \ |
There was a problem hiding this comment.
I got following error after building package with this patch and deploying it.
sharing '/etc/logrotate.d/rsyslog' between multiple packages results in conflict. we shld avoid it.
the .magma file trick try to do it.
apt install magma=1.6.0-1622011168-f23096de
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libnetplan0 linux-headers-5.4.0-70 linux-headers-5.4.0-70-generic linux-headers-5.4.0-71 linux-headers-5.4.0-71-generic linux-image-5.4.0-70-generic linux-image-5.4.0-71-generic linux-modules-5.4.0-70-generic
linux-modules-5.4.0-71-generic linux-modules-extra-5.4.0-70-generic linux-modules-extra-5.4.0-71-generic
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
magma
1 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Need to get 84.3 MB of archives.
After this operation, 24.1 MB of additional disk space will be used.
Get:1 https://artifactory.magmacore.org/artifactory/debian-test focal-1.5.0/main amd64 magma amd64 1.6.0-1622011168-f23096de [84.3 MB]
Fetched 84.3 MB in 7s (12.8 MB/s)
(Reading database ... 219323 files and directories currently installed.)
Preparing to unpack .../magma_1.6.0-1622011168-f23096de_amd64.deb ...
Unpacking magma (1.6.0-1622011168-f23096de) over (1.5.0-1621958919-c177d622) ...
dpkg: error processing archive /var/cache/apt/archives/magma_1.6.0-1622011168-f23096de_amd64.deb (--unpack):
trying to overwrite '/etc/logrotate.d/rsyslog', which is also in package rsyslog 8.2001.0-1ubuntu1.1
Synchronizing state of redis-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable redis-server
Synchronizing state of dnsmasq.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable dnsmasq
Synchronizing state of lighttpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable lighttpd
cp: cannot stat '/etc/logrotate.d/rsyslog.magma': No such file or directory
Errors were encountered while processing:
/var/cache/apt/archives/magma_1.6.0-1622011168-f23096de_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
There was a problem hiding this comment.
Ok, let me put that twisted logic back in. It did not feel right from the looks of it.
There was a problem hiding this comment.
we can have the .magma file in '/var/opt/magma/' to avoid confusion in log-rotate config.
The fluent-bit log rotation config gets added during the install process. This makes sure the config is picked up. |
Signed-off-by: Tariq Al-Khasib <[email protected]>
Signed-off-by: Ramon Melero <[email protected]>
Signed-off-by: Tariq Al-Khasib [email protected]
Summary
syslog log rotation is broken for Ubuntu. On the first log rotation, syslog gets empty and all logs are redirected to syslog.1
This PR forces a restart of rsyslog post rotation. This was tested and achieves the desirable behaviour on Ubuntu.
This PR also changes the syslog rotation config to "daily" since the logrotate cron job is run daily anyways.
Test Plan
Configuration changes tested on lab Ubuntu AGW.