At this point, your "daemon" might better be described as a simple background process because all it does is collect data. It sounds to me like you are actually looking for advice on how to turn it into a daemon.

In general, a daemon is a program that monitors something and acts when there is a change. A server is a special kind of daemon that waits for a connection on a port. Some daemons monitor a spool directory and go into action when a file is placed in the spool. There are, of course, many other variations on the same idea.

It might make sense for your program to analyze the data as it collects it and then do something when it detects one or more conditions. (At which point your program would accurately be described as a daemon.) On the other hand, it might make sense for your program to simply collect the information and then hand it out to clients that connect to a port and request it. (At which point your program would accurately be called a daemon and just as accurately be called a server.)

Before we can adequately help, it would help us to know what you want to do with the data that you collect. If it is something simple, then building a server might be overkill. If, however, the data might be used for a variety of things or from a variety of places a server could be the way to go.

What exactly are you trying to accomplish?

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Reading from a UNIX daemon by sauoq
in thread Reading from a UNIX daemon by mint1981

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.