Skip to content

Commit 96b02bc

Browse files
author
Adrien "ze" Urban
committed
fix(systemd): fix service detection
Fix service detection to properly ensure the service is running. Command also updated at other service.running/dead onlyif.
1 parent 4eb3804 commit 96b02bc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

mongodb/service/clean.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include:
2929
service.dead:
3030
- name: {{ servicename }}
3131
{% if grains.kernel|lower == 'linux' %}
32-
- onlyif: systemctl list-units |grep {{ servicename }} >/dev/null 2>&1
32+
- onlyif: systemctl list-unit-files |grep {{ servicename }} >/dev/null 2>&1
3333
{%- endif %} {# linux #}
3434
- enable: False
3535
{%- endif %}

mongodb/service/running.sls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ include:
3434
- reload_modules: true
3535
service.running:
3636
- name: firewalld
37-
- onlyif: systemctl list-units | grep firewalld >/dev/null 2>&1
37+
- onlyif: systemctl list-unit-files | grep firewalld >/dev/null 2>&1
3838
- enable: True
3939
{%- endif %}
4040
{%- endif %}
@@ -236,7 +236,7 @@ include:
236236
- name: {{ servicename }}
237237
- onlyif:
238238
- {{ grains.kernel|lower == 'linux' }}
239-
- systemctl list-units | grep {{ servicename }} >/dev/null 2>&1
239+
- systemctl list-unit-files | grep {{ servicename }} >/dev/null 2>&1
240240
- require:
241241
- sls: {{ sls_software_install }}
242242
- sls: {{ sls_config_users }}
@@ -253,7 +253,7 @@ include:
253253
service.running:
254254
- name: {{ servicename }}
255255
- enable: True
256-
- onlyif: systemctl list-units | grep {{ servicename }} >/dev/null 2>&1
256+
- onlyif: systemctl list-unit-files | grep {{ servicename }} >/dev/null 2>&1
257257
{%- endif %}
258258
- require:
259259
- sls: {{ sls_software_install }}

0 commit comments

Comments
 (0)