Lazarus
Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: mfeoli on January 12, 2007, 05:35:40 pm
-
Hi,
I have a code written on delphi which creates an NT service.
I'm very much interested in porting into Lazarus, but need to create a Daemon instead of a service.
Does any one has an sample of a daemon created with Lazarus, or at least point in a direction to follow in order to learn.
thanks
-
http://ai.ms.mff.cuni.cz/cgi-bin/dwww?type=file&location=/usr/share/doc/fp-compiler/linux/daemon.pp.gz
-
As far as I can remember, FreePascal has a example or it's in the Freepascal Contributed section.
-
thanks for your help Theo,
I'm now trying to set it up,
jus one question, probably due to extreme ignorance on fpc,
I am compiling fpc mydaemon (without parameters)
then chmod 777 mydaemon
then ./mydaemon
but keep getting a permission denied message
(I'm acting as root and using Debian Sarge)
I appreciate it.
-
Don't know. I've just compiled it in Lazarus as user, didn't change any permissions and started it as user and it worked.
-
well well,
turns out it works on lazarus but not in fpc, probably due to a parameter missing at compile time... I'm too new in fpc to know the reason.
but I accomplished what I needed thanks to your help.
...
regards
Manrique
-
http://ai.ms.mff.cuni.cz/cgi-bin/dwww?type=file&location=/usr/share/doc/fp-compiler/linux/daemon.pp.gz
It is in the standard distribution under/packages/fcl-extra/examples/daemon.pp
-
turns out it works on lazarus but not in fpc, probably due to a parameter missing at compile time... I'm too new in fpc to know the reason.
If you want to know, which command line parameters Lazarus sends to the FPC compiler, you can use Lazarus menu Project / Project Options / Button "Show Options" (see attached screenshot).
-
The example from fcl-extra works as a service under windows and as a daemon under Linux/Unix likes as explaned in daemon.txt in the same directory.