15.0-ALPHA1: _localbase not set in /usr/sbin/periodic

From: J.R. Oldroyd <fbsd_at_opal.com>
Date: Wed, 17 Sep 2025 13:17:29 UTC
Commit c8b89c11a1181e900acb638cfde7a55e92553175 removes the initialization
of $_localbase in /usr/sbin/periodic.

This causes $dirlist to be set to:
	 " /etc/periodic /etc/periodic"
and that causes all scripts in /etc/periodic to be executed twice per
security run (the security run emails show everything happening twice).
$dirlist should be:
	" /etc/periodic /usr/local/etc/periodic"

Need to partially revert that commit to re-add the initialization of
$_localbase.

	-jr




# git diff usr.sbin/periodic/periodic.sh
diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh
old mode 100644
new mode 100755
index a310f04864da..7fba93d4d948
--- a/usr.sbin/periodic/periodic.sh
+++ b/usr.sbin/periodic/periodic.sh
@@ -29,6 +29,10 @@ if [ $# -lt 1 ] ; then
     usage
 fi
 
+_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null`
+# Set default value of _localbase if not previously set
+: ${_localbase:="/usr/local"}
+
 # If possible, check the global system configuration file,
 # to see if there are additional dirs to check
 if [ -r /etc/defaults/periodic.conf ]; then