title: How to Run an exe from windows service and stop service when the exe process quits?
body: <p>I am a complete beginner to working with windows services.  I have a basic skeleton worked out for the service and I am currently doing this:</p>
  
  <pre><code>protected override void OnStart(string[] args)
      {
          base.OnStart(args);
          Process.Start(@"someProcess.exe");
      }
  </code></pre>
  
  <p>just to fire-off the exe at the start of the program. </p>
  
  <p>However, I'd like to have the service stop itself when the process started from the exe quits.
  I'm pretty sure I need to do some sort of threading (something I am also a beginner with), but I'm not sure of the overall outline of how this works, nor the specific way to stop a process from within itself.
  Could you help me with the general process for this (i.e. start a thread from OnStart, then what...?)? Thanks.  </p>