what is technical difference between daemon, service and process?

179,502

Solution 1

Daemons - Daemon does not stand for Disk and Execution Monitor (http://www.takeourword.com/TOW146/page4.html). They are the processes which run in the background and are not interactive. They have no controlling terminal.

They perform certain actions at predefined times or in response to certain events. In *NIX, the names of daemons end in d.

Services - In Windows, daemons are called services.

If you're wondering why *NIX has a command named service, it is just used to run init scripts (shorthand for initialization scriptrunlevel).

Process - Process is a running program. At a particular instant of time, it can be either running, sleeping, or zombie (completed process, but waiting for it's parent process to pick up the return value).

Sources and further information:

Solution 2

  1. A daemon is a background, non-interactive program. It is detached from the keyboard and display of any interactive user. The word daemon for denoting a background program is from the Unix culture; it is not universal.

  2. A service is a program which responds to requests from other programs over some inter-process communication mechanism (usually over a network). A service is what a server provides. For example, the NFS port mapping service is provided as a separate portmap service, which is implemented as the portmapd daemon.

    A service doesn't have to be a daemon, but usually is. A user application with a GUI could have a service built into it: for instance, a file-sharing application. Another example is the X Window service, which is anything but in the background: it takes over your screen, keyboard and pointing device. It is a service because it responds to requests from applications (to create and manipulate windows, et cetera), which can even be elsewhere on the network. But the X service also responds to your every keystroke and mouse movement.

  3. A process is one or more threads of execution together with their shared set of resources, the most important of which are the address space and open file descriptors. A process creates an environment for these threads of execution which looks like they have an entire machine all to themselves: it is a virtual machine.

    Inside a process, the resources of other processes, and of the kernel, are invisible and not directly accessible (at least not to a thread which is executing user-space code). For example, there is no way to refer to the open files of another process, or their memory space; it is as if those things do not even exist.

    The process, and its relation to the kernel and other processes, perhaps constitutes the most important abstraction in Unix-like operating systems. The resources of the system are compartmentalized into processes, and nearly everything is understood as happening inside one process or another.

Share:
179,502
krupal6022
Author by

krupal6022

Updated on September 18, 2022

Comments

  • krupal6022
    krupal6022 over 1 year

    I want to know that what are differences in behavior of a daemon, process and service running in Ubuntu.

    • Admin
      Admin over 11 years
      This is a better fit for StackOverflow, where it has conveniently already been asked and answered.
    • Admin
      Admin over 9 years
      @Tom: No, that SE post does not answer what a service is. And overall the answers here are more elaborate.
    • Admin
      Admin over 9 years
      @TomBrossman, The post you linked talks nothing of services.
    • Admin
      Admin over 7 years
      StackOverflow is about coding. deamons are a unix thing, there is no better place to ask than here
    • Admin
      Admin over 5 years
      Huh? how could this question ever be closed?
  • Pacerier
    Pacerier over 9 years
    Couldn't you obtain the memory of the other processes by querying directly for the system's RAM?
  • Mads Skjern
    Mads Skjern over 9 years
    In fact OP asks about services within Ubuntu, while this answer tells about services on Windows. So obviously Anon's answer is the correct one
  • Cannoliopsida
    Cannoliopsida almost 9 years
    A process generally cannot query directly for the system's RAM. Modern OSes use virtual address spaces (en.wikipedia.org/wiki/Virtual_address_space), meaning that each process can only interact with a fake view of memory where the OS controls exactly what is accessible.
  • Mr.Robot
    Mr.Robot over 7 years
    acording to serverfault.com/questions/129055/… daemons and services are not the same
  • masterxilo
    masterxilo over 5 years
    "A process creates an environment for these threads of execution which looks like they have an entire machine all to themselves: it is a virtual machine." Very nice way of putting it, never thought about it like that so clearly. But of course the abstraction is leaking. Like, a process that can measure time (which it can do through the processor even) can notice that it is not alone on the machine. And of course the OS does provide mechanisms to enumerate other processes.