mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-06-10 09:10:15 -04:00
Make server instance accessible, return integer value
This commit is contained in:
parent
d5e41e328e
commit
fda4aef9c7
1 changed files with 6 additions and 2 deletions
|
|
@ -32,6 +32,7 @@ module VagrantPlugins
|
|||
|
||||
class << self
|
||||
attr_accessor :broker
|
||||
attr_accessor :server
|
||||
attr_reader :cache
|
||||
end
|
||||
@cache = Util::Cacher.new
|
||||
|
|
@ -127,9 +128,12 @@ module VagrantPlugins
|
|||
STDOUT.puts "1|1|tcp|#{bind_addr}:#{port}|grpc"
|
||||
STDOUT.flush
|
||||
logger.info("Vagrant GRPC service is now running addr=#{bind_addr.inspect} port=#{port.inspect}")
|
||||
s.run_till_terminated_or_interrupted([1, 'int', 'SIGQUIT', 'SIGINT'])
|
||||
VagrantPlugins::CommandServe.server = s
|
||||
s.run_till_terminated_or_interrupted(['EXIT', 'HUP', 'INT', 'QUIT', 'ABRT'])
|
||||
0
|
||||
ensure
|
||||
logger.info("Vagrant GRPC service is shutting down")
|
||||
VagrantPlugins::CommandServe.server = nil
|
||||
logger.info("Vagrant GRPC service shut down")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue