process-management

Tracing which process that has opened a particular file

早过忘川 提交于 2019-11-29 05:16:32
From kernel mode in Windows I'm able to intercept and monitor virtually all actions performed on a particular disk. When a file is opened for any purpose I get an event. Now I want to trace which application that opened it. I think this should be possible but don't know how. I'm using the standard file management functions in Windows Win32 API. Thanks in advance. /Robert Just use Win32 N.API to get the pid from the File handle. It's a FAQ for 15 years... Sysinternals Filemon (free) does this, and better yet they describe how they did it: For the Windows 9x driver, the heart of FileMon is in

How to pause / resume any external process under Windows?

*爱你&永不变心* 提交于 2019-11-29 04:21:54
I am looking for different ways to pause and resume programmatically a particular process via its process ID under Windows XP. Process suspend/resume tool does it with SuspendThread / ResumeThread but warns about multi-threaded programs and deadlock problems. PsSuspend looks okay, but I wonder if it does anything special about deadlocks or uses another method? Prefered languages : C++ / Python If you "debug the debugger" (for instance, using logger.exe to trace all API calls made by windbg.exe ), it appears that the debugger uses SuspendThread() / ResumeThread() to suspend all of the threads

How to run a python script like pm2 for nodejs

China☆狼群 提交于 2019-11-29 02:02:31
问题 I've used pm2 for my Node.js script and I love it. Now I have a python script which collect streaming data on EC2. Sometimes the script bombs out and I would like a process manager to restart itself like pm2. Is there something the same as pm2 for python? I've been searching around and couldn't find anything. Here's my error File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py", line 430, in filter self._start(async) File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py

Emacs, internal process killing, any command?

亡梦爱人 提交于 2019-11-29 01:01:43
How to kill an internal process in Emacs? For example I run M-x shell . I can check running processes with M-x list-processes but how can I kill a process from this list? There is no default key binding for this; however see pjammer's answer -- list-processes+ includes (among other things) a kill binding on C-k -- and also Joao Tavora's answer -- which provides just a kill binding (for the same key). event_jr points out in the comments that you can use M-: (kill-process) RET to kill the current buffer's process. More generally: You can use M-: (kill-process PROCESS) RET , where PROCESS "may be

Can you track when an android application has been terminated?

你说的曾经没有我的故事 提交于 2019-11-28 01:01:33
Looked at android documentation and it appears that we don't have the ability to know when an app shuts down. Whether it was explicitly by the user or automatically by the operating system. Below is the onTerminate() documentation which is only available in the emulated scenario. public void onTerminate() Since: API Level 1 This method is for use in emulated process environments. It will never be called on a production Android device, where processes are removed by simply killing them; no user code (including this callback) is executed when doing so. Does anyone have any other approaches to

How do I get rid of Java child processes when my Java app exits/crashes?

跟風遠走 提交于 2019-11-27 23:28:34
问题 I launch a child process in Java as follows: final String[] cmd = {"<childProcessName>"}; Process process = Runtime.getRuntime().exec(cmd); It now runs in the background. All good and fine. If my program now crashes (it is still in dev :-)) the child process still seems to hang around. How can I make it automatically end when the parent Java process dies? If it helps, I'm using Mac OS X 10.5 回答1: As you said, addShutdownHook is the way to go. BUT: There's no real guarantee that your shutdown

Emacs, internal process killing, any command?

白昼怎懂夜的黑 提交于 2019-11-27 15:33:46
问题 How to kill an internal process in Emacs? For example I run M-x shell . I can check running processes with M-x list-processes but how can I kill a process from this list? 回答1: There is no default key binding for this; however see pjammer's answer -- list-processes+ includes (among other things) a kill binding on C-k -- and also Joao Tavora's answer -- which provides just a kill binding (for the same key). event_jr points out in the comments that you can use M-: (kill-process) RET to kill the

Check if a specific exe file is running

蓝咒 提交于 2019-11-27 07:05:20
I want to know how i can check a program in a specific location if it is running. For example there are two locations for test.exe in c:\loc1\test.exe and c:\loc2\test.exe. I only wanted to know if c:\loc1\test.exe is running and not all instances of test.exe. bool isRunning = Process.GetProcessesByName("test") .FirstOrDefault(p => p.MainModule.FileName.StartsWith(@"c:\loc1")) != default(Process); Pishgaman.org This is my improved function : private bool ProgramIsRunning(string FullPath) { string FilePath = Path.GetDirectoryName(FullPath); string FileName = Path.GetFileNameWithoutExtension

Windows Equivalent of 'nice'

有些话、适合烂在心里 提交于 2019-11-27 04:09:15
Is there a Windows equivalent of the Unix command, nice ? I'm specifically looking for something I can use at the command line, and not the "Set Priority" menu from the task manager. My attempts at finding this on Google have been thwarted by those who can't come up with better adjectives. Stephen Pellicer If you want to set priority when launching a process you could use the built-in start command: START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/WAIT] [/B] [command/program] [parameters] Use the low through

Tracking CPU and Memory usage per process

久未见 提交于 2019-11-26 21:23:29
I suspect that one of my applications eats more CPU cycles than I want it to. The problem is - it happens in bursts, and just looking at the task manager doesn't help me as it shows immediate usage only. Is there a way (on Windows) to track the history of CPU & Memory usage for some process. E.g. I will start tracking "firefox", and after an hour or so will see a graph of its CPU & memory usage during that hour. I'm looking for either a ready-made tool or a programmatic way to achieve this. Martin08 Just type perfmon into Start > Run and press enter. When the Performance window is open, click