# include "pantasks.h"

int status_sys (int argc, char **argv) {

  gprint (GP_LOG, "\n");

  // if (rl_event_hook == NULL) {

  if (CheckTasksGetState()) {
    gprint (GP_LOG, " Scheduler is running\n");
  } else {
    if (CheckJobsGetState()) {
      gprint (GP_LOG, " Scheduler is stopped, harvesting jobs\n");
    } else {
      gprint (GP_LOG, " Scheduler is stopped\n");
    }
  }
  if (CheckControllerStatus()) {
    gprint (GP_LOG, " Controller is running\n");
  } else {
    gprint (GP_LOG, " Controller is stopped\n");
  }
  ListTasks (FALSE);
  ListJobs ();
  return (TRUE);
}
