Init
Init is one of the first processes started when linux boots. It is a daemon process that continues running until linux is shut down. In other words, it can't be killed. Most processes have init as a parent or grandparent. Init usually has the process id 1 and the parent process id 0. Some kernel processes also have the process id 1 and the parent process id 0.Parent
A parent process is a process that has created other processes known as children. Child processes belong to the parent and are terminated with the parent. In linux, every process has a parent except the init process and a few other kernal processes.Child
A child is a process that has been created by a parent. In linux, all processes except init are children of a process. When you kill a child process the parent doesn't terminate. The command ps can be used to identify the id of the parent for each process.In the example above, the processes 1701 and 1702 have the process 1333 as a parent. This means that if you kill 1333, the processes 1701 and 1702 should also terminate.Interactive
An interactive process is initialized and controlled through a terminal session. These may display output to a user and collect user input such as commands. Interactive processes have the terminal session process as a parent and are terminated with the session. When you run a command from a command prompt it is run as an interactive process by default and will not survive when you close the terminal window.Background
A background process is a process that is run independently of a terminal session. This can be run from a terminal session with the following syntax.nohup command &>/dev/null &
The command nohup, for no hang up, disconnects the command from your terminal session so that it will survive the termination of your session. The syntax "&>/dev/null" redirects the output of your command to nowhere. You can also redirect output to any file by changing the path from /dev/null to a valid filename.nohup command &>/home/me/supergreat.log &
The final & at the end of the command is necessary to help push the command into the background.nohup command &>/home/me/supergreat.log &
Daemon
A daemon is a process that is started as a system service. These are background processes that receive special treatment by the operating system such as a higher level of logging. The normal way to launch a daemon process is to configure a script in the directory /etc/init.d. It is a common convention to name daemon executables with a "d" at the end. For example, the system ftp daemon is typically named "ftpd."Overview: Linux Processes | ||
Type | ||
Definition | An instance of running software on linux. | |
Related Concepts |