Recent

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

BSaidus

  • Sr. Member
  • ****
  • Posts: 343
  • 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: 10572
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

indigo80

  • New Member
  • *
  • Posts: 31
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

  • Sr. Member
  • ****
  • Posts: 343
  • 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

  • Sr. Member
  • ****
  • Posts: 343
  • 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: 10572
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.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8894
  • 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

  • Sr. Member
  • ****
  • Posts: 343
  • 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: 3188
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.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

BSaidus

  • Sr. Member
  • ****
  • Posts: 343
  • 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