Prevent unnecessary ksm* error log messages.
Check the presence of ksm and ksmtuned units before (un)masking them. Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
This commit is contained in:
parent
0c0ad33025
commit
571a255d57
1 changed files with 4 additions and 0 deletions
|
|
@ -559,6 +559,8 @@ disable_ksm()
|
|||
if ! touch $KSM_MASK_FILE; then
|
||||
die "failed to create $KSM_MASK_FILE"
|
||||
fi
|
||||
# Do not run any systemctl commands if $KSM_SERVICES units do not exist
|
||||
systemctl cat -- $KSM_SERVICES &> /dev/null || return
|
||||
systemctl --now --quiet mask $KSM_SERVICES
|
||||
# Unmerge all shared pages
|
||||
test -f $KSM_RUN_PATH && echo 2 > $KSM_RUN_PATH
|
||||
|
|
@ -569,6 +571,8 @@ disable_ksm()
|
|||
enable_ksm()
|
||||
{
|
||||
if [ -f $KSM_MASK_FILE ]; then
|
||||
# Do not run any systemctl commands if $KSM_SERVICES units do not exist
|
||||
systemctl cat -- $KSM_SERVICES &> /dev/null || return
|
||||
if systemctl --quiet unmask $KSM_SERVICES; then
|
||||
rm -f $KSM_MASK_FILE
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue