Skip to main content
typo-fixes
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperatelyseparately. But if not, please let me know.)

I learned from the previous question that the shell built-in commands are treated specially and normal external commands are executed on child process.

This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happendhappened after typing command. But I can only trace an execve call execve("bin/ls",,,) = 0 when I execute strace like this way.

strace -etrace=execve,clone ls

That means, as I guess, I can only monitor system calls which are called after a child process is created.

To monitor all system calls related to creating new process, What I have to do? To invoke command with bash -c like strace -etrace=execve,clone bash -c '{ ls; }' would be helpful in this case?

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperately. But if not, please let me know.)

I learned from the previous question that the shell built-in commands are treated specially and normal external commands are executed on child process.

This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happend after typing command. But I can only trace an execve call execve("bin/ls",,,) = 0 when I execute strace like this way.

strace -etrace=execve,clone ls

That means, as I guess, I can only monitor system calls which are called after a child process is created.

To monitor all system calls related to creating new process, What I have to do? To invoke command with bash -c like strace -etrace=execve,clone bash -c '{ ls; }' would be helpful in this case?

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it separately. But if not, please let me know.)

I learned from the previous question that the shell built-in commands are treated specially and normal external commands are executed on child process.

This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happened after typing command. But I can only trace an execve call execve("bin/ls",,,) = 0 when I execute strace like this way.

strace -etrace=execve,clone ls

That means, as I guess, I can only monitor system calls which are called after a child process is created.

To monitor all system calls related to creating new process, What I have to do? To invoke command with bash -c like strace -etrace=execve,clone bash -c '{ ls; }' would be helpful in this case?

replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

This question is relevant to the question of 'what happens when we type a simple command on shell?'the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperately. But if not, please let me know.)

I learned from the previous questionthe previous question that the shell built-in commands are treated specially and normal external commands are executed on child process.

This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happend after typing command. But I can only trace an execve call execve("bin/ls",,,) = 0 when I execute strace like this way.

strace -etrace=execve,clone ls

That means, as I guess, I can only monitor system calls which are called after a child process is created.

To monitor all system calls related to creating new process, What I have to do? To invoke command with bash -c like strace -etrace=execve,clone bash -c '{ ls; }' would be helpful in this case?

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperately. But if not, please let me know.)

I learned from the previous question that the shell built-in commands are treated specially and normal external commands are executed on child process.

This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happend after typing command. But I can only trace an execve call execve("bin/ls",,,) = 0 when I execute strace like this way.

strace -etrace=execve,clone ls

That means, as I guess, I can only monitor system calls which are called after a child process is created.

To monitor all system calls related to creating new process, What I have to do? To invoke command with bash -c like strace -etrace=execve,clone bash -c '{ ls; }' would be helpful in this case?

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperately. But if not, please let me know.)

I learned from the previous question that the shell built-in commands are treated specially and normal external commands are executed on child process.

This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happend after typing command. But I can only trace an execve call execve("bin/ls",,,) = 0 when I execute strace like this way.

strace -etrace=execve,clone ls

That means, as I guess, I can only monitor system calls which are called after a child process is created.

To monitor all system calls related to creating new process, What I have to do? To invoke command with bash -c like strace -etrace=execve,clone bash -c '{ ls; }' would be helpful in this case?

Post Reopened by Graeme, Thomas Nyman, Faheem Mitha, slm, Gilles 'SO- stop being evil'
Post Closed as "Duplicate" by Thomas Nyman, Anthon, jasonwryan, Jenny D, Zelda
Source Link
MS.Kim
  • 1.7k
  • 4
  • 18
  • 18

How to trace system calls being invoked after typing command?

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperately. But if not, please let me know.)

I learned from the previous question that the shell built-in commands are treated specially and normal external commands are executed on child process.

This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happend after typing command. But I can only trace an execve call execve("bin/ls",,,) = 0 when I execute strace like this way.

strace -etrace=execve,clone ls

That means, as I guess, I can only monitor system calls which are called after a child process is created.

To monitor all system calls related to creating new process, What I have to do? To invoke command with bash -c like strace -etrace=execve,clone bash -c '{ ls; }' would be helpful in this case?