Recent

Author Topic: unix function 'daemon' on freepascal.  (Read 7263 times)

BSaidus

  • Hero Member
  • *****
  • Posts: 540
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
unix function 'daemon' on freepascal.
« on: October 25, 2019, 11:24:01 am »
Hi !!
Is there a freepascal function that can be used like a C function daemon.
Code: Pascal  [Select][+][-]
  1.    int daemon(int nochdir, int noclose);
  2.  

Thanks.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: unix function 'daemon' on freepascal.
« Reply #1 on: October 25, 2019, 11:31:43 am »
in the fpc directory /packages/rtl-extra/daemon.pp
Specialize a type, not a var.

Guva

  • Jr. Member
  • **
  • Posts: 82
Re: unix function 'daemon' on freepascal.
« Reply #2 on: October 25, 2019, 12:22:25 pm »
lazdaemon package.

Creating a service in Lazarus (rus)
https://devlaz.ru/daemons-in-lazarus/

BSaidus

  • Hero Member
  • *****
  • Posts: 540
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: unix function 'daemon' on freepascal.
« Reply #3 on: October 25, 2019, 02:53:59 pm »
in the fpc directory /packages/rtl-extra/daemon.pp
I use trunk version of FPC and there is not such unit.
Thanks.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

BSaidus

  • Hero Member
  • *****
  • Posts: 540
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: unix function 'daemon' on freepascal.
« Reply #4 on: October 25, 2019, 02:56:53 pm »
lazdaemon package.

Creating a service in Lazarus (rus)
https://devlaz.ru/daemons-in-lazarus/

I want to write an FPC console application without attaching any object to project.
just functions.

thanks
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: unix function 'daemon' on freepascal.
« Reply #5 on: October 25, 2019, 03:09:54 pm »
The daemon example uses a very shallow object wrapper around the procedural interfaces, so simply examine the implementation.
Note you will lose cross-platform capabilities if you don't use the class wrapper.
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: unix function 'daemon' on freepascal.
« Reply #6 on: October 25, 2019, 03:11:22 pm »
in the fpc directory /packages/rtl-extra/daemon.pp
I use trunk version of FPC and there is not such unit.
Thanks.

There is a src/ missing.

BSaidus

  • Hero Member
  • *****
  • Posts: 540
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: unix function 'daemon' on freepascal.
« Reply #7 on: October 25, 2019, 03:42:56 pm »
in the fpc directory /packages/rtl-extra/daemon.pp
I use trunk version of FPC and there is not such unit.
Thanks.

There is a src/ missing.

NO !! there is not !!
Or I miss something. ;)

lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: unix function 'daemon' on freepascal.
« Reply #8 on: October 25, 2019, 04:23:35 pm »
Look inside packages/rtl-extra/src/

Sorry; just looked and it's in: packages/fcl-extra/examples/daemon.pp
« Last Edit: October 25, 2019, 04:27:33 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

BSaidus

  • Hero Member
  • *****
  • Posts: 540
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: unix function 'daemon' on freepascal.
« Reply #9 on: October 30, 2019, 04:13:37 pm »
Thnks to all.
I found a fork function and it make my needs.

thank you !!
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

 

TinyPortal © 2005-2018