I have a shell script that launches multiple instances of gstreamer (for different cameras) when called from within my C program using system().
All my gstreamer instances are running in background.
Now I want to be able to get the process ID corresponding to a particular instance only and kill that instance (while not terminating other instances).
Right now, I have a kill.sh script that simply gets PID of all instances of gstreamer and closes them all.
Is there any way to do the selective killing of gstreamer instances? Any help or ideas will be really helpful!
Thanks!
Related
I've created two Batch scripts that I launch via the windows 7's Task Scheduler, and I've noticed that from times to times the execution of one of these scripts freezes. When this happens I get a Taskeng.exe window, and the only way to get rid of it is to kill the equivalent process.
And since I'm running those scripts on differents machines, whenever I log on in the morning, I find multiple Taskeng.exe windows from the previous executions.
Is there anyway to solve this problem ? Is there a way to kill those processes whenever their execution is incomplete ?
Thanks for reading.
Hicham
I'm trying to make a virus to run on VMWare so I could have some fun with Ubuntu and
experiment with it. Now, I would be interested that my experimental virus (although it's hardly a virus, it's more of an actual program) would be able to kill/terminate every process but itself and the system processes.
I thought of 2 options:
Either I get all the non-system processes IDs and kill each, comparing to mine first, to avoid killing myself.
OR there's an actual command or a function built-in doing that in some, I did some research and I succeeded making my process 'shielded' from any terminating/killing signals, but I'm not sure how to search other processes IDs (non-system ones).
Any idea on how to perform this?
Following command is to list every process on the system.
ps aux
I have a running WIN32 application. There a window in this application where I want to show web content using CEF3. But, I am facing problems and the entire window becomes white without showing any web page content. So I have the following questions:
Is it possible to use CEF3 with existing message loop in application? I dont want to call the CEF message loop, it may impact other things in my application.
Is it absolutely necessary to use a message window as in the sample application? I am not able to understand its objective.
When CEF3 launches multiple processes, how does it show in the task manager? If my application name is A.exe, does it show A.exe multiple times in task manager?
Any help is much appreciated.
For windows users there is possible to use multi threaded message loop (CefSettings). It is allow maintain browser windows via own message loop. But there is good practice use single threaded message loop, - you can call CefDoMessageLoopWork periodiacally on idle or some additional events. It is possible even with existing message loop.
I'm not sure what you mean.
CefSettings.BrowserSubprocessPath specifies which executable will be used for child processes. While you are integrating it in other process, looks like it is one possible solution and in task manager you will see processes as you named it.
About the question number 2:
every windows application has its own "main window" and wndProc that receives all the messages sent by his children.
And the sample win32 cefclient shows how to integrate cef message loop inside the application's message loop.
And if you don't handle and dispatch cef messages in proper way the browser window becomes white.
I am getting this error when I configured a job to do stop and start of tomcat server:
Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
When i googled it, i got a recommended solution as set BUILD_ID=dontKillMe
Is this the exact solution?
If yes, where do I need to set BUILD_ID? Inside ant/post build script?
Can anyone please clarify this?
Yes, creating fake BUILD_ID for process tells Jenkins to ignore this process during detection spawned processes, so this process will be not killed after finishing job.
Usage: Enter BUILD_ID=dontKillMe before your command, for example into Execute shell build step:
BUILD_ID=dontKillMe nohup ./yourStartScript.sh &
Note: See also nohup
By default, Jenkins will kill all the spawned process at the completion of build.
To override this, you need to create environment variable BUILD_ID.
Go to Jenkins -> Manage Jenkins -> Configure System.
Now under Global properties section, under Environment variables, click on ADD button to add new Environment variable.
Give name=BUILD_ID and value=allow_to_run_as_daemon start_my_service
Click on save button. And you are done.
Now the spawn process will continue to execute even after the build got completed.
Add this line as a JAVA_ARGS argument when you start your jenkins server (I put mine on /etc/default/jenkins in my Ubuntu box)
-Dhudson.util.ProcessTree.disable=true
And you're done
You are calling a command from Jenkins that spawns another process -
the tomcat-start command ends, but its child-process is still running
(this is the actual tomcat web-server you attempted to start).
Jenkins sometimes identifies this situation as a possible problem,
but the page you have mentioned also explains how to solve it
(in short: Don't start tomcat from Jenkins unless you know how).
Tried different suggestions but none of the options worked for me. Finally I switched to previous version of jenkins and it worked. I switched from 2.3 to 1.581 and it worked.
I've coded a program in c for an embedded system (Devkit8000, which is a clone of the well known BeagleBoard) running Angstrom Linux.
The program creates a couple of threads, on of them is responsible of taking pictures with a camera connected to the board, and right now the second thread only moves that images to another path. The program should be running during the whole day, and the only way to stop it is sending a signal.
I edited the crontab to launch the program in a specific hour and to send a signal when it has to stop, the issue is that launching the program in this way cause the process to be killed after some time running, but, if i launch the program manually (through the command line), it works perfectly and dont get stopped.
I have no idea about the reason of this different behaviour between crontab and command line. I've checked the system logs but didnt find anything useful. I've also been reading a little and find that the OS can kill a process if it is using so much resources, but doesnt make sense that this happens in only 1 scenario (crontab vs manually)...
Any clue about what is happening?
Thank you in advance!
The main difference is that running a job through cron invokes a non-interactive non-login shell. The effect of that depends on the default shell for your user. For example, if you are using Korn shell or Bash then your .profile will not be executed, as it would on an interactive login shell. Korn shell 88 will execute .kshrc (the $ENV file) but ksh93 will not.
So, a good start might be to call your program from a script, after first "sourcing" your .profile file:
. $HOME/.profile
Failing that... When you say that the process is "killed", do you get such a message? If so, then that sounds like someone sending SIGKILL, i.e. kill -9. If not, then maybe you could run strace or ltrace to find out at what point it dies.