<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,4 +13,8 @@
   
 - If an error is thrown when starting up, display a link to the results of the standard error out
 
-- Add link to email someone a URL to a project
\ No newline at end of file
+- Add link to email someone a URL to a project
+
+- Throw errors based on different conditions:
+  # project.pid = File.open(&quot;#{project.rails_root}/tmp/pids/mongrel.pid&quot;).read.chomp.to_i             # command should have created a mongrel.pid file, read that in and store the pid
+  # raise NoSuchDirectory, &quot;The directory #{project.rails_root} does not exist.&quot;                    # if the output is blank then there was an error, most likely that the command wasn't found (wrong directory structure)</diff>
      <filename>NOTES</filename>
    </modified>
    <modified>
      <diff>@@ -28,11 +28,17 @@ class UtilityController &lt; ApplicationController
   # start a project
   def start_project
     project = Project.find(params[:id])
+    started = false
     begin
-      output = `mongrel_rails start -c #{project.rails_root} -p #{project.port} -e #{project.environment.command} -d`
-      # project.pid = File.open(&quot;#{project.rails_root}/tmp/pids/mongrel.pid&quot;).read.chomp.to_i             # command should have created a mongrel.pid file, read that in and store the pid
-      # raise NoSuchDirectory, &quot;The directory #{project.rails_root} does not exist.&quot;                    # if the output is blank then there was an error, most likely that the command wasn't found (wrong directory structure)
-      project.last_started_at = Time.now.to_s(:db)                                                      # timestap the last started time as right now
+      while !started
+        output = `mongrel_rails start -c #{project.rails_root} -p #{project.port} -e #{project.environment.command} -d 2&gt;&amp;1`
+        if output.include? 'PID file log/mongrel.pid already exists'
+          `rm #{project.rails_root}/log/mongrel.pid`
+        else
+          project.last_started_at = Time.now.to_s(:db)
+          started = true
+        end
+      end
     rescue =&gt; e
       set_state(project, :error)
       project.notes = e.message</diff>
      <filename>app/controllers/utility_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@
 
 &lt;% form_for :project, :url =&gt; { :action =&gt; 'create' } do |form| %&gt;
 
-  &lt;%= render partial =&gt; 'form', :locals =&gt; { :form =&gt; form, :project =&gt; project } %&gt;
+  &lt;%= render :partial =&gt; 'form', :locals =&gt; { :form =&gt; form, :project =&gt; @project } %&gt;
 
   &lt;div id=&quot;save&quot;&gt;
     &lt;%= submit_tag 'Save Settings' %&gt; or &lt;%= link_to 'Cancel', :controller =&gt; 'dashboard' %&gt;</diff>
      <filename>app/views/projects/new.html.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f401015402eefe8fec29efee316d0e03b3347688</id>
    </parent>
  </parents>
  <author>
    <name>Rob Cameron</name>
    <email>cannikinn@gmail.com</email>
  </author>
  <url>http://github.com/cannikin/alfred/commit/4aae0342577cb622fd5fee57034d6312305121f7</url>
  <id>4aae0342577cb622fd5fee57034d6312305121f7</id>
  <committed-date>2008-04-22T14:45:14-07:00</committed-date>
  <authored-date>2008-04-22T14:45:14-07:00</authored-date>
  <message>If a project is stopped unexpectedly, a mongrel.pid will be left behind. Project will not restart until that PID file is removed. Fied!</message>
  <tree>d5cf735cb61c5903211463ce8e3cb92a1533fe84</tree>
  <committer>
    <name>Rob Cameron</name>
    <email>cannikinn@gmail.com</email>
  </committer>
</commit>
