code: public DaemonStatus checkStatus()
      {
          if (this.pidfile == null) {
              throw new IllegalStateException("No pidfile specified, cannot check status!");
          }
          if (!pidfile.exists()) {
              return DaemonStatus.STATUS_NOT_RUNNING;
          }
  
          final int pid;
          try
          {
              byte[] content = Files.readAllBytes(pidfile.toPath());
              String s = new String(content, StandardCharsets.UTF_8).trim();
              pid = Integer.parseInt(s);
  
          }
          catch (Exception e)
          {
              System.err.println(e.getMessage());
              return DaemonStatus.STATUS_UNKNOWN;
          }
  
          int rs = posix.kill(pid, 0);
          if (rs == 0) {
              return DaemonStatus.STATUS_RUNNING;
          }
          else
          {
              return DaemonStatus.STATUS_DEAD;
          }
      }
docs: 0	program is running or service is OK
  1	program is dead and /var/run pid file exists
  2	program is dead and /var/lock lock file exists
  3	program is not running
  4	program or service status is unknown
  5-99	reserved for future LSB use
  100-149	reserved for distribution use
  150-199	reserved for application use
  200-254	reserved