A-Z Popular Blog Coding Search »
Coding
 Advertisements
Related Guides
Software Design

IT Artifact

6 Types of Linux Process

 ,
A process is an instance of running software on linux. This has several basic types:

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

Coding

This is the complete list of articles we have written about coding.
Abstraction
Algorithms
API
Bootstrapping
Caching
Code Refactoring
Code Smell
Complexity Hiding
Components
Deep Magic
Edge Case
Event Processing
Forward Compatibility
Hardcoded
IT Artifact
IT Examples
Layers
Microservices
Negative Code
Precomputation
Proof Of Work
Pseudorandom
Reusability
Scalability
Software Design
More ...
If you enjoyed this page, please consider bookmarking Simplicable.
 

Coding

A list of coding considerations and techniques.

Negative Code

An overview of negative code.

Synchronous

The definition of synchronous with examples.

Division By Zero

A complete overview of division by zero and why it has no meaning.

Null

An overview of null with examples.

Null Pointer Exceptions

How to prevent, troubleshoot and handle null pointer exceptions.

ls

A quick reference of useful ls commands.

Linux Commands

A list of unusually useful linux commands with brief explanations.

Runtime Error

The definition of runtime error with examples.
The most popular articles on Simplicable in the past day.

New Articles

Recent posts or updates on Simplicable.
Site Map