summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-04-16 10:44:23 +0300
committerSaku Ytti <saku@ytti.fi>2014-04-16 10:44:23 +0300
commit20d94046e00c659d0a56596191bd56f6b6a537a9 (patch)
tree0d64cc25bc9fc7f3a25bb170f71fde641822be84
parent1bed2df4d00f11737b14c6082529d1c6e091bb29 (diff)
Don't daemonize by default0.0.54
It's useful to run interactively during startup, to get the helpful messages about missing stuff.
-rw-r--r--README.md4
-rw-r--r--lib/oxidized/cli.rb7
-rw-r--r--oxidized.gemspec2
3 files changed, 7 insertions, 6 deletions
diff --git a/README.md b/README.md
index de75351..9944892 100644
--- a/README.md
+++ b/README.md
@@ -12,10 +12,10 @@
* early days, but try:
1. apt-get install libsqlite3-dev libssl-dev
2. gem install oxidized oxidized-web
- 3. oxidized -d
+ 3. oxidized
4. vi ~/.config/oxidized/config
5. (maybe point to your rancid/router.db or copy it there)
- 6. oxidized -d
+ 6. oxidized
# API
## Input
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
diff --git a/oxidized.gemspec b/oxidized.gemspec
index 34287c2..1145bd7 100644
--- a/oxidized.gemspec
+++ b/oxidized.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'oxidized'
- s.version = '0.0.53'
+ s.version = '0.0.54'
s.platform = Gem::Platform::RUBY
s.authors = [ 'Saku Ytti' ]
s.email = %w( saku@ytti.fi )