Recent

Author Topic: how to create a Daemon, is there a sample?  (Read 8718 times)

mfeoli

  • Newbie
  • Posts: 3
how to create a Daemon, is there a sample?
« 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


RudieD

  • Full Member
  • ***
  • Posts: 234
RE: how to create a Daemon, is there a sample?
« Reply #2 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.
The FRED Trainer. (Training FRED with Lazarus/FPC)

mfeoli

  • Newbie
  • Posts: 3
how to create a Daemon, is there a sample?
« Reply #3 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.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1891
how to create a Daemon, is there a sample?
« Reply #4 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.

mfeoli

  • Newbie
  • Posts: 3
how to create a Daemon, is there a sample?
« Reply #5 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

Thaddy

  • Hero Member
  • *****
  • Posts: 10515
« Last Edit: January 27, 2020, 10:27:55 am by Thaddy »

Hartmut

  • Sr. Member
  • ****
  • Posts: 439
Re: how to create a Daemon, is there a sample?
« Reply #7 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).

Thaddy

  • Hero Member
  • *****
  • Posts: 10515
Re: how to create a Daemon, is there a sample?
« Reply #8 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