Index: trunk/projects/mongrel_service/lib/mongrel_service/init.rb =================================================================== --- trunk/projects/mongrel_service/lib/mongrel_service/init.rb (revision 325) +++ trunk/projects/mongrel_service/lib/mongrel_service/init.rb (working copy) @@ -27,7 +27,8 @@ ['-C', '--config PATH', "Use a config file", :@config_file, nil], ['-S', '--script PATH', "Load the given file as an extra config script.", :@config_script, nil], ['-u', '--cpu CPU', "Bind the process to specific cpu, starting from 1.", :@cpu, nil], - ['', '--prefix PATH', "URL prefix for Rails app", :@prefix, nil] + ['', '--prefix PATH', "URL prefix for Rails app", :@prefix, nil], + ['', '--start-type TYPE', "service start: 'auto' or 'manual' (default)", :@svc_start_type, 'manual'] ] end @@ -54,6 +55,7 @@ valid? app_exist == true, "The path you specified isn't a valid Rails application." + valid? @prefix[-1].chr != "/", "Don't put / at the end of your prefix" if @prefix valid_dir? File.dirname(@log_file), "Path to log file not valid: #@log_file" valid_dir? File.dirname(@pid_file), "Path to pid file not valid: #@pid_file" valid_dir? @docroot, "Path to docroot not valid: #@docroot" @@ -70,6 +72,7 @@ end valid? @svc_name != nil, "A service name is mandatory." + valid? %w{ auto manual }.include?(@svc_start_type), "use either auto or manual for --start-type" # default service display to service name @svc_display = @svc_name if !@svc_display @@ -124,6 +127,7 @@ s.display_name = @svc_display s.binary_path_name = argv.join ' ' s.dependencies = [] + s.start_type = (@svc_start_type == 'auto') ? Win32::Service::AUTO_START : Win32::Service::DEMAND_START } puts "Mongrel service '#{@svc_display}' installed as '#{@svc_name}'." rescue Win32::ServiceError => err Index: trunk/projects/mongrel_service/bin/mongrel_service =================================================================== --- trunk/projects/mongrel_service/bin/mongrel_service (revision 325) +++ trunk/projects/mongrel_service/bin/mongrel_service (working copy) @@ -65,7 +65,6 @@ end log "Starting Rails in environment #{defaults[:environment]} ..." - uri "/", :handler => rails(:mime => mime) log "Mounting Rails at #{defaults[:prefix]}..." if defaults[:prefix] uri defaults[:prefix] || "/", :handler => rails(:mime => mime, :prefix => defaults[:prefix]) log "Rails loaded."