Merge "Suppress 'Service' directive if ListenStream is specified"

This commit is contained in:
Zuul 2022-01-13 15:25:43 +00:00 committed by Gerrit Code Review
commit c0a5954685
2 changed files with 5 additions and 1 deletions

View File

@ -129,7 +129,8 @@ systemd_environment: {}
# `before_targets` -- (optional) Start the socket before this list of dependency units.
# `bind_targets` -- (optional) Bind the socket to this dependency unit.
# `enabled` -- (optional) Set the enabled state of the socket.
# `options` -- (optional) Additional options, like `ListenStream` or other
# `options` -- (optional) Additional options, like `ListenStream` or other. Specifying ListenStream in
# the options will suppress the default 'Service' field in [Socket].
# `state` -- (optional) Set the running state of the socket.
# Under the service dictionary the "timer" key can be added which will enable a given service

View File

@ -13,7 +13,10 @@ BindsTo={{ target }}
{% endfor %}
[Socket]
{% if 'ListenStream' not in item.1.options %}
Service={{ item.0.service_name | replace(' ', '_') }}.service
{% endif %}
{% for key, var in item.1.options.items() | default({}) %}
{{ key }}={{ var }}
{% endfor %}