General :: Difference Between Child THREAD And Child PROCESS?
Jul 30, 2009
I am troubleshooting something and I got this problem.
If I do "pstree -p"
It shows,
Code:
[code]....
However, it does NOT show up in "ps -elf"
Code:
ps -elf | grep soffi
0 S whho 7734 1 0 80 0 - 36435 - 11:14 pts/2 00:00:03 /usr/lib/openoffice/program/soffice.bin -splash-pipe=5
0 S whho 7833 7759 0 80 0 - 751 - 11:21 pts/3 00:00:00 grep soffi
I was wondering if 7735, 7736, 7737, 7743 were really processes. Then I checked /proc, I could cd to /proc/7735, /proc/7736, etc, but I could not ls them out. I looked at the man page of "pstree", it says,
Code:
Child threads of a process are found under the parent process and are shown with the process name in curly braces, e.g.
icecast2---13*[{icecast2}]
So, what does all this mean? Does it mean that 7735, 7736, 7737, 7743 are just threads but not processes? If so, why could I cd to /proc/<id> but not see them in "ps -elf".
View 10 Replies
ADVERTISEMENT
Dec 7, 2009
Consider the following code:
Code:
int main()
{
int i=0;
pid_t pid;
for(i=0;i<2;i++)
[code]....
I get the following output:
Parent: chid_pid=4356 i=0 parent's pid=4355
This is child 4356 i=0
This is child 4357 i=1
[code]....
I can observe instead of two children(as I expect) processes there are three. This is because child process 4356 creates its own child. Why all the messages of the type "This is child X i=Y" are concentrated one under another? How exactly fork works? Is affected by the fact that I have a dual-core processor?
View 3 Replies
View Related
May 23, 2011
I have a doubt about signals in C programming. I have done this little program to explain it. It creates a child process with fork and, when the child ends, receives the SIGCHLD signal and wait for its termination.Ok, quite easy, BUT when I execute this code the SIGCHLD signal is received twice, first as an error (returns -1) and the second one to finish the child process.I don't understand the meaning of the first received signal. Why is it generated? Is the code wrong? (if you add the SIGINT and press Ctrl+C during the execution it also receives two signals instead of one)
Code: #include <stdio.h>
#include <unistd.h>
#include <string.h>
[code]....
View 4 Replies
View Related
Sep 8, 2010
Code:
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
[code]....
Description of what the code does or what i intended to do:
1. Created a child process from parent process using 'fork()'
2. Sent a signal 'SIGALRM' from child process to parent process using 'sigqueue' function.
(The Third parameter of 'siqueue' function contains the message (message msg) which the child process wants to send to the parent process.'msg' is a stucture instance containing a) pid of child and b) string) 5. Print the 'msg' sent by child process inside the signal handler function 'sig_action_function' of the parent process I am getting some junk value when this line is executed
Code:
printf("%d
",msg->cpid);
I expected to get the pid of child process, which the child process sent to parent process through the signal.
View 3 Replies
View Related
Dec 17, 2010
What happens to a child process that dies and has no parent process to wait for it and what's bad about this?
View 2 Replies
View Related
Jul 27, 2011
In my program, I fork() to get a child process. Because of some problem, child process terminates by a segmentation fault. Parent process is still running. I have compiled my code with -g option. I have done: ulimit -c unlimited. I am not getting core dump of the child process. How can I get the core dump of child process?
View 1 Replies
View Related
May 20, 2011
I have created three child process from one parent. And different child has different functions. Child 2 has got function to load file called "wc" to count file1 and and its required to get their files by command line arguments. I can get the files through command line but couldn't get the files when child 2 process start.
View 9 Replies
View Related
Apr 21, 2011
I have a script that calls other scripts/commands which may or may not spawn other process. From my understanding, when I do a ps -ef, the highest numbered process ID is supposed to be the parent ID of all the other related child processes, is this correct? In most or all circumstances, I do a ps -ef | grep <processid> of my script and anything that spawns off that process IDs I assumed are the child processes of my script. If I want to terminate my script and all other child processes, then I kill the parent ID which is the highest numbered PID and this will subsequently kill all other child process IDs, is this correct?
Now, my question is whether there is any quick way of showing what are the child processes of a parent ID instead of what am currently doing now which is visually checking which one is the parent ID and "assuming" that the highest numbered PID is the parent ID of all the other processes. Below is a sample output of running ps -ef | grep exp | grep -v grep. I assume from the output below that the parent process/ID is PID 11322, is that correct?
Code:
oracle 11154 11153 0 21:20 ? 00:00:00 /bin/sh -c (. ~oracle/.profile; /bin/ksh /usr/local/oracle/scripts/expdp_o
oracle 11155 11154 0 21:20 ? 00:00:00 /bin/sh -c (. ~oracle/.profile; /bin/ksh /usr/local/oracle/scripts/expdp_o
oracle 11190 11155 0 21:20 ? 00:00:00 /bin/ksh /usr/local/oracle/scripts/expdp_schema.ksh dev01
oracle 11322 11190 0 21:20 ? 00:00:00 expdp
View 2 Replies
View Related
Aug 26, 2009
I wonder how one can, if at all, run an X program in the background *in an emulator sub-shell process*. What I mean is to launch a program in an emulator, e.g, by xterm -e gedit
but with gedit (in this example) running in the background from inside the xterm sub-process, so that the xterm will accept other commands. In the above, gedit will run in the foreground, and of course, if you do
xterm -e gedit &
then xterm will run in the background, not gedit.In short, I would like to achieve the same thing as "gedit &" as you manually do in xterm, but from another shell. What I aim to do is write an X init script to achieve this result (to have the emulator open and a program or two running from it, in the background, at the X startup).
View 2 Replies
View Related
Nov 2, 2010
I'm studying about signal in Linux Kernel and I got a problem about signal handler and output buffer.
I just want to know about stdout buffer related parent process and child process.
The problem is - parent process received SIGINT signal_handler that I implement is called. And after signal_handler is called, it print string "pid : xxx state : RUNNING" ... but after end of signal_handler function, child process might be print string but it isn't print at all.
I'm not asking right code, but I want to know why is this happened and concepts about signal handler, buffer - between parent process and child process.
here is a code signal_handler:
Quote:
void TC3_handler()
{
pid_t pid;
ProcState ps;
pid = GetProcessId();
[Code]....
chlid process counts number in infinite loop, but after call signal_handler, it can't print at all.. just waiting for SIGINT..
View 2 Replies
View Related
Jul 22, 2010
I am facing an issue where the process starts hanging. When I closely look at the logs I come to know that some of the child processes that are forked by the parent process are not finished.
1) Is it possible that the child processes that are not finished occupy the socket memory of the parent process and ultimately a point is reached where no socket memory is available to fork new child processes.
2) What is the standard limit of socket memory in linux?
3) What is the fate of such child processes (as I have mentioned above)?
4) How to debug such cases so that the exact problematic area is identified?
View 2 Replies
View Related
Feb 15, 2011
well i have just started with shell scripting...how to find all child processes of a parent process given to script as argument.
View 10 Replies
View Related
Mar 10, 2011
I want to kill parent process after "fork()" method. but if I kill parent process with "exit(0)" method, main() thread is terminated as well so child prosess doesn't work anymore. Is there any way to kill only parent process without affecting to child process?
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
[code]....
View 1 Replies
View Related
Aug 4, 2010
what is child process - GE cannot open
View 1 Replies
View Related
Aug 18, 2010
I have a root process (on linux) that forks a child and the child process then drops privileges by doing a setuid() to a normal user. After the child setuid()'s, it is of course impossible for it to gain root again by itself. But since the main process is still running as root, i was wondering if there was a simple/smart way of getting the root-master-process to elevate the child back to root (or maybe just to another non-privi uid). Is there some way to do a setuid() on another pid? or maybe something can be done through /proc/<pid>/? Killing the child is not an option (because its what it does today and im trying to find a smarter way). (The program is apache2's mpm-itk worker and the "child" is the actual apache2 process serving a page.)
View 11 Replies
View Related
Jul 14, 2011
Im using gdb for debugging my application.. I was able to debug child process(when fork comes) .. and in child process we have an exec call to .... So the problem is, when the control come to exec , the exec process is executing at a time... I could not debug the exec. process... error is stack curruption due to same frame So, is there any way to debug the exec process
View 1 Replies
View Related
Mar 28, 2011
I'm writing a sort of toy shell using fork() and execv(). It runs smoothly enough untill the user enters an invalid command at which point the program hangs, so I need a way to check if the program loaded using execv returned correclty or not in the parent process and kill it if it didntI tried writing stderr to a text file to see if something whent wrong but doesnt really work out. Try running ./digenv GDM -i -Q for instance. (-Q is an invalid option for grep which the program runs at a certain point).Heres the code:
Code:
//digenv
//Carl Reg�rdh 2011-03-24
[code]....
View 13 Replies
View Related
Aug 18, 2010
I'm trying to write a shell script that do ftp and download file periodically, this script should be called by a daemon running in the background.
the shell script "script.sh" is as follows:
Code:
yafc ftp://test:test@192.168.1.225:21 < commands
and the "commands" files is
Code:
d Root/md5* /
quit
if I run script.sh it will work just fine. But when the daemon software calls the "script.sh", the script will send ftp login request to the ftp server, but will not even answer the username or anything.
I believe it is something about child process redirection, but I don't know how to deal with it.
This problem is not only with yafc, it is the same with any ftp client or any application like telnet and so.
View 4 Replies
View Related
Feb 7, 2010
what I am trying to do is to pass an argument to the standard input stream of a child process. I mean I create two programs .. first one invokes the other. second one contains something like
Code:
scanf("%d", &n);
now I want my first program to be able to pass a value to the second one so that it gets stored in n.
View 7 Replies
View Related
Aug 4, 2009
Terminal will not open
Error message: There was an error creating the child process for this terminal
Got this after doing a update to testing repo; to try to fix another issue with my media player sound not working.
Solved
The_Source_HIM
Just add yourself to 'tty' group and relogin
View 5 Replies
View Related
Feb 13, 2010
I get the error
Code:
there was an error creating the child process of this terminal
When I run this code:
Code:
gnome-terminal --window-with-profile=Scripts
View 2 Replies
View Related
May 8, 2010
I work with social sciences and I really need to use "R". R is a program used for statistics and it has a module called R-commander, which let things easier to deal and comes with several options as opening SPSS files (another statistical package commonly used by Windows users) and other things. THe problem is, as Rcmdr is a module for R, when I run it, it opens a terminal window and then he runs the module, which opens a friendly gui.
It worked okay and clean in Ubuntu 9.10, but for LTS 10.4 I keep getting an error, no matter I reinstall the modules or the entire program. I even installed Ubuntu again without upgrading it from karmic Koala. But there is the same error msg.
The error message says: "Error while creating a child process for this terminal". The strange part is there is no other msgs in the terminal or errorlogs. I really need to use this software for work.
View 3 Replies
View Related
Jun 21, 2010
I am trying to kill child process without killing the parent and seem to be having issues doing so. I have tried quite a few different commands and the end result is either killing all of them including the parent or not killing them at all.
View 1 Replies
View Related
May 12, 2011
i got basic knowledge about creating a single child from a parent using fork(). But when it comes into creating multiple children, i am simply stuck. I am trying to create two processes from a parent and it would wait for both two processes to finish. my attempt is as below
[Code]....
View 3 Replies
View Related
Aug 2, 2010
I am developing a application. In this I fork() 3 childs(lets say child1 , child2, child3) . The parent is now waiting for some input from keyboard.Child3 is continously getting data from child1 and child2 using pipe which it then will print using printf.Now as the parent is waiting for input from user through keyboard while child3 is continously printing the data. I want to do it in different terminals.Can you please guide me how to proceed ahead so that on one terminal , the parent waits for input fromser while on other terminal child3 prints data.
View 1 Replies
View Related
Mar 22, 2011
I am going to create a parent process and fork a child process from it. I want to write a code in such a way that whenever my child process end it must indicate that the child process is terminated by a signal or not. This code must be written in the parent process block.
View 6 Replies
View Related
Jul 11, 2011
I'm trying to start a program, but I keep getting the error:
"There was an error launching the application." Details: Failed to execute child process "/home/jjo/Desktop/0ad/build/resources" (Permission denied)
I've tried changing the permissions of the file, with no luck.
View 9 Replies
View Related
Apr 6, 2011
Just figured this one out and thought I'd post it here in case it helped someone else. Skype just upgraded itself from 2.1 to 2.2. After upgrading it didn't start, and I got the message
"failed to execute child process skype-wrapper" First test out if skype runs from the command line, by running this in a terminal
Code: skype & If it runs, you're good to go: simply right click on the menu, locate your entry for skype and change the command to launch it from skype-wrapper to skype. The reason for this is that in the 2.1 version, skype needed a script called skype-wrapper to set some varibles before start up. Upgrading removes the script, but failed to update the menu entry.
View 5 Replies
View Related
Oct 26, 2010
I just installed Maya 2009 on Fedora 13.It seemed to run the RPM install fine, but when I go to Applications > Graphics > MayaI an error:Could not launch 'Autodesk Maya 2009 (64-bit)
Failed to execute child process "/usr/autodesk/aya/bin/maya"(no such file or directory)I browsed to this location in the file browser and there definately is a file called maya in "bin"
View 1 Replies
View Related
Oct 22, 2010
Every time I try to execute a .exe file it says
Code:
Failed to execute child process
but when I type wine and the file it says
Code:
bash-4.1# wine
bash: /usr/bin/wine: No such file or directory
View 1 Replies
View Related