Ch 13 Daemon Processes
Daemon processes are long-lived processes that typically start during system boot and terminate only when the system is shut down. Running in the background without a controlling terminal.
Need to address the issue of reporting error information.
Common Daemon Processes
kswapd: Memory paging daemon Responsible for writing dirty virtual memory pages back to disk to reclaim these pages
flush daemon: Flushes dirty pages back to disk when available memory reaches threshold values; multiple flush daemons can exist simultaneously
sync_supers daemon: Periodically flushes filesystem metadata back to disk
init process (PID 1): Responsible for starting system services specific to each run level
rpcbind: Maps RPC program numbers to network port numbers
cron daemon: Manages scheduled tasks
Most daemon processes run with root privileges and have terminal name set to ?
Error Logging !!
User processes call the syslog function to write logs to the /dev/log Unix domain socket. Inter-process communication is performed via sockets (using UDP protocol) to send messages to the syslogd daemon, which then handles writing the information to files or sending it elsewhere.
Singleton Daemons
Ensure only one instance of a daemon exists using file and record locking mechanisms.
Daemon Conventions
- Lock files are typically stored in the
/var/rundirectory - Configuration options are placed under
/etc - Usually invoked by system initialization scripts
- Catching SIGHUP signal allows re-reading configuration files using reread functionality