diff --git a/scripts/cron_d_reboot b/scripts/cron_d_reboot new file mode 100644 index 0000000..7fc7455 --- /dev/null +++ b/scripts/cron_d_reboot @@ -0,0 +1 @@ +@reboot root run-parts /etc/cron.reboot diff --git a/scripts/cron_reboot_logrotate b/scripts/cron_reboot_logrotate new file mode 100644 index 0000000..f4f56a9 --- /dev/null +++ b/scripts/cron_reboot_logrotate @@ -0,0 +1,4 @@ +#!/bin/sh + +test -x /usr/sbin/logrotate || exit 0 +/usr/sbin/logrotate /etc/logrotate.conf diff --git a/scripts/install.sh b/scripts/install.sh index 3bdeb2a..47b0a01 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -146,6 +146,13 @@ fi cp ./scripts/bbctrl-logrotate /etc/logrotate.d/bbctrl chown root:root /etc/logrotate.d/bbctrl +# Ensure logrotate runs on every boot (for systems with no network, thus bad clock) +if [ ! -e /etc/cron.d/reboot ]; then + cp ./scripts/cron_d_reboot /etc/cron.d/reboot + mkdir -p /etc/cron.reboot + cp ./scripts/cron_reboot_logrotate /etc/cron.reboot/logrotate +fi + ########################################## # Begin one-time cleanup tasks for 1.0.7 ##########################################