Added pid support.
This commit is contained in:
parent
8638a41b58
commit
ac744d3cd5
1 changed files with 7 additions and 0 deletions
|
@ -15,6 +15,7 @@ require 'optparse'
|
||||||
:d => false,
|
:d => false,
|
||||||
:k => '/path/to/server.key',
|
:k => '/path/to/server.key',
|
||||||
:c => '/path/to/server.crt',
|
:c => '/path/to/server.crt',
|
||||||
|
:i => Dir.pwd.to_s + '/tmp/pids/websocket.pid'
|
||||||
}
|
}
|
||||||
tls_options = {}
|
tls_options = {}
|
||||||
OptionParser.new do |opts|
|
OptionParser.new do |opts|
|
||||||
|
@ -43,6 +44,12 @@ end.parse!
|
||||||
puts "Starting websocket server on #{ @options[:b] }:#{ @options[:p] } (secure:#{ @options[:s].to_s })"
|
puts "Starting websocket server on #{ @options[:b] }:#{ @options[:p] } (secure:#{ @options[:s].to_s })"
|
||||||
#puts options.inspect
|
#puts options.inspect
|
||||||
|
|
||||||
|
# create pid file
|
||||||
|
$daemon_pid = File.new( @options[:i],"w" )
|
||||||
|
$daemon_pid.sync = true
|
||||||
|
$daemon_pid.puts(Process.pid.to_s)
|
||||||
|
$daemon_pid.close
|
||||||
|
|
||||||
@clients = {}
|
@clients = {}
|
||||||
@spool = []
|
@spool = []
|
||||||
EventMachine.run {
|
EventMachine.run {
|
||||||
|
|
Loading…
Reference in a new issue