Process :- Process can be defined as “ Any program in execution is called processs”
Daemon Process :- A daemon process is a program that is run in the background and provide some system services. On a Linux system, some processes start at boot time and continue running until the system is powered down or until you execute a kill command. These processes typically provide some specific function such as serving pages , sharing print queue or processing loging requests. In Unix World these types of processes are called daemons.
A daemon process runs in the background , waiting for events to happen , When the daemon receives a request , typically it forks a copy of itself to process the request. Meanwhile the parent goes back to wait for the next event or request.
The Apache Webserver is an example of a daemon, It starts running when the system first boots, and remains in the memory servicing requests for web pages until the system is shutdown or “httpd”
daemon is manually stopped.
daemon is manually stopped.
Types of Daemons :-
- Standalone
- Transient (Controlled by the super daemon xinetd)
Daemons may be started up in a number of ways. “standalone” daemons are programs that run all the time & are started up either bu init (such as mingetty and gdm) or by a startup script under /etc/rc.d. “Transient” daemons are only started up when they are needed,& are controlled by a standalone daemon called xinetd. Standalone daemons can be used more quickly, but take up the space in the memory and cpu cycles all the time, whether or not they are actively being used.
Typically a daemon process is not connected to a TTY, so is shown in a ps report with a TTY of '?'.From this , you may also recognize processes which are managed by daemons, as they too will show a '?' in the TTY field
Process States :-
Running: This is a state where a process is either in running or ready to run.
Interruptible: This state is a blocked state of a process which awaits for an event or a signal from another process
Uninterruptible: It is also a blocked state. The process is forced to halt for certain condition that a hardware status is waited and a signal could not be handled.
Stopped: Once the process is completed, this state occurs. This process can be restarted
Zombie or Defunct process : Just before a process dies ,it notifies its parent & waits for acknowledgement .If the parent process does not acknowledge this notification,all the resources except for the PID are released . Zombie Process are cleared from the system during the next system reboot.
Command to see the zombie process :
[root@mail7 ~]# ps -ef
| |||||||
UID
|
PID
|
PPID
|
C
|
STIME
|
TTY
|
TIME
|
CMD
|
| root | 1 | 0 | 0 | May10 | ? | 00:00:00 | init [3] |
| root | 2 | 1 | 0 | May10 | ? | 00:00:12 | [migration/0] |
| root | 3 | 1 | 0 | May10 | ? | 00:00:00 | [ksoftirqd/0] |
| root | 4 | 1 | 0 | May10 | ? | 00:00:00 | [watchdog/0] |
| root | 5 | 1 | 0 | May10 | ? | 00:00:00 | [events/0] |
Where:
- -e to display all the processes.
- -f to display full format listing.

No comments:
Post a Comment