Skip to content

Commit

Permalink
fix(hugepages): fix enabling service
Browse files Browse the repository at this point in the history
systemd needs a systemctl daemon-reload before we can enable the service
  • Loading branch information
Adrien "ze" Urban authored and Adrien "ze" Urban committed Jan 24, 2022
1 parent e2e88ef commit c33697b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mongodb/service/running.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include:
{%- if grains.kernel|lower == 'linux' %}
{%- if d.wanted.disable_transparent_hugepages %}
{{ formula }}-service-running-prerequisites-hugepages:
{{ formula }}-service-running-prerequisites-hugepages-service:
file.managed:
- name: /etc/init.d/disable-transparent-hugepages
- source: salt://{{ formula }}/files/disable-transparent-hugepages.init
Expand All @@ -23,15 +23,20 @@ include:
- require:
- sls: {{ sls_software_install }}
- sls: {{ sls_config_users }}
cmd.wait:
- name: systemctl daemon-reload
- watch:
- file: {{ formula }}-service-running-prerequisites-hugepages-service
- require_in:
- service: {{ formula }}-service-running-prerequisites-hugepages-service
service.enabled:
- name: disable-transparent-hugepages
- require:
- file: {{ formula }}-service-running-prerequisites-hugepages
- file: {{ formula }}-service-running-prerequisites-hugepages-service
{{ formula }}-service-running-prerequisites-hugepages-now:
cmd.run:
- name: echo never >/sys/kernel/mm/transparent_hugepage/enabled
- unless: "grep '[[]never[]]' /sys/kernel/mm/transparent_hugepage/enabled"
- require:
- file: {{ formula }}-service-running-prerequisites-hugepages
{% endif %}
{%- if d.wanted.firewall %}
Expand Down

0 comments on commit c33697b

Please sign in to comment.