You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/12/13 12:45:30 UTC

[PATCH core 2/5] Core: Print warning when starting as a daemon without thin

From: Michal Fojtik <mf...@redhat.com>


Signed-off-by: Michal fojtik <mf...@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


Re: [PATCH core 2/5] Core: Print warning when starting as a daemon without thin

Posted by David Lutterkort <lu...@redhat.com>.
On Thu, 2012-12-13 at 12:45 +0100, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mf...@redhat.com>
> 
> 
> Signed-off-by: Michal fojtik <mf...@redhat.com>
> ---
>  server/bin/deltacloudd | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

We should die loudly if they ask us to daemonize and we are not able to
do that; a warning isn't enough.

David