Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Cannot launch perl packer binary from inetd

by flexvault (Parson)
on Dec 13, 2012 at 18:24 UTC ( #1008698=note: print w/ replies, xml ) Need Help??


in reply to Cannot launch perl packer binary from inetd

For a little *nix background on 'inetd':

    'inetd' is a daemon that waits on ports and then calls (fork) a program to process the requests. When the program completes, it goes away. It is not a daemon, 'inetd' is the daemon.

    Note: If your not using a *nix 'inetd', then what I just stated could be totally wrong.

That said, you can have both. As an example, 'pop3' is an example of being able to perform both. 'pop3' can be called from 'inetd' or you can run 'pop3' as a daemon. What's the difference -- performance. Usually 'inetd' is used for low usage requirement and the daemon 'pop3' will usually outperform the 'inetd' version by a factor of 10 or more.

So maybe you want to look at making your script to run as a 'daemon'. Depending on the volume, you may not need to use 'fork', since the operating system will queue the port request and you can just loop on servicing the port requests.

I have never used 'pp', but have written 'daemon's in several different languages, including Perl. I believe the 'Perl Cookbook' has examples of both pre-forked and dynamically forked daemons. You will need to call your script at system startup, and remove the call from 'inetd'. Look for 'rc.local' and put the execution of your script in there. Make sure to use the full path.

Hope this helps!

Good Luck!

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Cannot launch perl packer binary from inetd
Re^2: Cannot launch perl packer binary from inetd
by fergal1 (Initiate) on Dec 19, 2012 at 15:26 UTC

    SOLUTION FOUND - When I added the -d option to my command line, the resultant binary may be launched by inetd. Perldoc pp does not go into much detail on this option. But contrib/docs/where_is_it.txt gave me the clue to find the answer. Thanks Anonymous Monk.

    POST-MORTEM - I suspect that my problem was caused due to Perl being installed on the target machine. When I build with dependencies the binary does not launch correctly (perhaps due to a library ambiguity?). When I rebuild without dependencies, the library is loaded and my program runs.

    Thanks for your help guys!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008698]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-12-28 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (181 votes), past polls