[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #4380] updatedb: produces invalid db if external commands fail.

From: nobody
Subject: [bug #4380] updatedb: produces invalid db if external commands fail.
Date: Sun, 20 Jul 2003 05:50:13 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk

=================== BUG #4380: FULL BUG SNAPSHOT ===================

Submitted by: ametzler                Project: findutils                    
Submitted on: Sun 07/20/2003 at 09:50
Category:  None                       Severity:  5 - Major                  
Bug Group:  None                      Resolution:  None                     
Assigned to:  None                    Originator Name:                      
Originator Email:                     Status:  Open                         
Release:  None                        Fixed Release:  None                  

Summary:  updatedb: produces invalid db if external commands fail.

Original Submission:  
Version: 4.1.20

First reported by Stefan Wiens in http://bugs.debian.org/90381

| The `updatedb' script does not take reasonable action if one of its
| (external) commands fails for some reason. An example:
| address@hidden:~/testdir$ updatedb --localpaths=. --output=locatedb
| address@hidden:~/testdir$ ls -l locatedb
| -rw-r--r--    1 stefan   stefan       2746 Mar 20 04:09 locatedb
| address@hidden:~/testdir$ ps h | wc -l
| 28
| address@hidden:~/testdir$ ulimit -Su 32                    # 28 + 4
| address@hidden:~/testdir$ updatedb --localpaths=. --output=locatedb
| /usr/bin/updatedb: Cannot fork
| address@hidden:~/testdir$ echo $?
| 0
| address@hidden:~/testdir$ ls -l locatedb
| -rw-r--r--    1 stefan   stefan         10 Mar 20 04:10 locatedb
| address@hidden:~/testdir$
| Running updatedb through `sh -x' shows that the `find' invocation
| fails, but updatedb destroys the existing database and returns
| with exit status 0.

I completely agree. I'd suggest using "set -e" to abort on any error and 
instead of 'find | sort | frcode > file' some code to abort if find or sort 
fails, my sh-scripting is not superb, I only came up with:
{ find || exit 1 ; }  | { sort || exit 1 ; } | frcode

Is there a more elegant way?
   cu andreas

No Followups Have Been Posted

CC list is empty

No files currently attached

For detailed info, follow this link:

  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]