docs: def abort(job_id):
      """
      Abort the given job
      """
      job = logs.dbcmd('get_job', job_id)  # job_id can be negative
      if job is None:
          print('There is no job %d' % job_id)
          return
      elif job.status not in ('executing', 'running'):
          print('Job %d is %s' % (job.id, job.status))
          return
      name = 'oq-job-%d' % job.id
      for p in psutil.process_iter():
          if p.name() == name:
              try:
                  os.kill(p.pid, signal.SIGTERM)
                  logs.dbcmd('set_status', job.id, 'aborted')
                  print('Job %d aborted' % job.id)
              except Exception as exc:
                  print(exc)
              break
      else:  # no break
          # set job as failed if it is set as 'executing' or 'running' in the db
          # but the corresponding process is not running anymore
          logs.dbcmd('set_status', job.id, 'failed')
          print('Unable to find a process for job %d,'
                ' setting it as failed' % job.id)