title: how to kill firefox gracefully from command line
body: <p>I am writing a program that needs to open a list of URLs. I have firefox on Ubuntu12.04, and every time I kill firefox and reopen it, there will be a message asking if I want to restore the previous sessions or not, which is quite annoying.</p>
  
  <p>I invoke firefox(in Java) using </p>
  
  <pre><code>Runtime r= Runtime.getRuntime();
  r.exec("firefox -new-instance www.google.com");
  </code></pre>
  
  <p>and kill it using</p>
  
  <pre><code>r.exec("killall firefox");
  </code></pre>
  
  <p>Is there a way to kill and reopen firefox more gracefully? I want the program run automatically without any pop-up messages or human intervention. 
  Thanks a lot!</p>