From 20d94046e00c659d0a56596191bd56f6b6a537a9 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 16 Apr 2014 10:44:23 +0300 Subject: Don't daemonize by default It's useful to run interactively during startup, to get the helpful messages about missing stuff. --- lib/oxidized/cli.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/cli.rb b/lib/oxidized/cli.rb index aa8c516..d6a139d 100644 --- a/lib/oxidized/cli.rb +++ b/lib/oxidized/cli.rb @@ -4,7 +4,7 @@ module Oxidized require 'slop' def run - Process.daemon unless CFG.debug + Process.daemon if @opts[:daemonize] begin Oxidized.new rescue => error @@ -16,8 +16,8 @@ module Oxidized private def initialize - _args, opts = parse_opts - CFG.debug = true if opts[:debug] + _args, @opts = parse_opts + CFG.debug = true if @opts[:debug] end def crash error @@ -34,6 +34,7 @@ module Oxidized def parse_opts opts = Slop.new(:help=>true) do on 'd', 'debug', 'turn on debugging' + on 'daemonize', 'Daemonize/fork the process' end [opts.parse!, opts] end -- cgit v1.2.1