nfagent 0.0.1 → 0.0.99

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -1,6 +1,5 @@
1
1
  Rakefile
2
2
  lib/nfagent.rb
3
- lib/nfagent.init
4
3
  lib/nfagent
5
4
  lib/nfagent/cli.rb
6
5
  lib/nfagent/base64.rb
@@ -18,5 +17,6 @@ bin/squid_log_writer
18
17
  PostInstall.txt
19
18
  History.txt
20
19
  Manifest.txt
21
- nfagent.init
22
20
  nfagent.conf
21
+ nfagent.init.ubuntu.txt
22
+ nfagent.init.redhat.txt
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ $hoe = Hoe.spec('nfagent') do |p|
11
11
  p.post_install_message = 'PostInstall.txt'
12
12
  p.rubyforge_name = p.name
13
13
  p.extra_deps = [
14
- ['svutil','>= 0.0.3'],
14
+ ['svutil','>= 0.0.3'], ['eventmachine', '>= 0.12.8']
15
15
  ]
16
16
  p.extra_dev_deps = [
17
17
  ['newgem', ">= #{::Newgem::VERSION}"]
data/lib/nfagent.rb CHANGED
@@ -24,5 +24,5 @@ require 'nfagent/server'
24
24
  require 'nfagent/cli'
25
25
 
26
26
  module NFAgent
27
- VERSION = '0.0.1'
27
+ VERSION = '0.0.99'
28
28
  end
@@ -9,10 +9,6 @@ module NFAgent
9
9
  EM.run {
10
10
  EM.start_server "0.0.0.0", 10000, Event, chunk_handler
11
11
  }
12
-
13
- #Tail.tail(Config.proxy_log) do |line|
14
- # chunk_handler.submit(line)
15
- #end
16
12
  end
17
13
  end
18
14
  end
@@ -0,0 +1,57 @@
1
+ #!/bin/bash
2
+ #cortex
3
+ #
4
+ # chkconfig: 345 80 10
5
+ # description: NetFox Agent
6
+
7
+ . /etc/rc.d/init.d/functions
8
+
9
+ NFAGENT_OPTS="-f /etc/nfagent.conf -d"
10
+ NFAGENT_PID=/var/run/nfagent.pid
11
+
12
+ if [ -f /etc/sysconfig/nfagent ]; then
13
+ . /etc/sysconfig/nfagent
14
+ fi
15
+
16
+ start () {
17
+ echo -n "Starting NetFox Agent: "
18
+ /usr/bin/nfagent $NFAGENT_OPTS -i $NFAGENT_PID
19
+ echo "Done"
20
+ }
21
+
22
+ stop() {
23
+ echo -n $"Shutting down NetFox Agent: "
24
+ if [ -f $NFAGENT_PID ]; then
25
+ kill `cat $NFAGENT_PID`
26
+ sleep 1
27
+ echo "Done"
28
+ else
29
+ echo "NetFox Agent wasn't running"
30
+ fi
31
+ }
32
+
33
+ # See how we were called.
34
+ case "$1" in
35
+ start)
36
+ start
37
+ ;;
38
+ stop)
39
+ stop
40
+ ;;
41
+ restart)
42
+ stop
43
+ sleep 2
44
+ start
45
+ RETVAL=$?
46
+ ;;
47
+ status)
48
+ status nfagent
49
+ RETVAL=$?
50
+ ;;
51
+ *)
52
+ echo $"Usage: $0 {start|stop|restart|status}"
53
+ exit 1
54
+ esac
55
+
56
+ exit $RETVAL
57
+
@@ -14,7 +14,8 @@ set -e
14
14
 
15
15
  # /etc/init.d/pgship: start and stop the PGShip WAL Shipping Service
16
16
 
17
- PGSHIP_OPTS="-f /etc/nfagent.conf -d"
17
+ NFAGENT_OPTS="-f /etc/nfagent.conf -d"
18
+ NFAGENT_PID="/var/run/nfagent.pid"
18
19
 
19
20
  # Are we running from init?
20
21
  run_by_init() {
@@ -26,7 +27,7 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
26
27
  case "$1" in
27
28
  start)
28
29
  log_daemon_msg "NetFox Agent" "nfagent"
29
- if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/pgship.pid --exec /usr/sbin/pgship.bin -- $PGSHIP_OPTS; then
30
+ if start-stop-daemon --start --quiet --oknodo --pidfile $NFAGENT_PID --exec /usr/bin/nfagent -- $NFAGENT_OPTS; then
30
31
  log_end_msg 0
31
32
  else
32
33
  log_end_msg 1
@@ -34,7 +35,7 @@ case "$1" in
34
35
  ;;
35
36
  stop)
36
37
  log_daemon_msg "NetFox Agent" "nfagent"
37
- if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/pgship.pid; then
38
+ if start-stop-daemon --stop --quiet --oknodo --pidfile $NFAGENT_PID; then
38
39
  log_end_msg 0
39
40
  else
40
41
  log_end_msg 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.99
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Draper
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-22 00:00:00 +09:30
12
+ date: 2009-11-05 00:00:00 +10:30
13
13
  default_executable: nfagent
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,6 +22,16 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.0.3
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: eventmachine
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.12.8
34
+ version:
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: newgem
27
37
  type: :development
@@ -54,10 +64,11 @@ extra_rdoc_files:
54
64
  - PostInstall.txt
55
65
  - History.txt
56
66
  - Manifest.txt
67
+ - nfagent.init.ubuntu.txt
68
+ - nfagent.init.redhat.txt
57
69
  files:
58
70
  - Rakefile
59
71
  - lib/nfagent.rb
60
- - lib/nfagent.init
61
72
  - lib/nfagent/cli.rb
62
73
  - lib/nfagent/base64.rb
63
74
  - lib/nfagent/encoder.rb
@@ -74,8 +85,9 @@ files:
74
85
  - PostInstall.txt
75
86
  - History.txt
76
87
  - Manifest.txt
77
- - nfagent.init
78
88
  - nfagent.conf
89
+ - nfagent.init.ubuntu.txt
90
+ - nfagent.init.redhat.txt
79
91
  has_rdoc: true
80
92
  homepage:
81
93
  licenses: []
data/lib/nfagent.init DELETED
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
-
3
- # nfagent This shell script takes care of starting and stopping
4
- #
5
- # chkconfig: 345 98 98
6
- # description: The NetFox logging agent
7
-
8
- start () {
9
-
10
- }