Skip to content

Instantly share code, notes, and snippets.

@Drewzar
Created September 22, 2011 23:08
Show Gist options
  • Save Drewzar/1236293 to your computer and use it in GitHub Desktop.
Save Drewzar/1236293 to your computer and use it in GitHub Desktop.
description "@app_name"
author "Vitrue, Inc"
start on startup
stop on shutdown
script
export HOME="/root"
<%- @env_vars.each do |k, v| -%>
export <%= k %>=<%= v %>
<%- end -%>
cd /data/<%= @app_name %>/current
sudo -E <%= "-u #{@node_user}" if @node_user %> <%= @node_bin %> <%= @main %> <%= @app_args %> 2>&1 >> log/<%= @app_name %>.log
end script
<%- if @post_stop %>
post-stop script
<%- @env_vars.each do |k, v| -%>
export <%= k %>=<%= v %>
<%- end -%>
cd /data/<%= @app_name %>/current
sudo -E <%= @node_bin %> <%= @post_stop_script %>
end script
<%- end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment