From the Manual Page of
Proc::Daemon:
The Proc::Daemon::Init function does the following:
- 1 Forks a child and exits the parent process.
- 2 Becomes a session leader (which detaches the program from the controlling terminal).
- 3 Forks another child process and exits first child. This prevents the potential of acquiring a controlling terminal.
- 4 Changes the current working directory to "/".
- 5 Clears the file creation mask.
- 6 Closes all open file descriptors.
Note point 6. It closes all open file descriptors. Maybe exchanging two lines in your code does the trick:
Proc::Daemon::Init();
Log::Log4perl->init_and_watch( '/tmp/test_log_daemon.conf', 10 );
Don't know it it works (just an idea), maybe Log::Log4perl->init_and_watch() reopens STDERR or such.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.