1
0
Fork 0

ktune: do not revert sysctl settings on ktune stop

Now the sysctl settings are not reverted on ktune stop. This is to avoid cases
where the time window when the sysctl settings are reverted can cause unwanted
behaviour. E.g. it can temporary reset system limits on disk addition (because
ktune service is restarted by udev) which may cause some commands to fail.

It is still possible to switch to the old behaviour (reverting sysctl) by
exporting KTUNE_REVERT_SYSCTL and setting it to 1. This can be also
set per profile in the /etc/tune-profiles/PROFILE_NAME/ktune.sysconfig by
adding the following:

KTUNE_REVERT_SYSCTL=1

Resolves: rhbz#1111416

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2015-11-24 17:44:23 +01:00
parent 3f489dfaa6
commit abb08bb75d

View file

@ -176,8 +176,10 @@ load_sysctl() {
revert_sysctl() {
if [ -r "$SAVE_FILE" ]; then
echo -n $"Reverting to saved sysctl settings: "
load_file "$SAVE_FILE" 0
if [ "$KTUNE_REVERT_SYSCTL" = 1 ]; then
echo -n $"Reverting to saved sysctl settings: "
load_file "$SAVE_FILE" 0
fi
/bin/rm -f "$SAVE_FILE"
fi