in reply to daemon with Perl on Linux
Daemons usually don't read anything from STDIN anyway (since they're supposed to be run completely in the background). Is there a reason you want to use STDIN to read from a socket instead of opening the socket in the daemon process?
It may make sense to put the "main code" in a separate module (see perlmod) for two reasons: one, so you can logically separate the daemon setup code from the processing code (i.e. just to make it easy to find the code you want and ignore the code you're not currently interested in); and two, if you put the processing code in a module you can use that same processing code in a program that doesn't act as a daemon (for instance, when testing the processing code, you can call it from a simple test script that gives output to STDOUT).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: daemon with Perl on Linux
by rimvydazas (Novice) on Nov 29, 2007 at 18:15 UTC | |
by Joost (Canon) on Nov 29, 2007 at 19:05 UTC |