From 0a40ac7ec0c4c92eb39bb12654b3f6a2c3319efb Mon Sep 17 00:00:00 2001 From: Christian Harke Date: Tue, 12 May 2020 10:56:59 +0200 Subject: [PATCH] Upstart: make wibble argument configurable --- defaults/main.yml | 3 +++ templates/service/upstart.conf.j2 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 79dded8..a0ec2b6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -139,6 +139,9 @@ deploy_service_prestop_script: "" # Shell script to run if deploy_service_has_poststop_script is true deploy_service_poststop_script: "" +# If the `-b wibble` argument shall be passed to the start command (see http://upstart.ubuntu.com/cookbook/#changing-user) +deploy_service_do_wibble: False + # If true, service will start at boot time deploy_start_at_boot_time: False diff --git a/templates/service/upstart.conf.j2 b/templates/service/upstart.conf.j2 index 57fac01..4f37172 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 }}{% if deploy_service_do_wibble == True %} -b wibble{% endif %} {% if deploy_service_has_prestop_script == True %} # Pre-Stop Script