Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152100454
D47486.id149698.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47486.id149698.diff
View Options
diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf
--- a/usr.sbin/periodic/periodic.conf
+++ b/usr.sbin/periodic/periodic.conf
@@ -15,6 +15,15 @@
#
#
+_set_localbase() {
+ _localbase=`/sbin/sysctl -n user.localbase 2> /dev/null`
+ # Set default value of _localbase if not previously set
+ : ${_localbase:="/usr/local"}
+}
+
+# Set _localbase with fallback to /usr/local
+_set_localbase
+
# What files override these defaults ?
periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local ${_localbase}/etc/periodic.conf"
diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh
--- a/usr.sbin/periodic/periodic.sh
+++ b/usr.sbin/periodic/periodic.sh
@@ -29,14 +29,6 @@
usage
fi
-_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null`
-# Set default value of _localbase if not previously set
-: ${_localbase:="/usr/local"}
-
-# Use a deterministic path to match the preset from /etc/crontab in case
-# periodic is run interactively.
-export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${_localbase}/sbin:${_localbase}/bin
-
# If possible, check the global system configuration file,
# to see if there are additional dirs to check
if [ -r /etc/defaults/periodic.conf ]; then
@@ -44,6 +36,10 @@
source_periodic_confs
fi
+# Use a deterministic path to match the preset from /etc/crontab in case
+# periodic is run interactively.
+export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${_localbase}/sbin:${_localbase}/bin
+
host=`hostname`
export host
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 13, 5:44 PM (4 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31419603
Default Alt Text
D47486.id149698.diff (1 KB)
Attached To
Mode
D47486: periodic: set _localbase in periodic scripts when not set in main script
Attached
Detach File
Event Timeline
Log In to Comment