syslogstash 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1e482db553fd58fa24c01ad386c6e025c7f5803
4
- data.tar.gz: a09ec42a4bcd0a10e0a96f9bf0b4b9ba0775c393
3
+ metadata.gz: 1d3e431ae7c66eafbe07686b87f012d63bc563e1
4
+ data.tar.gz: 29156c243ffbc6c4b84aaa92105f2db286c239ca
5
5
  SHA512:
6
- metadata.gz: 307fcd4284d854a967c1b7e09e033f30fd34a1106ef905d8fe034e8f32d9f398ee119e7e70002d4b17b9a960ea72624979946bff70a4b0925b2cf6f175652a82
7
- data.tar.gz: fb38a1494174ae8233cd5d7acf3f5496ffc50729e99242d1ac0024aa3f05de52a96abbe0ef477d4cbabfb65926f9f71350e3426ef0ea95103c6415a1f86ed23c
6
+ metadata.gz: 51a912d37ea4eb14891eb6256bc6d0465e0eab7afd53e057951fc83cedcc8be39b35b22c1f97492cae32ad5f320d36a89c8ae9017faa4abacdfcf2c83a412aa0
7
+ data.tar.gz: a3d81b2f2195f005f2665fb470f644f38360713ce51f8ac163c0f826d5d598d39539643e6df919dcef575f0b28298afcb89e00a784d309ab0d31a4ee77741390
@@ -16,13 +16,17 @@ class Syslogstash::SyslogReader
16
16
  def run
17
17
  debug { "#run called" }
18
18
 
19
- if File.exists?(@file)
19
+ begin
20
+ socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0)
21
+ socket.bind(Socket.pack_sockaddr_un(@file))
22
+ rescue Errno::EEXIST
20
23
  File.unlink(@file)
24
+ retry
25
+ rescue SystemCallError
26
+ $stderr.puts "Error while trying to bind to #{@file}"
27
+ raise
21
28
  end
22
29
 
23
- socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0)
24
- socket.bind(Socket.pack_sockaddr_un(@file))
25
-
26
30
  @worker = Thread.new do
27
31
  begin
28
32
  loop do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syslogstash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-04 00:00:00.000000000 Z
11
+ date: 2015-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler