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
This commit is contained in:
Colin Percival 2009-09-28 03:32:35 +00:00
parent 7365f12882
commit ca82268b2a
2 changed files with 6 additions and 0 deletions

View File

@ -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;;

View File

@ -50,6 +50,9 @@ case "$daily_status_security_chkmounts_enable" in
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=$?;;