[fpc-pascal] Daemon question
Koenraad Lelong
fpascal at brouwerij.homelinux.net
Wed May 13 22:28:43 CEST 2009
Hi,
I wrote a daemon monitoring my solar powerstation. It works fine but I
want to extend it.
At the moment I log everything to file, and I put some data into rrdtool.
I would like to be able to ask the daemon some information, but I don't
know how to do this.
I made some signals : sigterm to terminate gracefully, sighup to
restart, sigusr0 to get the uptime and sigusr1 to get some device-info.
Except, sigusr0 and sigusr1 use writeln's to output the data which I
never see when I ask for them (kill -10 <processid>). Where do these
writeln's write to ? Sigterm and sighup do work fine, so I think my
handler is OK.
How can I get that info ? It should be software-independent, because I
would like to use php to get that information.
I thought of writing the info to a file, but that info is updated every
15 seconds. I think it's not good to write a new file every time.
Now I'm writing this, I could write to a file after receiving a signal,
and then reading this with php.
Thinking about it, does php support sending signals ? Back to the books.
Before you ask, I'm running Linux.
Thanks for any pointers,
Koenraad Lelong.
More information about the fpc-pascal
mailing list