[Unit]
Name=<%= @title %> container
Requires=docker.service
After=docker.service <% if @depends[@title] -%>docker-<%= @depends[@title] -%>.service<% end %>

[Service]
Restart=on-failure
RestartSec=10
StartLimitBurst=5
StartLimitInterval=60
ExecStartPre=/usr/bin/dockerctl create <%= @title %>
ExecStart=/usr/bin/docker start -a fuel-core-<%= @release %>-<%= @title %>
ExecStop=/usr/bin/docker stop -t <%= @timeout %> fuel-core-<%= @release %>-<%= @title %>

[Install]
WantedBy=multi-user.target

[Unit]
Name=<%= @title %> container
Requires=docker.service
After=docker.service <% if @depends[@title] -%>docker-<%= @depends[@title] -%>.service<% end %>

[Service]
Restart=on-failure
RestartSec=10
StartLimitBurst=5
StartLimitInterval=60
ExecStartPre=/usr/bin/dockerctl create <%= @title %>
ExecStartPre=/usr/bin/docker start fuel-core-<%= @release %>-<%= @title %>
ExecStartPre=/usr/bin/dockerctl check <%= @title %>
ExecStart=/usr/bin/docker attach --no-stdin=true fuel-core-<%= @release %>-<%= @title %>
ExecStop=/usr/bin/docker stop -t <%= @timeout %> fuel-core-<%= @release %>-<%= @title %>

[Install]
WantedBy=multi-user.target

Check container state after start
Check container state after start

ExecStartPre steps:
  1) Create container if not exists.
  2) Start it.
  3) Make necessary checks with dockerctl.

ExecStart - attach to container for sure that
container isn't go to failed state.

Change-Id: I8fc495513c7d7c8e07c0d0eff4a671b924a9cb50
Related-Bug: #1526787
