svn commit: r197552 - in head/etc/periodic: daily security

Colin Percival cperciva at FreeBSD.org
Mon Sep 28 03:32:35 UTC 2009


Author: cperciva
Date: Mon Sep 28 03:32:35 2009
New Revision: 197552
URL: http://svn.freebsd.org/changeset/base/197552

Log:
  Silence warning printed by getfsspec(3) when /etc/fstab does not exist
    fstab: /etc/fstab:0: No such file or directory
  and from dump(8) when setfsent(3) fails due to /etc/fstab not existing:
    DUMP: Can't open /etc/fstab for dump table information: No such...
  
  This makes daily and security periodic runs somewhat cleaner in jails
  which lack /etc/fstab files.
  
  MFC after:	1 month

Modified:
  head/etc/periodic/daily/400.status-disks
  head/etc/periodic/security/200.chkmounts

Modified: head/etc/periodic/daily/400.status-disks
==============================================================================
--- head/etc/periodic/daily/400.status-disks	Sun Sep 27 23:01:17 2009	(r197551)
+++ head/etc/periodic/daily/400.status-disks	Mon Sep 28 03:32:35 2009	(r197552)
@@ -19,6 +19,9 @@ case "$daily_status_disks_enable" in
 	df $daily_status_disks_df_flags && rc=1 || rc=3
 
 	# display which filesystems need backing up
+	if ! [ -f /etc/fstab ]; then
+		export PATH_FSTAB=/dev/null
+	fi
 
 	echo ""
 	dump W || rc=3;;

Modified: head/etc/periodic/security/200.chkmounts
==============================================================================
--- head/etc/periodic/security/200.chkmounts	Sun Sep 27 23:01:17 2009	(r197551)
+++ head/etc/periodic/security/200.chkmounts	Mon Sep 28 03:32:35 2009	(r197552)
@@ -50,6 +50,9 @@ case "$daily_status_security_chkmounts_e
 		ignore="${ignore}|^amd:"
 	esac
 	[ -n "$ignore" ] && cmd="egrep -v ${ignore#|}" || cmd=cat
+	if ! [ -f /etc/fstab ]; then
+		export PATH_FSTAB=/dev/null
+	fi
 	mount -p | sort | ${cmd} |
 	  check_diff mount - "${host} changes in mounted filesystems:"
 	rc=$?;;


More information about the svn-src-all mailing list