From hiroaki@group.jp  Sat Aug 27 00:31:24 2011
Return-Path: <hiroaki@group.jp>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85CA9106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 27 Aug 2011 00:31:24 +0000 (UTC)
	(envelope-from hiroaki@group.jp)
Received: from ns.group.jp (unknown [IPv6:2001:e41:31d4:3cb2::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 5DFEC8FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 27 Aug 2011 00:31:24 +0000 (UTC)
Received: by ns.group.jp (Postfix, from userid 1001)
	id 7204C5C3E; Sat, 27 Aug 2011 09:31:23 +0900 (JST)
Message-Id: <20110827003123.7204C5C3E@ns.group.jp>
Date: Sat, 27 Aug 2011 09:31:23 +0900 (JST)
From: Hiroaki Abe <hiroaki0404@gmail.com>
Reply-To: Hiroaki Abe <hiroaki0404@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: hiroaki0404@gmail.com
Subject: /etc/periodic/weekly/310.locate doesn't see /etc/locate.rc.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         160225
>Category:       conf
>Synopsis:       [periodic] /etc/periodic/weekly/310.locate doesn't see /etc/locate.rc.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 27 00:40:02 UTC 2011
>Closed-Date:    
>Last-Modified:  Sat Sep  3 16:00:18 UTC 2011
>Originator:     Hiroaki Abe
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD ns.group.jp 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


$FreeBSD: src/etc/periodic/weekly/310.locate,v 1.7.10.1.4.1 2010/06/14 02:09:06 kensmith Exp $
>Description:
	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.
>Fix:



>Release-Note:
>Audit-Trail:

From: =?ISO-2022-JP?B?GyRCMCRJdDkoTEAbKEI=?= <hiroaki0404@gmail.com>
To: bug-followup@FreeBSD.org, hiroaki0404@gmail.com
Cc:  
Subject: Re: conf/160225: [periodic] /etc/periodic/weekly/310.locate
 doesn&#39;t see /etc/locate.rc.
Date: Sun, 4 Sep 2011 00:32:19 +0900

 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
>Unformatted:
