This chapter examines the characteristics of daemon processes and looks at the steps required to turn a process into a daemon. We also look at how to log messages from a daemon using the syslog facility.
A daemon is a process with the following characteristics:
It is long-lived. Often, a daemon is created at system startup and runs until the system is shut down.
It runs in the background and has no controlling terminal. The lack of a
controlling terminal ensures that the kernel never automatically generates
any job-control or terminal-related signals (such as
SIGINT, SIGTSTP, and
SIGHUP) for a daemon.
Daemons are written to carry out specific tasks, as illustrated by the following examples:
cron: a daemon that executes commands ...