Exemplo n.º 1
0
 def stop_task(self):
     task_id = self.currentrow[0]
     status = self.currentrow[5]
     if status in ('RUNNING', 'CONTINUING', 'ABOUT TO SLEEP', 'SLEEPING'):
         if status == 'SLEEPING':
             bibsched_set_status(task_id, 'NOW STOP', 'SLEEPING')
             bibsched_send_signal(task_id, signal.SIGCONT)
             count = 10
             while bibsched_get_status(task_id) == 'NOW STOP':
                 if count <= 0:
                     bibsched_set_status(task_id, 'ERROR', 'NOW STOP')
                     self.update_rows()
                     self.repaint()
                     self.display_in_footer(
                         "It seems impossible to wakeup this task.")
                     return
                 time.sleep(CFG_BIBSCHED_REFRESHTIME)
                 count -= 1
         else:
             bibsched_set_status(task_id, 'ABOUT TO STOP', status)
         self.update_rows()
         self.repaint()
         self.display_in_footer("STOP signal sent to task #%s" % task_id)
     else:
         self.display_in_footer("Cannot stop non-running processes")
Exemplo n.º 2
0
 def kill_task(self):
     task_id = self.currentrow[0]
     process = self.currentrow[1]
     status = self.currentrow[5]
     if status in ('RUNNING', 'CONTINUING', 'ABOUT TO STOP', 'ABOUT TO SLEEP', 'SLEEPING'):
         if self._display_YN_box("Are you sure you want to kill the %s process %s?" % (process, task_id)):
             bibsched_send_signal(task_id, signal.SIGKILL)
             bibsched_set_status(task_id, 'KILLED')
             self.update_rows()
             self.repaint()
             self.display_in_footer("KILL signal sent to task #%s" % task_id)
     else:
         self.display_in_footer("Cannot kill non-running processes")
Exemplo n.º 3
0
 def kill_task(self):
     task_id = self.currentrow[0]
     process = self.currentrow[1]
     status = self.currentrow[5]
     if status in ('RUNNING', 'CONTINUING', 'ABOUT TO STOP', 'ABOUT TO SLEEP', 'SLEEPING'):
         if self._display_YN_box("Are you sure you want to kill the %s process %s?" % (process, task_id)):
             bibsched_send_signal(task_id, signal.SIGKILL)
             bibsched_set_status(task_id, 'KILLED')
             self.update_rows()
             self.repaint()
             self.display_in_footer("KILL signal sent to task #%s" % task_id)
     else:
         self.display_in_footer("Cannot kill non-running processes")
Exemplo n.º 4
0
 def stop_task(self):
     task_id = self.currentrow[0]
     status = self.currentrow[5]
     if status in ('RUNNING', 'CONTINUING', 'ABOUT TO SLEEP', 'SLEEPING'):
         if status == 'SLEEPING':
             bibsched_set_status(task_id, 'NOW STOP', 'SLEEPING')
             bibsched_send_signal(task_id, signal.SIGCONT)
             count = 10
             while bibsched_get_status(task_id) == 'NOW STOP':
                 if count <= 0:
                     bibsched_set_status(task_id, 'ERROR', 'NOW STOP')
                     self.update_rows()
                     self.repaint()
                     self.display_in_footer("It seems impossible to wakeup this task.")
                     return
                 time.sleep(CFG_BIBSCHED_REFRESHTIME)
                 count -= 1
         else:
             bibsched_set_status(task_id, 'ABOUT TO STOP', status)
         self.update_rows()
         self.repaint()
         self.display_in_footer("STOP signal sent to task #%s" % task_id)
     else:
         self.display_in_footer("Cannot stop non-running processes")
Exemplo n.º 5
0
    def wakeup_task(self):
        if not self.currentrow:
            self.display_in_footer("no task selected")
            return

        task_id = self.currentrow[0]
        status = self.currentrow[5]
        #if self.count_processes('RUNNING') + self.count_processes('CONTINUING') >= 1:
        #self.display_in_footer("a process is already running!")
        if status == "SLEEPING":
            if not bibsched_send_signal(task_id, signal.SIGCONT):
                bibsched_set_status(task_id, "ERROR", "SLEEPING")
            self.update_rows()
            self.repaint()
            self.display_in_footer("process woken up")
        else:
            self.display_in_footer("process is not sleeping")
        self.stdscr.refresh()
Exemplo n.º 6
0
    def wakeup_task(self):
        if not self.currentrow:
            self.display_in_footer("no task selected")
            return

        task_id = self.currentrow[0]
        status = self.currentrow[5]
        #if self.count_processes('RUNNING') + self.count_processes('CONTINUING') >= 1:
            #self.display_in_footer("a process is already running!")
        if status == "SLEEPING":
            if not bibsched_send_signal(task_id, signal.SIGCONT):
                bibsched_set_status(task_id, "ERROR", "SLEEPING")
            self.update_rows()
            self.repaint()
            self.display_in_footer("process woken up")
        else:
            self.display_in_footer("process is not sleeping")
        self.stdscr.refresh()
Exemplo n.º 7
0
 def debug_task(self):
     task_id = self.currentrow[0]
     bibsched_send_signal(task_id, signal.SIGUSR2)
     self.display_in_footer("Task set in debug mode")
Exemplo n.º 8
0
 def debug_task(self):
     task_id = self.currentrow[0]
     bibsched_send_signal(task_id, signal.SIGUSR2)
     self.display_in_footer("Task set in debug mode")