diff --git a/recipes-extended/logrotate/logrotate/logrotate-update-service-files.patch b/recipes-extended/logrotate/logrotate/logrotate-update-service-files.patch deleted file mode 100644 index e69cb3c3..00000000 --- a/recipes-extended/logrotate/logrotate/logrotate-update-service-files.patch +++ /dev/null @@ -1,95 +0,0 @@ -Date: Jun 19 2024 5:35 PM -From: Anbukannadhasan -Subject: [PATCH] logrotate-update-service-files.patch: Used to copy the created service files to the module -Service file will be copied to system path and execute accordingly -Source: https://github.com/logrotate/logrotate/ -Signed-off-by: Anbukannadhasan - -diff -Naur logrotate-3.21.0.orig/logrotate_hdd.conf logrotate-3.21.0/logrotate_hdd.conf ---- logrotate-3.21.0.orig/logrotate_hdd.conf 1970-01-01 00:00:00.000000000 +0000 -+++ logrotate-3.21.0/logrotate_hdd.conf 2023-09-27 14:00:29.061376936 +0000 -@@ -0,0 +1,8 @@ -+/opt/logs/*.txt -+/opt/logs/*.log -+/opt/logs/*.txt.0{ -+size 22020096 -+rotate 1 -+copytruncate -+missingok -+} -diff -Naur logrotate-3.21.0.orig/logrotate_nohdd.conf logrotate-3.21.0/logrotate_nohdd.conf ---- logrotate-3.21.0.orig/logrotate_nohdd.conf 1970-01-01 00:00:00.000000000 +0000 -+++ logrotate-3.21.0/logrotate_nohdd.conf 2023-09-27 14:00:20.373550095 +0000 -@@ -0,0 +1,9 @@ -+/opt/logs/*.txt -+/opt/logs/*.log -+/opt/logs/*.txt.0{ -+size 2097152 -+rotate 1 -+copytruncate -+missingok -+ignoreduplicates -+} -diff -Naur logrotate-3.21.0.orig/logrotate.service logrotate-3.21.0/logrotate.service ---- logrotate-3.21.0.orig/logrotate.service 1970-01-01 00:00:00.000000000 +0000 -+++ logrotate-3.21.0/logrotate.service 2023-09-27 14:00:03.673882936 +0000 -@@ -0,0 +1,26 @@ -+############################################################################## -+# If not stated otherwise in this file or this component's LICENSE file the -+# following copyright and licenses apply: -+# -+# Copyright 2020 RDK Management -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+############################################################################## -+ -+[Unit] -+Description=Logrotate Service -+ -+[Service] -+Type=oneshot -+SyslogIdentifier=logrotate -+ExecStart=/usr/sbin/logrotate -s /tmp/logrotatedata.status /etc/logrotatedata.conf -l /opt/logs/logrotate.log --skip-state-lock -diff -Naur logrotate-3.21.0.orig/logrotate.timer logrotate-3.21.0/logrotate.timer ---- logrotate-3.21.0.orig/logrotate.timer 1970-01-01 00:00:00.000000000 +0000 -+++ logrotate-3.21.0/logrotate.timer 2023-09-27 14:00:11.857719823 +0000 -@@ -0,0 +1,29 @@ -+############################################################################## -+# If not stated otherwise in this file or this component's LICENSE file the -+# following copyright and licenses apply: -+# -+# Copyright 2020 RDK Management -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+############################################################################## -+ -+[Unit] -+Description=Log Rotation Timer -+ -+[Timer] -+OnBootSec=2min -+Unit=logrotate.service -+OnUnitActiveSec=1min -+ -+[Install] -+WantedBy=multi-user.target diff --git a/recipes-extended/logrotate/logrotate/logrotate_nohdd.conf b/recipes-extended/logrotate/logrotate/logrotate_nohdd.conf new file mode 100644 index 00000000..2a2be1c9 --- /dev/null +++ b/recipes-extended/logrotate/logrotate/logrotate_nohdd.conf @@ -0,0 +1,12 @@ +/opt/logs/*.txt +/opt/logs/*.log +/opt/logs/*.txt.0{ +size 2097152 +rotate 1 +create +missingok +ignoreduplicates +postrotate + syslog-ng-ctl reopen --control=/tmp/syslog-ng/syslog-ng.ctl +endscript +} diff --git a/recipes-extended/logrotate/logrotate_3.21.0.bb b/recipes-extended/logrotate/logrotate_3.21.0.bb index 29fc9436..3c7dc97f 100644 --- a/recipes-extended/logrotate/logrotate_3.21.0.bb +++ b/recipes-extended/logrotate/logrotate_3.21.0.bb @@ -70,8 +70,6 @@ do_install(){ mkdir -p ${D}${sysconfdir}/logrotate.d mkdir -p ${D}${localstatedir}/lib install -p -m 644 ${S}/examples/logrotate.conf ${D}${sysconfdir}/logrotate.conf - install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp - install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp touch ${D}${localstatedir}/lib/logrotate.status @@ -84,5 +82,5 @@ do_install(){ do_install:append:client(){ - install -m 0644 ${S}/logrotate_nohdd.conf ${D}${sysconfdir}/logrotatemax.conf + install -m 0644 ${WORKDIR}/logrotate_nohdd.conf ${D}${sysconfdir}/logrotatemax.conf } diff --git a/recipes-extended/logrotate/logrotate_3.21.0.bbappend b/recipes-extended/logrotate/logrotate_3.21.0.bbappend index 43a0324e..6e659e9a 100644 --- a/recipes-extended/logrotate/logrotate_3.21.0.bbappend +++ b/recipes-extended/logrotate/logrotate_3.21.0.bbappend @@ -1,7 +1,15 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" -SRC_URI:append = " file://logrotate-update-service-files.patch \ - file://logrotate_memory_issues.patch \ +SRC_URI:append = " file://logrotate_memory_issues.patch \ file://logrotate-update-log-files.patch \ file://fix_fd_leak.patch \ + file://logrotate_nohdd.conf \ " + +PACKAGES =+ "${PN}-conf" + +FILES:${PN}-conf += "${sysconfdir}/logrotatemax.conf" +FILES:${PN}-conf += "${sysconfdir}/logrotate.conf" + +FILES:${PN}:remove = "${sysconfdir}/logrotatemax.conf" +FILES:${PN}:remove = "${sysconfdir}/logrotate.conf"