Skip to content

Instantly share code, notes, and snippets.

@erikwennerberg
Created October 24, 2013 19:11
Show Gist options
  • Save erikwennerberg/7143226 to your computer and use it in GitHub Desktop.
Save erikwennerberg/7143226 to your computer and use it in GitHub Desktop.
control file to use logwatch as a daemon
require 'rubygems'
require 'daemons'
file = '' # the absolute script path
pwd = Dir.pwd
Daemons.run_proc(
'newrelic_logwatcher_agent', # name of daemon
# :dir_mode => :normal
# :dir => File.join(pwd, 'tmp/pids'), # directory where pid file will be stored
# :backtrace => true,
# :monitor => true,
:log_output => false
) do
Dir.chdir(pwd)
exec "ruby #{file}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment