Commits

Michael Granger committed 4462a9d

Fix the 'start' subcommand of m2sh.rb.

  • Participants
  • Parent commits 9dd24d2

Comments (0)

Files changed (1)

 		# Change into the server's chroot directory so paths line up whether or not
 		# it's started as root
 
-		header "Starting mongrel2 at: #{url}."
-		Dir.chdir( server.chroot ) do
+		message '*' * 70
+		header "Starting mongrel2 at: #{url}"
+		message '*' * 70
+
+		if server.chroot && server.chroot != '' && server.chroot != '.'
+			Dir.chdir( server.chroot )
 			message "  changed PWD to: #{Dir.pwd}"
-			Mongrel2::Config.log_action( "Starting server: #{server}", self.options.why )
-			self.log.debug "  command is: #{Shellwords.shelljoin(cmd)}"
-			exec( *cmd )
 		end
 
 		Mongrel2::Config.log_action( "Starting server: #{server}", self.options.why )
-		message '*' * 70
-		header "Starting mongrel2 at: #{url}"
-		message '*' * 70
+		self.log.debug "  command is: #{Shellwords.shelljoin(cmd)}"
 		exec( *cmd )
 	end
 	help :start, "Starts a server."