title: Run IPython Notebook server in background in Ubuntu using "service"-style commands
body: <p>I have set up IPython Notebook on my machine (within a virtualenv).  And I have set up a profile (called <code>myserver</code>) which is appropriate for my needs.  For now, I kick off that server by executing:</p>
  
  <pre><code>cd path/to/folder/containing/virtualenv
  source virtualenvfolder/bin/activate
  ipython notebook --profile=myserver
  </code></pre>
  
  <p>I'd like to run this same process in the background, and I'd like to manage it the way I manage other things in my Ubuntu install...with commands like <code>sudo service ngninx start</code> or <code>sudo service uwsgi restart</code> or <code>sudo service lightdm stop</code>.  I.e.  I'd like to be able to type <code>sudo service myipythonserver start|stop|restart</code> and have it behave in the expected way.</p>
  
  <p>Four questions.  </p>
  
  <ol>
  <li>What is the name of the framework that's being used when I call <code>sudo service something action</code>.  Is that <code>Supervisor</code>?  Something else? </li>
  <li>Whatever that framework is called, how do I create a new "thing" for it to manage?  What user owns the process that is started in this way, and how do you manage file permissions (etc) for the background process? </li>
  <li>Once I've created that new "command" (say it now works to type <code>sudo service myipythonserver start|stop|restart</code>), how do I set it up so that the process starts automatically on system startup? </li>
  <li>Is there any way to control the amount of system resources consumed by one of these background processes?  For example, if I want to restrict my IPython server to use no more than 3gb of RAM, is that possible?  No more than 50% of CPU?</li>
  </ol>