From ff94f095b618455e44055959e1bf8f3d0d7d5b08 Mon Sep 17 00:00:00 2001 From: Deimos Date: Fri, 5 Jul 2019 20:05:35 -0600 Subject: [PATCH] Fix run/restart method for transparent_hugepage The previous method of doing this could cause redis to try to start up (via restart) earlier than it should. By using require_in and watch_in, it should now only start up in the first place once this service has been started first, and it will also cause redis to restart if it ever needs to run again in the future. --- salt/salt/redis/init.sls | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/salt/redis/init.sls b/salt/salt/redis/init.sls index eb2d41e..d02c1fc 100644 --- a/salt/salt/redis/init.sls +++ b/salt/salt/redis/init.sls @@ -84,13 +84,17 @@ redis-user: - require_in: - service: disable-transparent-hugepage -# enable the "disable transparent hugepage" service, and run it + restart redis if necessary +# enable the "disable transparent hugepage" service and run it disable-transparent-hugepage: service.enabled: - name: transparent_hugepage.service cmd.run: - - name: systemctl start transparent_hugepage.service && systemctl restart redis.service + - name: systemctl start transparent_hugepage.service - unless: 'cat /sys/kernel/mm/transparent_hugepage/enabled | grep \\[never\\]' + - require_in: + - service: redis.service + - watch_in: + - service: redis.service # Set kernel overcommit mode (recommended for Redis) overcommit-memory: