Skip to content

Commit b404856

Browse files
authored
Merge pull request #22 from eikek/patch
Fix systemd service template
2 parents 2008ff9 + b5d483d commit b404856

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/service/systemd.service.j2

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ After=multi-user.target
2121

2222
[Service]
2323
Type=simple
24-
ExecStartPre=/bin/rm -f {{ deploy_dir_app }}/RUNNING_PID
24+
Restart=on-failure
25+
{% if deploy_log_stdout == True or deploy_log_stderr == True %}
26+
ExecStart=/bin/sh -c "{{ deploy_dir_app }}/{{ deploy_service_start_command }} {% if deploy_log_stdout == True %}1> {{ deploy_log_stdout_path }}{% endif %} {% if deploy_log_stderr == True %}2>{{ deploy_log_stderr_path }}{% endif %}"
27+
{% else %}
2528
ExecStart={{ deploy_dir_app }}/{{ deploy_service_start_command }}
29+
{% endif %}
30+
ExecStopPost=/bin/rm -f {{ deploy_dir_app }}/RUNNING_PID
2631
WorkingDirectory={{ deploy_dir_app }}
2732
User={{ deploy_app_user }}
2833
Group={{ deploy_app_group }}

0 commit comments

Comments
 (0)