Skip to content

Commit

Permalink
Merge pull request #22 from eikek/patch
Browse files Browse the repository at this point in the history
Fix systemd service template
  • Loading branch information
frne authored Mar 13, 2019
2 parents 2008ff9 + b5d483d commit b404856
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion templates/service/systemd.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ After=multi-user.target

[Service]
Type=simple
ExecStartPre=/bin/rm -f {{ deploy_dir_app }}/RUNNING_PID
Restart=on-failure
{% if deploy_log_stdout == True or deploy_log_stderr == True %}
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 %}"
{% else %}
ExecStart={{ deploy_dir_app }}/{{ deploy_service_start_command }}
{% endif %}
ExecStopPost=/bin/rm -f {{ deploy_dir_app }}/RUNNING_PID
WorkingDirectory={{ deploy_dir_app }}
User={{ deploy_app_user }}
Group={{ deploy_app_group }}
Expand Down

0 comments on commit b404856

Please sign in to comment.