🐧 Linux / Shell Scripting
Intermediate
What is a daemon in Linux?
Answer
A daemon is a background process that runs continuously to provide services, typically started at boot and not tied to any user session. Daemon names often end in d: sshd (SSH server), nginx (web server), crond (cron scheduler), systemd. Daemons have no controlling terminal (TTY is ? in ps output). They typically detach from the terminal by forking and calling setsid(). Modern daemons are managed by systemd: systemctl start/stop/status/enable servicename. journalctl -u servicename views daemon logs. Daemons differ from regular background processes (command &) in their persistence and service-oriented nature.