diff --git a/lib/session.rb b/lib/session.rb index 3f68d8ffb..77adc0b6b 100644 --- a/lib/session.rb +++ b/lib/session.rb @@ -2,6 +2,7 @@ require 'json' module Session @path = Dir.pwd.to_s + '/tmp/websocket' + @pid = Dir.pwd.to_s + '/tmp/pids/sessionworker.pid' @@user_threads = {} @@client_threads = {} @@ -93,6 +94,12 @@ module Session def self.jobs + # create pid file + $daemon_pid = File.new( @pid.to_s,"w" ) + $daemon_pid.sync = true + $daemon_pid.puts(Process.pid.to_s) + $daemon_pid.close + # just make sure that spool path exists if !File::exists?( @path ) FileUtils.mkpath @path