title: Where is my /etc/sysctl.conf file? Postgresql Fatal could not create shared memory segment
body: <p>My goal is to install and fully setup Postgresql by following railscast video.
  P.S I am on a Mountain Lion 10.8</p>
  
  <pre><code>$ brew install postgresql
  </code></pre>
  
  <p>seems okay.</p>
  
  <pre><code>$ initdb /usr/local/var/postgres
  </code></pre>
  
  <p>ok's ok's then...
      FATAL:  could not create shared memory segment: Cannot allocate memory
  DETAIL:  Failed system call was shmget(key=1, size=2072576, 03600).
  HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMALL.  To reduce the request size (currently 2072576 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.</p>
  
  <p>So like a good young SO grasshopper I start googling. and come to This SO post:
  <a href="https://stackoverflow.com/questions/12433813/postgresql-installation-error-cannot-allocate-memory">PostgreSQL installation error -- Cannot allocate memory</a></p>
  
  <p>the suggested answer in this post lead me to this answer:<a href="http://willbryant.net/software/mac_os_x/postgres_initdb_fatal_shared_memory_error_on_leopard" rel="nofollow noreferrer">http://willbryant.net/software/mac_os_x/postgres_initdb_fatal_shared_memory_error_on_leopard</a></p>
  
  <pre><code>$ sudo sysctl -w kern.sysv.shmall=65536
  Password:
  kern.sysv.shmall: 1024 -&gt; 65536
  
  $ sudo sysctl -w kern.sysv.shmmax=16777216
  kern.sysv.shmmax: 4194304 -&gt; 16777216
  </code></pre>
  
  <p>looks like everything worked so far, but in order to protect my changes from reboot, I need to update my /etc/sysctl.conf  file.  The problem is that I can't find it!</p>
  
  <p>how do I locate this file? From my peanut sized understanding of computers, there is no filepath that exists, and if it did what is before the /etc  ?? it certainly is not on my desktop. all I get is no such file exists, but I don't know how to find this file.</p>