title: With Jekyll, how do I stop a detached server process from the command line?
body: <p>I'm trying to write a script that launches Jekyll from the command line, does another process, and then stops it.</p>
  
  <p>The logic would be like this:</p>
  
  <ol>
  <li>start jekyll serve.</li>
  <li>run a process called Prince to build a PDF from the HTML files.</li>
  <li>stop the jekyll server.</li>
  </ol>
  
  <p>I'm not very experienced with the command line. I think I have to use the <code>--detach</code> command with Jekyll to continue running scripts after the preview server builds. But then if I detach Jekyll, the only way to stop the server is by killing a specific PID, but the PID number seems to be generated randomly.</p>
  
  <p>Anyone have any tips on how to construct this script?</p>