kill

SQL Server: Kill Process using Stored Procedure

自古美人都是妖i 提交于 2020-01-02 06:19:11
问题 I want to modify the following as it doesn't seem to kill processes - I think its supposed to disconnect users (is this the same?). I want to be able to kill all process for a particular database - how can I modify the below: create procedure [dbo].[sp_killusers](@database varchar(30)) as ---------------------------------------------------- -- * Created By David Wiseman, Updated 19/11/2006 -- * http://www.wisesoft.co.uk -- * This procedure takes the name of a database as input -- * and uses

SQL Server: Kill Process using Stored Procedure

扶醉桌前 提交于 2020-01-02 06:19:09
问题 I want to modify the following as it doesn't seem to kill processes - I think its supposed to disconnect users (is this the same?). I want to be able to kill all process for a particular database - how can I modify the below: create procedure [dbo].[sp_killusers](@database varchar(30)) as ---------------------------------------------------- -- * Created By David Wiseman, Updated 19/11/2006 -- * http://www.wisesoft.co.uk -- * This procedure takes the name of a database as input -- * and uses

SQL Server: Kill Process using Stored Procedure

橙三吉。 提交于 2020-01-02 06:19:04
问题 I want to modify the following as it doesn't seem to kill processes - I think its supposed to disconnect users (is this the same?). I want to be able to kill all process for a particular database - how can I modify the below: create procedure [dbo].[sp_killusers](@database varchar(30)) as ---------------------------------------------------- -- * Created By David Wiseman, Updated 19/11/2006 -- * http://www.wisesoft.co.uk -- * This procedure takes the name of a database as input -- * and uses

Simulate Ctrl-C keyboard interrupt in Python while working in Linux

浪子不回头ぞ 提交于 2020-01-02 01:45:12
问题 I am working on some scripts (in the company I work in) that are loaded/unloaded into hypervisors to fire a piece of code when an event occurs. The only way to actually unload a script is to hit Ctrl - C . I am writing a function in Python that automates the process As soon as it sees the string "done" in the output of the program, it should kill the vprobe . I am using subprocess.Popen to execute the command: lineList = buff.readlines() cmd = "vprobe /vprobe/myhello.emt" p = subprocess.Popen

Emacsclient hook on kill

自古美人都是妖i 提交于 2020-01-01 09:28:10
问题 I am trying to find a hook in Emacs, which should fire right before emacs server graceful shutdown. I tried kill-emacs-query-functions, kill-emacs-hook, server-done-hook with elisp like : (add-hook 'server-done-hook '(lambda () (savehist-save) ) ) ... but none of them is called when OS shuts down, so history is not saved. Maybe someone could give a hint? P.S. I am on Gentoo Linux, emacs-vcs-23.2.9999 package, terminal only. For testing desired behaviour Emacs is stopped using start-stop

How to limit program's execution time when using subprocess?

对着背影说爱祢 提交于 2020-01-01 09:17:30
问题 I want to use subprocess to run a program and I need to limit the execution time. For example, I want to kill it if it runs for more than 2 seconds. For common programs, kill() works well. But if I try to run /usr/bin/time something , kill() can’t really kill the program. My code below seems doesn’t work well. The program is still running. import subprocess import time exec_proc = subprocess.Popen("/usr/bin/time -f \"%e\\n%M\" ./son > /dev/null", stdout = subprocess.PIPE, stderr = subprocess

why does android 'revives' crashing apps?

为君一笑 提交于 2020-01-01 03:20:11
问题 if you have an android app that has more than one Activity, and Activity A starts B, so if Activity b crashes the process is killed but is revived by android OS and starts Activity A again instead of just shutting down the app, why ? 回答1: You're complaining that Android will attempt to recover your app's state gracefully after a crash? ;) This is the result of Android's resource management and the Activity lifecycle at work. Keep in mind that a single task can be composed of a number of

How can I kill the processes matching a grep older than 30 minutes?

家住魔仙堡 提交于 2019-12-31 03:12:47
问题 I have a set of processes that run in parallel. Occasionally some hang around longer than the script is supposed to allow: $time_start = microtime(true) $max_run_time = 30 * 60; // 30 minutes, measured in seconds while ((microtime(true)-$time_start) < $max_run_time) { // do stuff, but quit after 30 minutes } I'd like to kill old processes of this script that have been around longer than 30 minutes. How can I do as much from the command line? Here's a sample of current running processes: > ps

Closing a minimized/iconized process from C#

谁说我不能喝 提交于 2019-12-31 02:35:23
问题 Here's my issue: I need to close a process, already running, from a C# program. The problem is that the process now runs as an icon (minimized to taskbar), and unless the user opens it at least once (which will never happen on unattended machines), it'll never have a main window. The other requirement that I have is that the application be closed not killed . I need it to write it's memory buffers to disk - and killing it causes data loss. Here's what I tried so far: foreach (Process proc in

how to kill hadoop jobs

馋奶兔 提交于 2019-12-29 10:13:14
问题 I want to kill all my hadoop jobs automatically when my code encounters an unhandled exception. I am wondering what is the best practice to do it? Thanks 回答1: Depending on the version, do: version <2.3.0 Kill a hadoop job: hadoop job -kill $jobId You can get a list of all jobId's doing: hadoop job -list version >=2.3.0 Kill a hadoop job: yarn application -kill $ApplicationId You can get a list of all ApplicationId's doing: yarn application -list 回答2: Use of folloing command is depreciated