code: private boolean dropPidFile() {
          LOG.trace("Entering dropPidFile()");
  
          // we cannot create pid files on Windows
          if (System.getProperty("os.name").startsWith("Windows")) {
              LOG.info("Pid file creation is unsupported on Windows... skipping");
              return true;
          }
  
          try {
              final String[] cmd = {"bash", "-o", "noclobber", "-c", "echo $PPID > " + pidFilename};
              final Process p = Runtime.getRuntime().exec(cmd);
  
              if (p.waitFor() != 0) {
                  LOG.error("Unable to drop PID file");
                  return false;
              }
          } catch (final InterruptedException | IOException e) {
              LOG.error("Unable to drop PID file: " + e.getMessage());
              return false;
          }
  
          // This must be called after we've successfully dropped the PID file. Otherwise, it might clean-up another
          // instances PID file. Keep in mind this doesn't account for kill -9 or a hard lockup. The start-up script
          // should provide some additional logic to clean-up stale pid files.
          new File(pidFilename).deleteOnExit();
  
          LOG.debug("Dropped PID file");
          LOG.trace("Exiting dropPIDFile()");
          return true;
      }
docs: Create a file with the current process id in it. This is a no-op on Windows. Prior copies of the file must be
  removed prior to launch.
  @return true if the pid file was successfully created