[fpc-pascal] Daemon question
Koenraad Lelong
fpascal at brouwerij.homelinux.net
Thu May 14 21:47:50 CEST 2009
Henry Vermaak schreef:
> 2009/5/13 Koenraad Lelong <fpascal at brouwerij.homelinux.net>:
>> Hi,
>> I wrote a daemon monitoring my solar powerstation. It works fine but I
>> want to extend it.
...
>> 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.
>
> i think the most elegant and scalable solution is to write a
> client/controller program that communicates with the server. this
> client can control the server, set options, get information/status via
> sockets, or some form of ipc. php can then call this client with the
> required options and use the output. a lot of unix daemons use this
> approach, see udevadm (for udev) and smbcontrol (for samba), for
> example.
>
> if this is too much trouble, your daemon can just append data to log
> files every x seconds and php can read these files. you will have to
> implement some log rotation scheme, though, or the log files will take
> over your system.
>
> henry
My "big" logs are 1.6M per day, but they are about 5000 lines at the end
of the day. Wouldn't it be a waste to read the last line of such a big
file ?
My last remark was about sending a signal via php (it does support
sending signals) and then writing the desired value to a file which
would be a single line, and then php reads this file. There could be
problems with concurrency, although the website will only be available
at home, so the number of possible users will be limited.
I will read about IPC and sockets. Do you have any good references at
hand about these ? I think googling will be difficult, but I will.
Thanks guys,
Koenraad.
More information about the fpc-pascal
mailing list