diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/kdump/kdump.1 | 6 | ||||
-rw-r--r-- | usr.bin/locate/locate/locate.rc | 5 | ||||
-rw-r--r-- | usr.bin/locate/locate/updatedb.sh | 45 |
3 files changed, 33 insertions, 23 deletions
diff --git a/usr.bin/kdump/kdump.1 b/usr.bin/kdump/kdump.1 index b5e313b..df3e584 100644 --- a/usr.bin/kdump/kdump.1 +++ b/usr.bin/kdump/kdump.1 @@ -162,13 +162,13 @@ Seven bytes were written by the system call, so 7 is the return value. .Pp The possible operations are: -.Bl -column -offset indent ".Li GENIO" ".No data from user process" +.Bl -column -offset indent ".Li CALL" ".No data from user process" .It Sy Name Ta Sy Operation Ta Sy Fourth field .It Li CALL Ta enter syscall Ta syscall name and arguments .It Li RET Ta return from syscall Ta syscall name and return value .It Li NAMI Ta file name lookup Ta path to file -.It Li GENIO Ta general I/O Ta fd, read/write, number of bytes -.It Li SIG Ta signal Ta signal name, handler, mask, code +.It Li GIO Ta general I/O Ta fd, read/write, number of bytes +.It Li PSIG Ta signal Ta signal name, handler, mask, code .It Li CSW Ta context switch Ta stop/resume user/kernel .It Li USER Ta data from user process Ta the data .It Li STRU Ta various syscalls Ta structure diff --git a/usr.bin/locate/locate/locate.rc b/usr.bin/locate/locate/locate.rc index 54cc6d8..3ed0c38 100644 --- a/usr.bin/locate/locate/locate.rc +++ b/usr.bin/locate/locate/locate.rc @@ -15,9 +15,12 @@ # directories to be put in the database #SEARCHPATHS="/" -# directories unwanted in output +# paths unwanted in output #PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap" +# directories unwanted in output +#PRUNEDIRS=".zfs" + # filesystems allowed. Beware: a non-listed filesystem will be pruned # and if the SEARCHPATHS starts in such a filesystem locate will build # an empty database. diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index d828438..37c42e3 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -50,17 +50,20 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database -: ${SEARCHPATHS:="/"} # directories to be put in the database -: ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories -: ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \ +: ${SEARCHPATHS="/"} # directories to be put in the database +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories +: ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent +: ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ cut -d " " -f1)"} # allowed filesystems : ${find:=find} -case X"$SEARCHPATHS" in - X) echo "$0: empty variable SEARCHPATHS"; exit 1;; esac -case X"$FILESYSTEMS" in - X) echo "$0: empty variable FILESYSTEMS"; exit 1;; esac +if [ -z "$SEARCHPATHS" ]; then + echo "$0: empty variable SEARCHPATHS" >&2; exit 1 +fi +if [ -z "$FILESYSTEMS" ]; then + echo "$0: empty variable FILESYSTEMS" >&2; exit 1 +fi # Make a list a paths to exclude in the locate run excludes="! (" or="" @@ -71,25 +74,29 @@ do done excludes="$excludes ) -prune" -case X"$PRUNEPATHS" in - X) ;; - *) for path in $PRUNEPATHS - do +if [ -n "$PRUNEPATHS" ]; then + for path in $PRUNEPATHS; do excludes="$excludes -or -path $path -prune" - done;; -esac + done +fi + +if [ -n "$PRUNEDIRS" ]; then + for dir in $PRUNEDIRS; do + excludes="$excludes -or -name $dir -type d -prune" + done +fi tmp=$TMPDIR/_updatedb$$ trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15 # search locally -# echo $find $SEARCHPATHS $excludes -or -print && exit if $find -s $SEARCHPATHS $excludes -or -print 2>/dev/null | $mklocatedb -presort > $tmp then - case X"`$find $tmp -size -257c -print`" in - X) cat $tmp > $FCODES;; - *) echo "updatedb: locate database $tmp is empty" - exit 1 - esac + if [ -n "$($find $tmp -size -257c -print)" ]; then + echo "updatedb: locate database $tmp is empty" >&2 + exit 1 + else + cat $tmp > $FCODES # should be cp? + fi fi |