Difference between revisions of "Daemons and Services"

From Free Pascal wiki
Jump to navigationJump to search
(New page: =What are daemons and services?= Unix daemons and windows services are programs running without user interaction. For example www or ftp servers are called daemons under linux and service...)
 
Line 2: Line 2:
  
 
Unix daemons and windows services are programs running without user interaction. For example www or ftp servers are called daemons under linux and services under windows. Because they do not interact with the user directly, they close their stdin, stdout, stderr descriptors at start.
 
Unix daemons and windows services are programs running without user interaction. For example www or ftp servers are called daemons under linux and services under windows. Because they do not interact with the user directly, they close their stdin, stdout, stderr descriptors at start.
 +
 +
With Free Pascal, Lazarus it is possible to write these daemons/services platform independent via the Lazarus lazdaemon package. To avoid name conlicts with the Delphi components these classes are called 'daemons'.
 +
 +
=Classes=
 +
 +
==TCustomDaemon==
 +
 +
This is a TDataModule descendant that does all the work. There can be several TCustomDaemons classes and/or instances running at the same time and in the same process (single threaded or multi threaded).
 +
 +
==TCustomDaemonApplication==
 +
 +
This is a TCustomApplication descendant which creates the TCustomDaemons. This does not need any change. It runs under windows until it receives the Stop call or under linux until the TERM signal.
 +
 +
==TDaemonMapper==
 +
 +
This component handles the service registration. This is needed mostly for windows.

Revision as of 19:14, 28 November 2007

What are daemons and services?

Unix daemons and windows services are programs running without user interaction. For example www or ftp servers are called daemons under linux and services under windows. Because they do not interact with the user directly, they close their stdin, stdout, stderr descriptors at start.

With Free Pascal, Lazarus it is possible to write these daemons/services platform independent via the Lazarus lazdaemon package. To avoid name conlicts with the Delphi components these classes are called 'daemons'.

Classes

TCustomDaemon

This is a TDataModule descendant that does all the work. There can be several TCustomDaemons classes and/or instances running at the same time and in the same process (single threaded or multi threaded).

TCustomDaemonApplication

This is a TCustomApplication descendant which creates the TCustomDaemons. This does not need any change. It runs under windows until it receives the Stop call or under linux until the TERM signal.

TDaemonMapper

This component handles the service registration. This is needed mostly for windows.