capturing perl forks

P

patrisha

I would like to capture all fork/execve's that a perl script executes.

In more detail,what I would like to do is capture all the various
methodes scripts can use to run system commands. So if someone does
something like.

use shell qw(echo);
echo "hello";

In the background I would like to capture fork/execve for the echo,
do some "stuff" and then let perl do its normal thing. Ultimately I
would like to grab a copy of the output log and potentially redirect
logs to /dev/null for some special cases.

I have searched and read until I am blue in the face but don't see a
way to capture all the possible ways a script might fork off another
process without doing something evil like overriding the fork system
call with my own.

Thanks in advance for any help
Patricia
 
P

patrisha

That does help, thankyou, but I was hoping for a more generic method of
overriding the functionality. I have been using Perl "magic" to capture
access to variables and for some C code
I have running in the background. It would be nice to be able to do
this in the background
through "magic".

Thanks again
Patricia
 
A

A. Sinan Unur

(e-mail address removed) wrote in @z14g2000cwz.googlegroups.com:
That does help,

What does help? Please provide some context when replying. The fact that
you and I know what we are talking about at this point in time does not
mean others also do.
thankyou, but I was hoping for a more generic method of
overriding the functionality. I have been using Perl "magic" to capture
access to variables and for some C code
I have running in the background. It would be nice to be able to do
this in the background through "magic".

I do not know what you mean by "magic". If you want to modify the behavior
of a built-in, you'll have to do some work.

Sinan.
 
A

Arndt Jonasson

A. Sinan Unur said:
(e-mail address removed) wrote in @z14g2000cwz.googlegroups.com:


What does help? Please provide some context when replying. The fact that
you and I know what we are talking about at this point in time does not
mean others also do.

True.

It seems that lately, the correlation between context-less answers and
the post coming from groups.google.com is near 100%. I haven't tried
groups.google.com myself, so I don't know how hard it is to make a
proper posting with it, but it seems obvious to me that it is
misleading people into breaking long-standing and natural traditions of
posting.
 
E

Eric Bohlman

It seems that lately, the correlation between context-less answers and
the post coming from groups.google.com is near 100%. I haven't tried
groups.google.com myself, so I don't know how hard it is to make a
proper posting with it, but it seems obvious to me that it is
misleading people into breaking long-standing and natural traditions
of posting.

I'm guessing that it was related to Google's recent switch to a new
interface which shows more context than the old interface. The result is
probably that the people who think of newsgroups as "Google groups" rather
than as part of Usenet are assuming that everyone else is seeing the same
context they are. Or it's possible that the interface doesn't make the
distinction between posting a followup and a new article clear.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top