Lazarus

Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: mfeoli on January 12, 2007, 05:35:40 pm

Title: how to create a Daemon, is there a sample?
Post 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
Title: RE: how to create a Daemon, is there a sample?
Post by: theo on January 12, 2007, 07:27:12 pm
http://ai.ms.mff.cuni.cz/cgi-bin/dwww?type=file&location=/usr/share/doc/fp-compiler/linux/daemon.pp.gz
Title: RE: how to create a Daemon, is there a sample?
Post by: RudieD on January 12, 2007, 07:31:18 pm
As far as I can remember, FreePascal has a example or it's in the Freepascal Contributed section.
Title: how to create a Daemon, is there a sample?
Post by: mfeoli on January 12, 2007, 07:54:58 pm
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.
Title: how to create a Daemon, is there a sample?
Post by: theo on January 12, 2007, 08:17:00 pm
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.
Title: how to create a Daemon, is there a sample?
Post by: mfeoli on January 12, 2007, 10:27:11 pm
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
Title: Re: RE: how to create a Daemon, is there a sample?
Post by: Thaddy on January 27, 2020, 08:33:35 am
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
Title: Re: how to create a Daemon, is there a sample?
Post by: Hartmut on January 27, 2020, 11:30:40 am
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).
Title: Re: how to create a Daemon, is there a sample?
Post by: Thaddy on January 27, 2020, 11:41:46 am
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.
TinyPortal © 2005-2018