deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/5] Core: Print warning when starting as a daemon without thin
Date Wed, 09 Jan 2013 11:29:14 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/bin/deltacloudd | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/server/bin/deltacloudd b/server/bin/deltacloudd
index d9ebcfc..18f8b94 100755
--- a/server/bin/deltacloudd
+++ b/server/bin/deltacloudd
@@ -165,7 +165,10 @@ end
 ENV["API_HOST"] = "localhost" unless ENV["API_HOST"]
 ENV["API_PORT"] = "3001" unless ENV["API_PORT"]
 
-unless options[:daemon]
+have_thin = options[:webrick].nil? && library_present?('thin')
+have_rerun = library_present?('rerun')
+
+if !options[:daemon] || options[:daemon] && !have_thin
   msg = "Starting Deltacloud API :: #{ENV["API_DRIVER"]} "
   msg << ":: #{ENV['API_PROVIDER']} " if ENV['API_PROVIDER']
   api_uri = ENV['API_FRONTEND'] == 'cimi' ? 'cimi/cloudEntryPoint' : 'api'
@@ -184,12 +187,11 @@ if ENV['API_USER'] && ENV['API_PASSWORD']
   puts
 end
 
-have_thin = options[:webrick].nil? && library_present?('thin')
-have_rerun = library_present?('rerun')
-
 unless have_thin
   require 'rack'
 
+  puts "To start Deltacloud as a daemon, install 'thin' (gem install thin)\n\n" if options[:daemon]
+
   # Read in config.ru and convert it to an instance of Rack::Builder
   cfgfile = File.read(File.join($top_srcdir, 'config.ru'))
   inner_app = eval("Rack::Builder.new {(" + cfgfile + "\n )}.to_app",
-- 
1.8.0.2


Mime
View raw message