Skip to content

Commit

Permalink
Merge pull request #36 from Oefenweb/pr-35
Browse files Browse the repository at this point in the history
Added startsecs
  • Loading branch information
tersmitten authored Feb 21, 2017
2 parents 3d751ae + db90d36 commit c303960
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Set up the latest or a specific version of supervisor in Ubuntu systems.
* `supervisor_programs_present.{n}.autostart` [optional]: If true, this program will start automatically when supervisord is started
* `supervisor_programs_present.{n}.autorestart` [optional]: Whether the process will be autorestarted
* `supervisor_programs_present.{n}.startretries` [optional]: The number of serial failure attempts that supervisord will allow when attempting to start the program before giving up
* `supervisor_programs_present.{n}.startsecs` [optional]: The total number of seconds which the program needs to stay running after a startup to consider the start successful
* `supervisor_programs_present.{n}.stdout_logfile` [optional]: Put process stdout output in this file
* `supervisor_programs_present.{n}.stdout_logfile_maxbytes` [optional]: The maximum number of bytes that may be consumed by `stdout_logfile` before it is rotated
* `supervisor_programs_present.{n}.stderr_logfile` [optional]: Put process stderr output in this file
Expand Down
11 changes: 7 additions & 4 deletions templates/etc/supervisor/conf.d/program.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ directory={{ item.value.directory }}
environment={{ item.value.environment }}
{% endif %}
{% if item.value.autostart is defined %}
autostart={{ 'true' if item.value.autostart | bool else 'false' }}
autostart={{ item.value.autostart | default(false) | bool | to_json }}
{% endif %}
{% if item.value.autorestart is defined %}
autorestart={{ 'true' if item.value.autorestart | bool else 'false'}}
autorestart={{ item.value.autorestart | default(false) | bool | to_json}}
{% endif %}
{% if item.value.startretries is defined %}
startretries={{ item.value.startretries }}
{% endif %}
{% if item.value.startsecs is defined %}
startsecs={{ item.value.startsecs }}
{% endif %}
{% if item.value.stdout_logfile is defined %}
stdout_logfile={{ item.value.stdout_logfile }}
{% endif %}
Expand Down Expand Up @@ -47,8 +50,8 @@ stopsignal={{ item.value.stopsignal }}
stopwaitsecs={{ item.value.stopwaitsecs }}
{% endif %}
{% if item.value.stopasgroup is defined %}
stopasgroup={{ 'true' if item.value.stopasgroup | bool else 'false'}}
stopasgroup={{ item.value.stopasgroup | default(false) | bool | to_json }}
{% endif %}
{% if item.value.killasgroup is defined %}
killasgroup={{ 'true' if item.value.killasgroup | bool else 'false'}}
killasgroup={{ item.value.killasgroup | default(false) | bool | to_json }}
{% endif %}
2 changes: 1 addition & 1 deletion templates/etc/supervisor/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ password = {{ supervisor_inet_http_server_password }}
{% endif %}

[supervisord]
nodaemon={{ 'true' if supervisor_supervisord_nodaemon | bool else 'false' }} ; (supervisord nodaemon option;default false)
nodaemon={{ supervisor_supervisord_nodaemon | default(false) | bool | to_json }} ; (supervisord nodaemon option;default false)
logfile={{ supervisor_supervisord_logfile }} ; (main log file;default $CWD/supervisord.log)
pidfile={{ supervisor_supervisord_pidfile }} ; (supervisord pidfile;default supervisord.pid)
childlogdir={{ supervisor_supervisord_childlogdir }} ; ('AUTO' child log dir, default $TEMP)
Expand Down

0 comments on commit c303960

Please sign in to comment.