As
moritz points out, there are a number of ways that could prevent a script, that previously ran from CLI, from successfully running as a daemon.
However, IMO, there are 2 questions to which the answers are not as clear as they could be WRT the running of the script as a daemon:
- Does it start if run in background from the CLI, but not if run via cron(1M) or init(1M) ?
- Does it just not start, or does it start and then, sometime later, halt ?
If the answer to the first question is that it only appears to fail when run indirectly i.e. via cron(1M)/init(1M), that would tend to point to a difference/omission in run-time environment/permissions.
OTOH, if the answer to the 2nd question is that it starts, but later, halts, that is indicative of the requirement (on behalf of the script) for standard device access preventing continued script execution - this can be, to some extent, tested by running the script from the CLI, but running the command in background under nohup(1) e.g. nohup command & ...
- All output will be re-directed to hohup.out in the current working directory (thus all output is logged by default) and ...
- The kernel will halt the job (and tell you via a job halted message to the console from which the command was issued) if it perceives that the job needs any of the standard devices to continue.
A user level that continues to overstate my experience :-))
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.