summaryrefslogtreecommitdiff
path: root/recipes-extended/logrotate/logrotate_%.bbappend
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/logrotate/logrotate_%.bbappend')
-rw-r--r--recipes-extended/logrotate/logrotate_%.bbappend20
1 files changed, 20 insertions, 0 deletions
diff --git a/recipes-extended/logrotate/logrotate_%.bbappend b/recipes-extended/logrotate/logrotate_%.bbappend
new file mode 100644
index 0000000..c8adb80
--- /dev/null
+++ b/recipes-extended/logrotate/logrotate_%.bbappend
@@ -0,0 +1,20 @@
+PR .= ".mlinux2"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI[md5sum] = "8572b7c2cf9ade09a8a8e10098500fb3"
+SRC_URI[sha256sum] = "5bf8e478c428e7744fefa465118f8296e7e771c981fb6dffb7527856a0ea3617"
+
+
+SRC_URI += "file://logrotate.conf"
+
+# consider Systemd here someday. Also prevent logrotate from starting if it is already running
+# use startdaemon?
+do_install_append() {
+ # setup cron to run logrotate more often
+ rm -f ${D}${sysconfdir}/cron.daily/logrotate
+ install -d ${D}${sysconfdir}/cron.d
+ echo "*/5 * * * * root /usr/sbin/logrotate /etc/logrotate.conf" > ${D}${sysconfdir}/cron.d/logrotate
+
+ install -m 0644 ${WORKDIR}/logrotate.conf ${D}${sysconfdir}/
+}
+