Linux Daemons

Daemons: Services on Linux that works as background processes. Process- Instance of a running program. For example: Lets launch nano, go to bash and command ps -aux. (pic) We have a process running for nano, now lets close the nano. (pic) Now those processes are gone.

Lets run ps -aux on our bash/terminal. (pic) There are lots of processes running and most of them are daemons.

Daemon are the processes we dont start, they are like services, like in windows we have background processes running known as services like ntp(network time protocal). Similarly, on linux we have daemons (we dont start them), they are essential like printing daemon, ssh daemon, networkiing daemon.

How to differentiate a normal process and a Daemon?

A daemon process will have ā€˜dā€™ at the end which stands for daemon like sshd(ssh deamon).

For example: ps -aux | ssh (pic)

How to control Daemons?

  • Managing services in linux running in bg
  • By managing the master daemon: systemd(he commands all the other daemons) it starts, stops and restart the daemon, it is also a daemon, source manager, initiliatiion system(init system),
  • Boot the kernel-> systemd->mounitng the fs->starting the services
  • systemd is the first process and from it other services are started using the process of forking
  • Type pstree(process tree): systemd is the orginal process and all the process is branched off it.
  • ps -aux : You will see each process is having its own process id(pid) you will see pid 1 = systemd
  • There are other init systems too like openrc(gentoo), etc, but most of the linux distros have systemd.

service and process management:

Systemctl (control the daemons)

STOP a linux service

Start a linux service

see linux sercie status

restart a linux service

start a service at boot(enable)

how to hunt for daemons(services)

Troubleshoot linux services(daemons)

MASKING AND TARGETS???