Hi,

I run a system with a nfs mounted r/o /usr/local partition, and was getting 
really annoying messages from cron about /usr/sbin/makewhatis trying to build 
the whatis database where it could not write.  A quick hack fixed the problem, 
but seeing as this should be a fairly common occurrence, I thought I would 
share a patch in hopes of getting this committed to the script permanently.  
The script was not obvious about a maintainer, so I figured that this was as 
good place as any.  Let me know if there is some where better to send it.


Thanks,

- Rob
.

---------------------------------
--- /usr/sbin/makewhatis        Mon Nov 22 14:38:58 1999
+++ /usr/sbin/makewhatis.new    Mon Nov 22 14:38:08 1999
@@ -60,6 +60,20 @@
 
 sections="1 2 3 4 5 6 7 8 9 n l"
 
+# function to test if file system is read only
+is_readonly(){
+       if [ x"$1" = x ]; then
+               return 0
+       fi
+       testdir=`df -P $1 | $AWK ' /\// {print $6}'`
+       mount | grep "$testdir .*(ro," > /dev/null
+       if [ "$?" = 0 ] ; then 
+               return 1
+       fi
+       return 0
+}
+
+
 for name in $*
 do
 if [ -n "$setsections" ]; then
@@ -118,7 +132,9 @@
       eval path="\$$pages"path
       for mandir in $path
       do
+       if `is_readonly $mandir` ; then
          cp /dev/null $mandir/whatis
+       fi
       done
    done
 fi



-- 
To unsubscribe:
mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to