Bug 160225

Summary: [periodic] /etc/periodic/weekly/310.locate doesn't see /etc/locate.rc.
Product: Base System Reporter: Hiroaki Abe <hiroaki0404>
Component: confAssignee: Wolfram Schneider <wosch>
Status: Closed DUPLICATE    
Severity: Affects Some People CC: hiroaki0404, pstef, wosch
Priority: Normal    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Hiroaki Abe 2011-08-27 01:40:02 UTC
	The location of locate database can change in /etc/locate.rc.
	But the script of rebuilding locate database, 310.locate,
	doesn't see the definition in /etc/locate.rc. The location of
	locate database is hard coded in the script as "locdb=/var/db/locate.database".
	So, when changed the location of locate database in /etc/locate.rc,
	it failed to update the locate database.

How-To-Repeat: 	Change the "FCODES" in /etc/locate.rc from the default settings.
	Then run the /etc/periodic/weekly/310.locate.
Comment 1 Hiroaki Abe 2011-09-03 16:32:19 UTC
Hello, all.

Followings works fine for me.
Regards,

--- /usr/src/etc/periodic/weekly/310.locate     2011-02-26
19:30:50.000000000 +0900
+++ /etc/periodic/weekly/310.locate     2011-09-03 16:37:29.000000000 +0900
@@ -16,7 +16,12 @@
        echo ""
        echo "Rebuilding locate database:"

-       locdb=/var/db/locate.database
+       . /etc/locate.rc
+       if [ 'x' = "x$FCODES" ]; then
+           locdb=/var/db/locate.database
+       else
+           locdb="$FCODES"
+       fi

        touch $locdb && rc=0 || rc=3
        chown nobody $locdb || rc=3
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-01-08 04:14:41 UTC
For the following conditions
Product: Base System, Documentation Status: New, Open, In Progress, UNCONFIRMED 
Assignee: Former FreeBSD committer 

Reset to default assignee. Reset status to "Open".
Comment 3 Piotr Pawel Stefaniak freebsd_committer freebsd_triage 2021-10-07 19:56:30 UTC

*** This bug has been marked as a duplicate of bug 124119 ***
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-10-26 15:01:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8019068d7c30e45ad392669a6577e5f1db56421d

commit 8019068d7c30e45ad392669a6577e5f1db56421d
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2021-10-26 14:59:39 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2021-10-26 14:59:39 +0000

    /etc/periodic/weekly/310.locate must read /etc/locate.rc

    PR:             160225
    Reported by:    Hiroaki Abe
    Reviewed by:    se
    Approved by:    se
    Differential Revision: https://reviews.freebsd.org/D32646

 usr.sbin/periodic/etc/weekly/310.locate | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)