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

/etc/cron.daily/standard: the df issue again



Hi,

/etc/cron.daily/standard, as shipped with the cron package, features

 # Get a list of the (potential) ext2 l+f directories
 lflist=`df -P --type=ext2  |awk '/\/dev\// {printf "%s/lost+found ", $6}'`

Off course, this fails on the Hurd, and gives an - imho annoying - message

 df: cannot read table of mounted filesystems

If I understood the discussions about this issue correctly, it is
currently impossible to get a list of mounted "real" filesystems.
In http://lists.debian.org/debian-hurd-9912/msg00126.html , Marcus Brinkmann
wrote:

 "What we could do is to write a database server where filesystems can
 register themselves if they want."

Has any progress on this been made?  Would this be the right way to
do it, or have opinions changed?

As a quick fix, I've seen people suggesting to make /var/run/mtab
a symlink to /etc/fstab.  However, I've got this

 /dev/hd0s1 /    ext2 rw 1 1
 /dev/hd0s5 none swap sw 0 0

as my fstab.  df fails on `none' as a mountpoint, when using this as
mtab.  Making this symlink does not give me a warm and fuzzy feeling.

Anyway, about the standard script, I hacked up this patch:

-----8<------

--- standard.orig       Sat Mar 17 13:49:09 2001
+++ standard    Thu May  3 21:34:21 2001
@@ -64,7 +64,18 @@
 # Check to see if any files are in lost+found directories and warn admin
 #
 # Get a list of the (potential) ext2 l+f directories
-lflist=`df -P --type=ext2  |awk '/\/dev\// {printf "%s/lost+found ", $6}'`
+
+#
+if [ GNU = `uname` ] ; then
+       # there no way (yet) to get a list of all mounted filesystems on 
+       # a GNU Hurd box.  this hack is the best I can come up with.
+       lflist=
+       for d in /dev/null `locate lost+found | grep /lost+found$`; do 
+               [ -d $d ] && lflist="$lflist $d"
+       done
+else
+       lflist=`df -P --type=ext2  |awk '/\/dev\// {printf "%s/lost+found ", $6}'`
+fi
 
 # In each directory, look for files
 for lfdir in $lflist ; do

-----8<------

I would love to get rid of the locate-call, but don't know how.
I'm considering filing a bug against the cron package.  Would that be 
appropriate?

Bye,

Joost

-- 
Joost van Baal                    .
                         .              heart    http://debian.org/
                .                       food  http://logreport.org/
       .                                home        http://mdcc.cx/



Reply to: