# File lib/simp/cli/commands/bootstrap.rb, line 238
  def self.ensure_bootstrap_puppetserver_process_stopped
    begin
      pserver_proc = %x{netstat -tlpn}.split("\n").select{|x| x =~ /\d:8150/}
      unless pserver_proc.empty?
        pserver_port = %x{puppet config print masterport}
        # By this point, bootstrap has applied config settings to puppetserver.
        # Don't kill puppetserver if it's configured it to listen on 8150.
        unless (pserver_port == '8150')
          pserver_pid = pserver_proc.first.split.last.split('/').first.to_i
          Process.kill('KILL',pserver_pid)
        end
      end
#TODO need to separately rescue exception raised by Process.kill for process
#that no longer exists, as that is clearly no longer a problem
    rescue Exception => e
      warn(e.message)
      warn("The bootstrap puppetserver process running on port 8150 could not be killed." +
        "\n Please check your configuration!", 'magenta')
    end
  end