Parent PIDs
When I run a program, is there a way I can specify a parent PID for that program? I want all of my X programs (yammi, thunderbird, various dockapps, etc) to be parented to .xsession.
|
My first question is why? And no, well at least not that I know of. It all depends on how the program is designed to run, etc. But I'm still wondering why you'd want a parent PID for all your X related programs, etc.
|
Why? Because when I end my X session, I sometimes have a bunch of programs floating around still running that chew up memory and sometimes interfere with new instances.
|
And having the PPID will change that how?
If a program is written badly and goes AWOL on exit you won't benefit from all having the same PPID because in that situation they probably won't respond to a kill either ... Cheers, Tink |
Hmm... I thought that when a process is killed, all its child processes are killed as well. So right now i've got
Code:
init Code:
init What I want is: Code:
init |
For a process to be a child of a parent process, that parent has to spawn that process. I don't know of any way you can start a process and force it to attach itself to a parent.
I guess you could try to put everything you want to start in a ~/.xsession file to start when X does. But just starting a process once X is already started which seems to be what you want to do is not going to work. |
Besides, this won't work anyhow since children are definitely not killed when their parents exit.* Instead they are "adopted" by init, which will clean them up when they exit.
* Unless, in some situations, when you get an entire process group orphaned. See section 9.10 of W. Richard Stevens Advanced Programming the Unix Environment for all the gory details. |
All times are GMT -5. The time now is 08:42 AM. |