1
0
Fork 0

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:
Jiri Mencak 2021-03-17 18:03:48 +01:00
parent 0c0ad33025
commit 571a255d57

View file

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