summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroedie <github@roedie.nl>2016-05-25 12:00:33 +0200
committerroedie <github@roedie.nl>2016-05-25 12:00:33 +0200
commit511508b9e2768e116978fc8e973d34afb1d999ab (patch)
treef421c36b1cd4ab4ff77b3ac95c147556f26cee1c
parent5c6904020c57a6904c09276ba3ab4a4cda8550b2 (diff)
Support setting pidfile location
-rw-r--r--README.md1
-rw-r--r--lib/oxidized/cli.rb2
-rw-r--r--lib/oxidized/config.rb1
3 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index cc19144..2186ff5 100644
--- a/README.md
+++ b/README.md
@@ -551,6 +551,7 @@ vars:
enable: S3cr3tx
groups: {}
rest: 127.0.0.1:8888
+pid: ~/.config/oxidized/oxidized.pid
input:
default: ssh, telnet
debug: false
diff --git a/lib/oxidized/cli.rb b/lib/oxidized/cli.rb
index 0594dcb..9a09d41 100644
--- a/lib/oxidized/cli.rb
+++ b/lib/oxidized/cli.rb
@@ -24,7 +24,7 @@ module Oxidized
Config.load(@opts)
Oxidized.setup_logger
- @pidfile = File.join(Oxidized::Config::Root, 'pid')
+ @pidfile = File.expand_path(Oxidized.config.pid)
end
def crash error
diff --git a/lib/oxidized/config.rb b/lib/oxidized/config.rb
index 7884625..1797be6 100644
--- a/lib/oxidized/config.rb
+++ b/lib/oxidized/config.rb
@@ -30,6 +30,7 @@ module Oxidized
asetus.default.rest = '127.0.0.1:8888' # or false to disable
asetus.default.vars = {} # could be 'enable'=>'enablePW'
asetus.default.groups = {} # group level configuration
+ asetus.default.pid = File.join(Oxidized::Config::Root, 'pid')
asetus.default.input.default = 'ssh, telnet'
asetus.default.input.debug = false # or String for session log file