changeset 366:423c16c3280f

Also configure the periodic part of "bsdstats"
author Franz Glasner <hg@dom66.de>
date Mon, 19 Dec 2022 12:07:33 +0100
parents 38453167f4be
children c5b1647cedb5
files sbin/fjail
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/fjail	Mon Dec 12 09:25:55 2022 +0100
+++ b/sbin/fjail	Mon Dec 19 12:07:33 2022 +0100
@@ -459,7 +459,7 @@
         sysrc -R "${_mp}" clear_tmp_enable=YES
         sysrc -R "${_mp}" clear_tmp_X=NO
         sysrc -R "${_mp}" syslogd_flags=-ss
-        sysrc -R "${_mp}" bsdstats_enable=NO       # no automatic BSD stats when booting
+        sysrc -R "${_mp}" bsdstats_enable=NO       # no automatic BSD stats when booting (for periodic see below)
     else
         echo "WARNING: No \"${_mp}/etc/defaults/rc.conf\": not configuring \"rc.conf\""
     fi
@@ -513,6 +513,20 @@
         echo "daily_status_disks_enable=\"NO\"" >> "${_pcl}"
         echo "daily_status_uptime_enable=\"NO\"" >> "${_pcl}"
 
+        #
+        # bsdstats
+        #
+        echo "" >> "${_pcl}"
+        echo "#" >> "${_pcl}"
+        echo "# bsdstats" >> "${_pcl}"
+        echo "#" >> "${_pcl}"
+        # Disabled by default but make it more explicit
+        echo "monthly_statistics_enable=\"NO\"" >> "${_pcl}"
+        # If enabled: because we are in a jail there are no devices
+        echo "monthly_statistics_report_devices=\"NO\"" >> "${_pcl}"
+        # If enabled: report ports
+        echo "monthly_statistics_report_ports=\"YES\"" >> "${_pcl}"
+
         echo "Creating system logfiles that are marked for automatic creation ..."
         chroot "${_mp}" /usr/sbin/newsyslog -CN