From 5bce052ab9a74a93aac5cccbfce365788b7f782b Mon Sep 17 00:00:00 2001 From: Christian Harke Date: Wed, 9 Mar 2022 11:50:11 +0100 Subject: [PATCH] Do not truncate stderr and stdout logs on application start --- templates/service/systemd.service.j2 | 2 +- templates/service/upstart.conf.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/service/systemd.service.j2 b/templates/service/systemd.service.j2 index 65f2d89..ab6dc63 100644 --- a/templates/service/systemd.service.j2 +++ b/templates/service/systemd.service.j2 @@ -23,7 +23,7 @@ After=multi-user.target Type=simple 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 %}" +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 %} diff --git a/templates/service/upstart.conf.j2 b/templates/service/upstart.conf.j2 index 57fac01..bfba5fa 100644 --- a/templates/service/upstart.conf.j2 +++ b/templates/service/upstart.conf.j2 @@ -47,7 +47,7 @@ end script {% endif %} # Execute deploy_service_start_command and log stdout -exec su -s /bin/sh -c 'exec "$0" "$@" {% if deploy_log_stdout == True %}1>>{{ deploy_log_stdout_path }}{% endif %} {% if deploy_log_stderr == True %}2>>{{ deploy_log_stderr_path }}{% endif %}' {{ deploy_app_user }} -- {{ deploy_service_start_command }} -b wibble +exec su -s /bin/sh -c 'exec "$0" "$@" {% if deploy_log_stdout == True %}1>> {{ deploy_log_stdout_path }}{% endif %} {% if deploy_log_stderr == True %}2>> {{ deploy_log_stderr_path }}{% endif %}' {{ deploy_app_user }} -- {{ deploy_service_start_command }} -b wibble {% if deploy_service_has_prestop_script == True %} # Pre-Stop Script