Created
October 24, 2013 19:11
-
-
Save erikwennerberg/7143226 to your computer and use it in GitHub Desktop.
control file to use logwatch as a daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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