mirror of https://github.com/CISOfy/lynis.git
Added quotes
This commit is contained in:
parent
7e3c9448df
commit
f232b4f9bb
|
@ -580,7 +580,7 @@
|
|||
FS_FSTAB=""
|
||||
fi
|
||||
fi
|
||||
if [ -z "${FS_FSTAB}" ]; then # not found in fstab, check if mounted otherwise
|
||||
if [ -z "${FS_FSTAB}" ]; then # not found in fstab, check if mounted otherwise
|
||||
FS_FSTAB=$(mount | ${AWKBINARY} -v fs=${FILESYSTEM} '{ if ($3==fs) { print $6 } }')
|
||||
FOUND_FLAGS=$(mount | ${AWKBINARY} -v fs=${FILESYSTEM} '{ if ($1~"[^#]" && $3==fs) { print $6 } }' | ${SEDBINARY} 's/,/ /g' | ${TRBINARY} '\n' ' ')
|
||||
else
|
||||
|
@ -668,7 +668,6 @@
|
|||
# Description : Check for nodirtime option
|
||||
|
||||
# Want to contribute to Lynis? Create this test
|
||||
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
|
@ -676,7 +675,6 @@
|
|||
# Description : Check for relatime
|
||||
|
||||
# Want to contribute to Lynis? Create this test
|
||||
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
|
@ -695,12 +693,12 @@
|
|||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
SWAPLEVEL=$(${CAT_BINARY} /proc/sys/vm/swappiness)
|
||||
LogText "Test: checking level of vm.swappiness: ${SWAPLEVEL}"
|
||||
PHYSDISK=$(${LSBLKBINARY} | ${GREPBINARY} -E 'disk|SWAP' | ${GREPBINARY} -B1 SWAP | ${HEADBINARY} -n1 | ${AWKBINARY} '{print $1}')
|
||||
PHYSDISK=$(${LSBLKBINARY} | ${GREPBINARY} -E 'disk|SWAP' | ${GREPBINARY} -B1 SWAP | ${HEADBINARY} -n1 | ${AWKBINARY} '{print $1}')
|
||||
if [ ${SWAPLEVEL} -gt 60 ]; then
|
||||
LogText "Result: vm.swappiness=${SWAPLEVEL} meaning that swapping is more frequent than default."
|
||||
# Check if swap is on a HDD or SDD for frequent swapping
|
||||
if [ -d /sys/block/${PHYSDISK} ]; then
|
||||
HDDORSDD=$(${CAT_BINARY} /sys/block/${PHYSDISK}/queue/rotational)
|
||||
# Check if swap is on a HDD or SDD for frequent swapping
|
||||
if [ -d "/sys/block/${PHYSDISK}" ]; then
|
||||
HDDORSDD=$(${CAT_BINARY} "/sys/block/${PHYSDISK}/queue/rotational")
|
||||
if [ ${HDDORSDD} -eq 1 ]; then
|
||||
ReportSuggestion "${TEST_NO}" "vm.swappiness set to: ${SWAPLEVEL} > 60 (default) - consider installing an SSD for swap partition for better performance."
|
||||
fi
|
||||
|
@ -708,7 +706,7 @@
|
|||
elif [ ${SWAPLEVEL} -eq 0 ]; then
|
||||
LogText "Result: vm.swappiness=${SWAPLEVEL} meaning swapping is disabled."
|
||||
ReportSuggestion "${TEST_NO}" "vm.swappiness set to: ${SWAPLEVEL}. Consider setting value to minimum of 1 for minimizing swappiness, but not quite disabling it. Will prevent OOM killer from killing processes when running out of physical memory."
|
||||
elif [ ${SWAPLEVEL} -eq 1]; then
|
||||
elif [ ${SWAPLEVEL} -eq 1 ]; then
|
||||
LogText "Result: vm.swappiness=${SWAPLEVEL} meaning that swapping can still occur but at very minimum."
|
||||
elif [ ${SWAPLEVEL} -eq 10 ]; then
|
||||
LogText "Result: vm.swappiness=${SWAPLEVEL} which is the preferred setting for database servers."
|
||||
|
@ -717,6 +715,7 @@
|
|||
else
|
||||
LogText "Result: vm.swappiness=${SWAPLEVEL} which is the standard level of swappiness and works well for desktop systems."
|
||||
fi
|
||||
if IsVerbose; then Display --indent 2 --text "- Swappiness: ${SWAPLEVEL}" --result "INFO" --color WHITE; fi
|
||||
fi
|
||||
#
|
||||
#################################################################################
|
||||
|
|
Loading…
Reference in New Issue