http://www.perlmonks.org?node_id=1008698


in reply to Cannot launch perl packer binary from inetd

For a little *nix background on 'inetd':

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

Replies are listed 'Best First'.
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!