Is there a difference between a daemon and a service?
Or are they both basically an application that is resident in memory, and is bound to a specific port and listens/responds to requests?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityIs there a difference between a daemon and a service?
Or are they both basically an application that is resident in memory, and is bound to a specific port and listens/responds to requests?
Daemons and Services are not the same.
A "Service" could refer to either a Daemon or a Service.
A daemon is a subset of services that always run in memory waiting to service a request.
A non-daemon service generally is handled by xinetd. xinetd listens for the request, then starts the required service to handle the request. After the request has been serviced the service is then stopped again.
Typical non-daemon services: rsync vsftpd
Typical daemonized services: MySQL Apache
daemons and services are one in the same.
However, neither have to be bound to a port. HALd is a daemon, that monitors plugged in hardware and mounts it properly. crond is a daemon that keeps the trains on time.
Yes - daemons run on Unix-like boxes, and services run on Windows.
Once upon a decade ago, daemons kept going indefinitely and services didn't.
Once upon a couple of decades ago, daemons didn't keep going indefinitely either.
So, really, I meant No - there isn't a significant difference between services and daemons.
Note that 'cron' is a daemon; it is not bound to the network at all.
Since all major linux distributions use systemd today, it is feasible to look up what systemd says about it:
from man systemd
systemd is a system and service manager for Linux operating systems.
...
Service units, which start and control daemons and the processes they consist of. For details, see systemd.service(5).
...
systemctl daemon-reexec (does restart systemd)