sockd 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/listd.rb +0 -1
- data/lib/sockd/runner.rb +9 -8
- data/lib/sockd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d25ce828b55583f286558554e0fa7606403bdce4
|
4
|
+
data.tar.gz: c2d8410fe27052b5632652d89eb6076c3246e261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b030f1bd71ad93b5bb32ba1de2fd2d23e095a9c0e73b260bc8558e7c700f1b14508407750162082b17a55c06045d052e4a2dece1afd4b02c104053c019dfd148
|
7
|
+
data.tar.gz: 58ce09e8c91b0fc8d269315cf29d6aeed1e896cc03e13e41df6cfbc63f3466b52621ee80d62d7051de6e4bbdcf4b4767a32bb269e51f5ec6644f4e04c3428003
|
data/examples/listd.rb
CHANGED
data/lib/sockd/runner.rb
CHANGED
@@ -86,14 +86,15 @@ module Sockd
|
|
86
86
|
|
87
87
|
# start our service
|
88
88
|
def start
|
89
|
-
if options[:daemonize]
|
90
|
-
pid = daemon_running?
|
91
|
-
raise ProcError, "#{name} process already running (#{pid})" if pid
|
92
|
-
puts "starting #{name} process..."
|
93
|
-
return self unless daemonize
|
94
|
-
end
|
95
|
-
|
96
89
|
server do |server|
|
90
|
+
|
91
|
+
if options[:daemonize]
|
92
|
+
pid = daemon_running?
|
93
|
+
raise ProcError, "#{name} process already running (#{pid})" if pid
|
94
|
+
puts "starting #{name} process..."
|
95
|
+
return self unless daemonize
|
96
|
+
end
|
97
|
+
|
97
98
|
drop_privileges options[:user], options[:group]
|
98
99
|
|
99
100
|
setup
|
@@ -105,6 +106,7 @@ module Sockd
|
|
105
106
|
exit 130
|
106
107
|
end
|
107
108
|
|
109
|
+
log "listening on " + server.local_address.inspect_sockaddr
|
108
110
|
while true
|
109
111
|
sock = server.accept
|
110
112
|
begin
|
@@ -211,7 +213,6 @@ module Sockd
|
|
211
213
|
TCPServer.new(options[:host], options[:port])
|
212
214
|
end
|
213
215
|
begin
|
214
|
-
log "listening on " + server.local_address.inspect_sockaddr
|
215
216
|
yield(server)
|
216
217
|
ensure
|
217
218
|
server.close
|
data/lib/sockd/version.rb
CHANGED