add conditions when running in oneshot mode

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-03-13 09:47:35 -05:00
parent 36e6e7e73b
commit f944450f9e
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
1 changed files with 3 additions and 1 deletions

View File

@ -27,7 +27,7 @@ ExecStart={{ item.program_override }} {{ item.program_config_options | default('
{% else %}
ExecStart={{ systemd_bin_path }}/{{ item.service_name }} {{ item.program_config_options | default('') }}
{% endif %}
{% if item.program_reload is defined %}
{% if item.program_reload is defined and service_type != 'oneshot' %}
ExecReload={{ item.program_reload }}
{% else %}
ExecReload=/bin/kill -HUP $MAINPID
@ -39,8 +39,10 @@ ExecStop={{ item.program_stop }}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec={{ systemd_TimeoutSec }}
{% if service_type != 'oneshot' %}
Restart={{ systemd_Restart }}
RestartSec={{ systemd_RestartSec }}
{% endif %}
# This creates a specific slice which all services will operate from
# The accounting options give us the ability to see resource usage through