Take kern.localbase into account with fallback to /usr/local
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 51966 Build 48857: arc lint + arc unit
Event Timeline
tiny nit... I think this is good otherwise
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 33 | Style nit: we prefer $(foo) to foo in our scripts. | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 33 |
I only wanted to be consistent. There are backticks in rest of the file, I even have looked into libexec/rc/rc source where there also are backticks. Do you think it's fine to introduce this inconsistency into periodic.sh only? | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 33 | ah, ok. Then never mind. This area of the tree hasn't been updated like I thought it had. | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 35 | IMHO _localbase should be marked as 'export', else the sub-shells called as ${_localbase}/etc/periodic/xxx/xxx will not see the configurations defined in ${_localbase}/etc/periodic.conf by means of source_periodic_confs. | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 35 |
root@b14:/usr/local/etc/periodic/otis # ls -la
total 6
drwxr-xr-x 2 root wheel 3 Jul 7 10:13 .
drwxr-xr-x 6 root wheel 6 Jul 7 10:12 ..
-rwxr-xr-x 1 root wheel 195 Jul 7 10:13 otis
root@b14:/usr/local/etc/periodic/otis # cat otis
#!/bin/sh -
#
# $FreeBSD$
#
if [ -r /etc/defaults/periodic.conf ]; then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
echo "===> ENV <==="
env
echo "===> SET <==="
set
exit 0
root@b14:/usr/local/etc/periodic/otis # periodic otis | grep localbase
_localbase=/usr/local
root@b14:/usr/local/etc/periodic/otis # | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 35 | root@latitude /usr/local/etc/periodic/hmo # cat hmo if [ -r /etc/defaults/periodic.conf ]; then . /etc/defaults/periodic.conf source_periodic_confs fi echo "===> ENV <===" | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 35 | putting things differently: root@latitude /usr/local/etc/periodic/hmo # periodic hmo | fgrep periodic_conf_files periodic_conf_files='/etc/periodic.conf /etc/periodic.conf.local /etc/periodic.conf' root@latitude /usr/local/etc/periodic/hmo # echo export _localbase >>/usr/local/etc/periodic.conf root@latitude /usr/local/etc/periodic/hmo # periodic hmo | fgrep periodic_conf_files periodic_conf_files='/etc/periodic.conf /etc/periodic.conf.local /usr/local/etc/periodic.conf' root@latitude /usr/local/etc/periodic/hmo # | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 35 | FWIW I have just powered up a fresh FreeBSD 14.0-CURRENT #0 main-n263985-884eaacd24bd: Thu Jul 6 08:32:11 UTC 2023 from FreeBSD-14.0-CURRENT-amd64-20230706-884eaacd24bd-263985-disc1, only added the otis/otis script like you did abov, and I am not seeing a match for _localbase like you do. I suspect something is a bit different on you machine? | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 35 |
My VM is a stock -CURRENT VM. | |
| usr.sbin/periodic/periodic.sh | ||
|---|---|---|
| 35 |
| |