#!/bin/sh # # This script stolen from set-tmpfs-limit.fin with only minimal # modifications to make it work. # Harry Hoffman # This script installs logging on all ufs filesystems if not already # set via the jumpstart profile. # if check_os_min_revision 5.7 ; then VFSTAB=${JASS_ROOT_DIR}/etc/vfstab echo "Setting logging on all ufs filesystems." echo "" if [ -f ${VFSTAB} ]; then if [ `grep -c logging ${VFSTAB}` = 0 ]; then backup_file ${VFSTAB} echo "Setting logging on all ufs filesystems." echo "" cat ${VFSTAB}.${JASS_SUFFIX} |\ nawk ' $4 ~ /ufs/ { n = split($7, a, ","); found_size = 0; arg = ""; if (a[1] ~ /\-/) { arg=sizeStr; } else { for (i = 0; i <= n; i++) { if (a[i] ~ /^size=/) { found_size=1; } if (arg == "") { arg = a[i]; } else { arg = arg","a[i]; } } if (found_size == 0) { arg = arg",logging"; } } printf("%s %s %s %s %s %s %s\n", $1, $2, $3, $4, $5, $6, arg); continue; } { print $0; }' sizeStr=logging > ${VFSTAB} fi else log_notice "The file, ${VFSTAB}, could not be found." fi else log_notice "UFS logging can only be done on Solaris 2.7+." fi