|
How do you check if a process on Mac OS X is running using the process's name in a Bash script?
I am trying to write a Bash script that will restart a process if it has stopped but do nothing if it is still running.
Started by credford on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
It will also exit application has your....
Script that does what you're after:
#!/bin/bash PROCESS=myapp number=$(ps aux | grep $PROCESS | wc options won't actually kill the process, but instead print what will be done.
|
|
I'm in a big organization that likes waterfall processes and need to help discourage its use at least on my project. It would be helpful if the name was more ugly, jarring and not as pretty as a waterfall, a forest or sunset.
Any suggestions?
Started by MatthewMartin on
, 22 posts
by 22 people.
Answer Snippets (Read the full thread at stackoverflow):
The people using the process probably know it by the name by the name if they're already aware of the process behind it, something a bit more functional to your doom" process?
You....
Our suggestions won't really matter.
|
|
How can I find out what the program file name is for a running process?
Started by Will Williams on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at serverfault):
Or selects the listing of files for the processes whose optional process IDentification (PID) numbers.
|
Ask your Facebook Friends
|
Is there a way in code to detect what process or application starts my process or application. Any .net, vb6 or c++ code snips would be great
Started by meomio on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
But if you have more than one process running, I don't believe there is any, SizeConst=256)] public string szExeFile....
In .Net,
Assembly.GetEntryAssembly()
returns the assembly that the current running assembly process was kicked off from.
|
|
Hello. Is it possible to get a file name of a process using PID? ps displays a lot of useful information about a process, but not a hint about a process executable file location.
Started by Eye of Hell on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at serverfault):
For example, in the shell to see what....
> % ps of getting the process's binary location is to use lsof and grep for the first txt segment.
Try ps aux
Example: you're after the associate process command name for PID 45109 ...
|
|
Hi, I have created a simple java networking program. I am using Fedora. whenever I want to see what the processes run on my system I found that for my application the process Name is java. I want give process name for my application. How to give process...
Started by Sunil Kumar Sahoo on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Personally I've had good results with Launch4j
You could pass a java property to the jvm... .
One way to change the process name of an application is to use a native launcher (or to copy the java / java.exe executable to another name).
|
|
I want a way to kill a random process with a name (eg a random perl process).
What would be the best way of doing this?
I was thinkign of using something like this:
ps aux | grep PROCESS-NAME
to a file, then find a random line number, get the second column...
Started by Hintswen on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Bash one-liner :-p
kill `ps auxww | grep zsh | awk just one process....
Command
kill `ps aux | grep PROCESS-NAME | perl randomline.pl | awk '{print $2}'`
You might also want level processes that match your process name.
|
|
I have the service name for a windows service in delphi, and I know how to get the handle from that as well. What I need to do is stop a service, and if the stop fails for some reason I need to kill the process associated with the service. The problem...
Started by Chris J on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
; //Record defined for use as return buffer _SERVICE_STATUS_PROCESS = record dwServiceType: DWORD lpBuffer: _SERVICE_STATUS_PROCESS; cbBufSize: DWORD; out pcbBytesNeeded: LPDWORD ): BOOL; stdcall'; //define the api call function QueryServiceStatusEx....
|
|
I want communicate between a parent and child process both written in C#. It should be asynchronous, event driven. I does not want run a thread in every process that handle the very rare communication.
What is the best solution for it?
Started by Horcrux7 on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
I would suggest using the Windows Communication Foundation:
http://en.wikipedia.org/wiki/Windows_Communication....
Http://msdn.microsoft.com/en-us/library/bb546102.aspx
Use Asynchronous operations with BeginRead/BeginWrite and AsyncCallback.
Anonymous pipes.
|
|
I've a process name and I've to send a kill() signal to that process but I need its PID to call kill() . I would only like to use:
popen("pidof process_name");
as the last thing. Is there any other way to find out the process' PID? One way I could think...
Started by vito on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
You might....
It isn't the cleanest solution.
System("killall -s 9 process_name");
You mentioned you were using linux.
But you can go through every entry in /proc and check the process name in cmdline against what you.
|