Stops a running script.

        script_id:= id of stored script.

        ...
        status = pi.stop_script(sid)
        ...
179095
def stop_script(self, script_id):
        
        res = yield from self._pigpio_aio_command(_PI_CMD_PROCS, script_id, 0)
        return _u2i(res)
931260
def stop(id):
    
    try:
        experiment = ExperimentClient().get(normalize_job_name(id))
    except FloydException:
        experiment = ExperimentClient().get(id)

    if experiment.state not in ["queued", "queue_scheduled", "running"]:
        floyd_logger.info("Job in {} state cannot be stopped".format(experiment.state))
        sys.exit(1)

    if not ExperimentClient().stop(experiment.id):
        floyd_logger.error("Failed to stop job")
        sys.exit(1)

    floyd_logger.info("Experiment shutdown request submitted. Check status to confirm shutdown")
1365106
def stop(self, sig=signal.SIGTERM):
        

        if self.pid is None:
            self.pid = self.read_pid()
        if self.pid is None:
            sp = BackgroundProcess.objects.filter(pk=1).first()
            if sp:
                self.pid = sp.pid
        if self.pid is None or self.pid == 0:
            logger.error("can't determine process id exiting.")
            return False
        if self.pid != getpid():
            # calling from outside the daemon instance
            logger.debug('send sigterm to daemon')
            try:
                kill(self.pid, sig)
                return True
            except OSError as e:
                if e.errno == errno.ESRCH:
                    return False
                else:
                    return False

        logger.debug('start termination of the daemon')
        BackgroundProcess.objects.filter(pk=self.process_id).update(
            last_update=now(),
            message='stopping..')

        timeout = time() + 60  # wait max 60 seconds
        self.kill_processes(signal.SIGTERM)
        while self.PROCESSES and time() < timeout:
            self.kill_processes(signal.SIGTERM)
            sleep(1)
        self.kill_processes(signal.SIGKILL)
        BackgroundProcess.objects.filter(pk=self.process_id).update(
            last_update=now(),
            message='stopped')
        logger.debug('termination of the daemon done')
        return True
1073767
def stop
      if config.managed? && started?
        Process.kill 'HUP', pid

        # Wait for fcrepo to stop
        while status
          sleep 1
        end

        Process.waitpid(pid)
      end

      @pid = nil
    end
980745
def stop(self):
        
        # unsetup_fuse()
        self.fuse_process.teardown()
        for uuid in self.processes:
            self.processes[uuid].terminate()
686891
private void stopScript(String line, DispatchCallback callback) {
    try {
      sqlLine.getScriptOutputFile().close();
    } catch (Exception e) {
      sqlLine.handleException(e);
    }

    sqlLine.output(sqlLine.loc("script-closed", sqlLine.getScriptOutputFile()));
    sqlLine.setScriptOutputFile(null);
    callback.setToSuccess();
  }
183234
def delete_script(self, script_id):
        
        res = yield from self._pigpio_aio_command(_PI_CMD_PROCD, script_id, 0)
        return _u2i(res)
307338
def stop(ctx, service, editable):
    """"""
    logger.debug("running command %s (%s)", ctx.command.name, ctx.params,
                 extra={"command": ctx.command.name, "params": ctx.params})

    home = ctx.obj["HOME"]
    service_path = plugin_utils.get_plugin_path(home, SERVICES, service, editable)

    logger.debug("loading {}".format(service))
    service = register_service(service_path)

    try:
        with open(os.path.join(service_path, ARGS_JSON)) as f:
            service_args = json.loads(f.read())
    except IOError as exc:
        logger.debug(str(exc), exc_info=True)
        raise click.ClickException("Cannot load service args, are you sure server is running?")

    # get our service class instance
    service_module = get_service_module(service_path)
    service_obj = service_module.service_class(alert_types=service.alert_types, service_args=service_args)

    # prepare runner
    runner = myRunner(service_obj,
                      pidfile=service_path + ".pid",
                      stdout=open(os.path.join(service_path, "stdout.log"), "ab"),
                      stderr=open(os.path.join(service_path, "stderr.log"), "ab"))

    click.secho("[*] Stopping {}".format(service.name))
    try:
        runner._stop()
    except daemon.runner.DaemonRunnerStopFailureError as exc:
        logger.debug(str(exc), exc_info=True)
        raise click.ClickException("Unable to stop service, are you sure it is running?")
374635
def stop_process(parser_args):
    
    from synergy.system import process_helper

    try:
        pid = process_helper.get_process_pid(parser_args.process_name)
        if pid is None or process_helper.poll_process(parser_args.process_name) is False:
            message = 'ERROR: Process {0} is already terminated {1}\n'.format(parser_args.process_name, pid)
            sys.stderr.write(message)
            sys.exit(1)

        process_helper.kill_process(parser_args.process_name)
    except Exception as e:
        sys.stderr.write('Exception on killing {0} : {1}\n'.format(parser_args.process_name, e))
        traceback.print_exc(file=sys.stderr)
911186
def running(processid):
    
    try:
        # From kill(2)
        #   If sig is 0 (the null signal), error checking is performed but no
        #   signal is actually sent. The null signal can be used to check the
        #   validity of pid
        os.kill(processid, 0)
    except OverflowError as exc:
        print("checking validity of pid ({p}) failed with: {e}"
              .format(p=processid, e=exc))
        sys.exit(1)
    except OSError:
        return False
    else:
        return True
1157376
def stop(self, signal=None):
        
        signal = signal or self.int_signal
        self.out.log("Cleaning up local Heroku process...")
        if self._process is None:
            self.out.log("No local Heroku process was running.")
            return

        try:
            os.killpg(os.getpgid(self._process.pid), signal)
            self.out.log("Local Heroku process terminated.")
        except OSError:
            self.out.log("Local Heroku was already terminated.")
            self.out.log(traceback.format_exc())
        finally:
            self._process = None
1103122
def pause(self, unique_id, configs=None):
    
    pids = self.get_pid(unique_id, configs)
    if pids != constants.PROCESS_NOT_RUNNING_PID:
      pid_str = ' '.join(str(pid) for pid in pids)
      hostname = self.processes[unique_id].hostname
      with get_ssh_client(hostname, username=runtime.get_username(), password=runtime.get_password()) as ssh:
        better_exec_command(ssh, "kill -SIGSTOP {0}".format(pid_str), "PAUSING PROCESS {0}".format(unique_id))
1207582
def stop
      pid_file = File.join(CONFIG_DIR, 'cogbot.pid')
      pid = File.read(pid_file).to_i if File.exist?(pid_file)
      Process.kill('TERM', pid)
    end
601708
def terminate(self):
        

        for process in list(self.processes):
            process["subprocess"].send_signal(signal.SIGTERM)

        self.stop_watch()
660515
def _stop_process(p, name):
    """"""
    # Based on code in IPython.core.magics.script.ScriptMagics.shebang
    if p.poll() is not None:
        print("{} is already stopped.".format(name))
        return
    p.terminate()
    time.sleep(0.1)
    if p.poll() is not None:
        print("{} is terminated.".format(name))
        return
    p.kill()
    print("{} is killed.".format(name))
1364294
def stop_bg(pid)
      file = pidfile(pid)
      if File.exist? file
        pid = File.read file
        File.delete file
        run "kill -s TERM #{pid}"
      else
        say "!txtred!PID file not found." unless Runfile.quiet
      end
    end
1296681
def stop_process(self, process, timeout=None):
        

        process["terminate"] = True
        if timeout is not None:
            process["terminate_at"] = time.time() + timeout
        process["subprocess"].send_signal(signal.SIGINT)