description "Margarine daemon process."

setuid <%= node['margarine']['user'] %>
setgid <%= node['margarine']['group'] %>

console output

start on ((
     started network-interface
 or  started network-manager
 or  started networking)
 and started rsyslog)

stop on runlevel [!345]

<% if node['margarine']['install']['method'] == 'source' -%>
env PYTHONPATH=<%= node['margarine']['install']['path'] %>
<% end -%>
exec <%= node['margarine']['install']['method'] == 'source' ? node['margarine']['install']['path'] : '' %>/bin/<%= @service %>

description "Margarine daemon process."

setuid <%= node['margarine']['user'] %>
setgid <%= node['margarine']['group'] %>

console output

start on ((
     started network-interface
 or  started network-manager
 or  started networking)
 and started rsyslog)

stop on runlevel [!345]

<% if node['margarine']['install']['method'] == 'source' -%>
env PYTHONPATH=<%= node['margarine']['install']['path'] %>
<% end -%>
exec <%= node['margarine']['install']['method'] =~ /source|vagrant/ ? node['margarine']['install']['path'] : '' %>/bin/<%= @service %>

Add installation path for source and vagrant installs.
Add installation path for source and vagrant installs.

Needed to add vagrant to the logic that allows the installation prefix
to be used to determine the path to the binary.
