Bug 160225 - [periodic] /etc/periodic/weekly/310.locate doesn't see /etc/locate.rc.
Summary: [periodic] /etc/periodic/weekly/310.locate doesn't see /etc/locate.rc.
Status: Closed DUPLICATE of bug 124119
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: Normal Affects Some People
Assignee: Wolfram Schneider
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-27 01:40 UTC by Hiroaki Abe
Modified: 2021-10-26 15:01 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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(-)