So, I decided to start learn about system call with strace and want to observe network-related system call on apache2 processes, here's how I attach it:
pidof -s apache2
pstree -sTp <pid-from-pidof>
strace -f -e trace=%network -p <parent-pid-from-pstree>
and while observing, I notice that strace print some syscall, however I can't find the associated recvfrom or sendto syscall with file descriptor that correspond to the accept syscall in which contain the ip address of client (my browser) when I make a http request
my assumption is that when a request is handled by apache, it spawn new processes as a child process, and since I attach the strace to the parent apache2 process, why the strace not follow its child despite I specify -f option?
sendtoandrecvfromand notwriteandread?acceptcall returns the file descriptor of the socket. If you seeread/writeto that file descriptor, then those would be the ones of interest. Do you see something like that?