<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

<dict>
  <key>Label</key>
  <string>com.opscode.chef-client</string>
<%- if @launchd_mode == "interval" %>
  <key>Program</key>
  <string><%= @client_bin %></string>
  <key>StartInterval</key>
  <integer><%= node["chef_client"]["interval"] %></integer>
  <key>RunAtLoad</key>
  <true/>
<%- else %>
  <key>ProgramArguments</key>
  <array>
    <string><%= @client_bin %></string>
    <string>-i <%= node["chef_client"]["interval"] %></string>
    <string>-s <%= node["chef_client"]["splay"] %></string>
    <% node["chef_client"]["daemon_options"].each do |option| -%>
    <string><%= option %></string>
    <% end -%>
  </array>
<%- end %>
  <key>UserName</key>
  <string>root</string>
  <key>StandardOutPath</key>
  <string><%= node["chef_client"]["log_dir"] %>/client.log</string>
</dict>

</plist>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

<dict>
  <key>Label</key>
  <string>com.opscode.chef-client</string>
<%- if @launchd_mode == "interval" %>
  <key>Program</key>
  <string><%= @client_bin %></string>
  <key>StartInterval</key>
  <integer><%= node["chef_client"]["interval"] %></integer>
  <key>RunAtLoad</key>
  <true/>
<%- else %>
  <key>ProgramArguments</key>
  <array>
    <string><%= @client_bin %></string>
    <string>-i <%= node["chef_client"]["interval"] %></string>
    <string>-s <%= node["chef_client"]["splay"] %></string>
    <% node["chef_client"]["daemon_options"].each do |option| -%>
    <string><%= option %></string>
    <% end -%>
  </array>
  <key>KeepAlive</key>
  <true/>
<%- end %>
  <key>StandardOutPath</key>
  <string><%= node["chef_client"]["log_dir"] %>/client.log</string>
</dict>

</plist>

Add KeepAlive so that launchd will "daemonize" chef-client for us.
[COOK-4092] Add KeepAlive so that launchd will "daemonize" chef-client for us.

Signed-off-by: Sean OMeara <4025b808ec3cf11e3d5c9a1a3bd1e7c4003cb3a1@opscode.com>
