description "Druid <%= @node_type %> daemon"

start on runlevel [2345]
stop on runlevel [016]

kill signal INT
kill timeout 10

setuid <%= @user %>
setgid <%= @group %>

script
  exec java -cp <%= @config_dir %>:<%= @install_dir %>/current/lib/* -server <%= @java_opts %> -Duser.timezone=<%= @timezone %> -Dfile.encoding=<%= @encoding %> io.druid.cli.Main server <%= @node_type %> <%= @command_suffix %>
end script

post-start script
  tries=0
  while [ ! `netstat --listen | grep -qE '<%= @port %>|ircd'` ] && [ $tries -lt 3 ]; do
    sleep 1
    tries=$((tries + 1))
  done
end script
description "Druid <%= @node_type %> daemon"

start on runlevel [2345]
stop on runlevel [016]

kill signal INT
kill timeout 10

setuid <%= @user %>
setgid <%= @group %>

script
  chdir <%= @install_dir %>/current
  exec java -cp <%= @config_dir %>:<%= @install_dir %>/current/lib/* -server <%= @java_opts %> -Duser.timezone=<%= @timezone %> -Dfile.encoding=<%= @encoding %> io.druid.cli.Main server <%= @node_type %> <%= @command_suffix %>
end script

post-start script
  tries=0
  while [ ! `netstat --listen | grep -qE '<%= @port %>|ircd'` ] && [ $tries -lt 3 ]; do
    sleep 1
    tries=$((tries + 1))
  done
end script
Change directory to install dir
Change directory to install dir
