anchor.diff:    <% end -%>
   
     <% if @pre_start -%>
  -     env ACTION="pre-start" IMAGE="<%= @image %>" NAME="<%= @name %>" <%= @pre_start %>
  +     env ACTION="pre-start" \
  +         CID="`cat /var/run/docker-<%= @sanitised_title %>.cid` 2>/dev/null" \
  +         CIDFILE="/var/run/docker-<%= @sanitised_title %>.cid" \
  +	 IMAGE="<%= @image %>" \
  +         NAME="<%= @name %>" \
  +         <%= @pre_start %>
     <% end -%>
     true
   end script
   
   post-start script
      <% if @post_start -%>
  -     env ACTION="post-start" CID="`cat /var/run/docker-<%= @sanitised_title %>.cid`" \
  -         IMAGE="<%= @image %>" NAME="<%= @name %>" <%= @post_start %>
  +     env ACTION="post-start" \
  +         CID="`cat /var/run/docker-<%= @sanitised_title %>.cid` 2>/dev/null" \
  +         CIDFILE="/var/run/docker-<%= @sanitised_title %>.cid" \
  +         IMAGE="<%= @image %>" \
  +	 NAME="<%= @name %>" \
  +         <%= @post_start %>
      <% end -%>
      true
   end script
  
positive.code: post-stop script
  if [ -e "/var/run/docker-<%= @sanitised_title %>.cid" ]; then
    <% if @post_stop -%>
     env ACTION="post-stop" CID="`cat /var/run/docker-<%= @sanitised_title %>.cid`" \
         IMAGE="<%= @image %>" NAME="<%= @name %>" <%= @post_stop %>
    <% end -%>
    <%= @docker_command %> kill "$(cat /var/run/docker-<%= @sanitised_title %>.cid)" && \
        rm "/var/run/docker-<%= @sanitised_title %>.cid"
  else
    <% if @post_stop -%>
     env ACTION="post-stop" IMAGE="<%= @image %>" NAME="<%= @name %>" <%= @post_stop %>
    <% else -%>
     true
    <% end -%>
  
negative.code: 
  pre-stop script
    <% if @pre_stop -%>
       env ACTION="pre-stop" \
           CID="`cat /var/run/docker-<%= @sanitised_title %>.cid` 2>/dev/null" \
           CIDFILE="/var/run/docker-<%= @sanitised_title %>.cid" \
           IMAGE="<%= @image %>" \
  	 NAME="<%= @name %>" \
  	 <%= @pre_stop %>
    <% end -%>
    true
  end script
  