title: Phusion passenger-status: what value for passenger_instance_registry_dir?
body: <p>I've done a new install of nginx 1.6.3 and passenger 5.0.15 on Ubuntu 14.04 from source in order to add tracing components from AppNeta for my ROR 4.2 app on one of my servers.  Nginx and passenger are running and serving pages.  I am getting the trace data for server monitoring.  All seems well,</p>
  
  <p>However, when I run "passenger-status" (as root), I get the following:</p>
  
  <blockquote>
    <p>ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be:</p>
    
    <ol>
    <li>You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again.</li>
    <li>The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument.</li>
    </ol>
  </blockquote>
  
  <p>The problem with this is that it seems to be blocking capistrano deploys; this same error is displayed by cap before exiting.</p>
  
  <p>Passenger <em>is</em> running (it's in the <code>ps</code> output and pages are being served).  I just need to tell passenger-status where to find the current running instance.  (This is from the <a href="https://www.phusionpassenger.com/documentation/Design%20and%20Architecture.html#instance_state_and_communication">Design and Architecture</a> documentation.)  Therefore, it seems that setting this instance registry directory value is the required step. But to what value?</p>
  
  <p>According to the <a href="https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_instance_registry_dir">Nginx Reference</a>, the defaults are <code>/tmp</code> and <code>/var/run/passenger-instreg</code>   And I've found an instance directory in /tmp. So, I've tried setting the PASSENGER_INSTANCE_REGISTRY_DIR to a number of different values:</p>
  
  <ul>
  <li>/tmp</li>
  <li>/tmp/passenger.JxmCeiA (the current instance directory, but this changes with each startup of Nginx)</li>
  </ul>
  
  <p>I've even tried creating a directory at /run/passenger, setting that value in the nginx configuration file and restarting nginx. The temporary directory <em>is</em> being created, but passenger-status still gives the same message. Even if I use the /opt/passenger-5.0.15/bin/passenger-status script to make sure I'm using the latest version of that script. </p>
  
  <p>There are some configuration values in the original 'location.ini' directory for passenger, but none were the instance registry directory, so there was nothing to reuse.  </p>
  
  <p>Interestingly, the /opt/passenger-5.0.15/lib/phusion_passenger/nginx/config_options.rb file does not have an entry for passenger_instance_registory_dir.  It has other nginx configuration options, I would have expected it to have this one as well.</p>
  
  <p>I've tried setting the environment variable as well as the Nginx <code>passenger_instance_registry_dir</code> option, but I must be missing something in my understanding because I can't seem to connect the <code>passenger-status</code> command with the current running instance.</p>
  
  <p>Any help would be greatly appreciated.</p>