kstats-node 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -14,6 +14,9 @@ rdoc
14
14
  spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
+ test/*.pid
18
+ test/*.log
19
+ test/*.sqlite3
17
20
  tmp
18
21
  *.bundle
19
22
  *.so
@@ -0,0 +1,69 @@
1
+ #!/bin/bash
2
+ #
3
+ # Launch kstats-node as a service. Log everything into a log file, create a pid file used to start/stop the service.
4
+ #
5
+ #
6
+
7
+ COMMAND="$1" #start/stop/restart
8
+ shift 1
9
+
10
+ while getopts p:l:c: o
11
+ do
12
+ case "$o" in
13
+ p)
14
+ PIDFILE="$OPTARG";;
15
+ l)
16
+ LOGFILE="$OPTARG";;
17
+ c)
18
+ CONFIG="$OPTARG";;
19
+ [?])
20
+ echo >&2 "Usage: $0 [start|stop|restart|force-reload] -p pidfile -l logfile -c configfile"
21
+ exit 1;;
22
+ esac
23
+ done
24
+
25
+ if [[ -z "$LOGFILE" || -z "PIDFILE" || -z "$CONFIG" ]]; then
26
+ echo >&2 "Usage: $0 [start|stop|restart|force-reload] -p pidfile -l logfile -c configfile"
27
+ exit 1
28
+ fi
29
+
30
+ case "$COMMAND" in
31
+ start)
32
+ if [[ -e "$PIDFILE" ]]; then
33
+ echo "'$PIDFILE' already exists. Try to stop running kstats-node first"
34
+ exit 1
35
+ fi
36
+
37
+ echo "Start kstats-node..."
38
+ (kstats-node --config $CONFIG > $LOGFILE 2>&1)&
39
+ echo $! > $PIDFILE
40
+ echo "kstats-node started."
41
+ ;;
42
+ stop)
43
+ echo "Stop kstats-node..."
44
+ if [[ -e "$PIDFILE" ]]; then
45
+ kill `cat $PIDFILE`
46
+ rm $PIDFILE
47
+ echo "kstats-node stopped."
48
+ else
49
+ echo "Nothing to stop."
50
+ exit 1
51
+ fi
52
+ ;;
53
+ restart|force-reload)
54
+ echo "Restart kstats-node..."
55
+ if [[ -e "$PIDFILE" ]]; then
56
+ kill `cat $PIDFILE`
57
+ rm $PIDFILE
58
+ fi
59
+ (kstats-node --config $CONFIG > $LOGFILE 2>&1)&
60
+ echo $! > $PIDFILE
61
+ echo "kstats-node restarted."
62
+ ;;
63
+ *)
64
+ echo >&2 "Usage: $0 [start|stop|restart|force-reload] -p pidfile -l logfile -c configfile"
65
+ exit 1
66
+ ;;
67
+ esac
68
+
69
+ exit 0
data/kstats-node.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = %q{Provide a simple way to make probe on system values, and monitoring theses values.}
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
- spec.executables << 'kstats-node'
15
+ spec.executables += %w(kstats-node kstats-node-service)
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0")
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -1,5 +1,5 @@
1
1
  module Kstats
2
2
  module Node
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kstats-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-29 00:00:00.000000000 Z
12
+ date: 2014-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -81,6 +81,7 @@ email:
81
81
  - yacine@kosmogo.com
82
82
  executables:
83
83
  - kstats-node
84
+ - kstats-node-service
84
85
  extensions: []
85
86
  extra_rdoc_files: []
86
87
  files:
@@ -90,6 +91,7 @@ files:
90
91
  - README.md
91
92
  - Rakefile
92
93
  - bin/kstats-node
94
+ - bin/kstats-node-service
93
95
  - kstats-node.gemspec
94
96
  - lib/kstats/node.rb
95
97
  - lib/kstats/node/app.rb
@@ -104,7 +106,6 @@ files:
104
106
  - lib/kstats/probes/mem.rb
105
107
  - test/conf.yml
106
108
  - test/conf/conf.yml
107
- - test/db.sqlite3
108
109
  - test/probes/cpu.rb
109
110
  - test/probes/disk.rb
110
111
  - test/probes/mem.rb
@@ -136,7 +137,6 @@ summary: Node for the project kstats
136
137
  test_files:
137
138
  - test/conf.yml
138
139
  - test/conf/conf.yml
139
- - test/db.sqlite3
140
140
  - test/probes/cpu.rb
141
141
  - test/probes/disk.rb
142
142
  - test/probes/mem.rb
data/test/db.sqlite3 DELETED
Binary file