Daemon features of daemon

Source: Internet
Author: User

First, let's take a look at some common system daemon processes and how they.

Ps (1) command to print the status of each process in the system.

ps -axj

Option-a displays the status of processes owned by other users. -X shows the process status of the uncontrolled terminal. -J displays information related to the job: Session ID, process group ID, control terminal, and terminal Process Group ID.

Ps output is roughly:

For the moment, we should first consider the columns in the red border. In order, the titles of each column are as follows: parent process ID, process ID, process group ID, session ID, terminal name, Terminal Process Group ID (foreground process group associated with the control terminal), user ID, and command string.

The system process depends on the operating system implementation.Processes with a parent process ID of 0 are usually kernel processes.And they are started as part of the system self-lifting process. (Init is an exception to this process. It is the user-layer command started by the Kernel During the bootstrap process .)The kernel process is special and usually exists throughout the lifecycle of the system. They run with Super User privileges, without control terminals, and without command lines.

Process 1 is usually init. It is a system daemon that starts a system service at a specific operating level. These services are usually implemented with the help of their own daemon.

In Linux,Keventd daemonProvides the process context for the function running in the kernel.Kapmd daemonSupports advanced power management in many computer systems.Kswapd daemonIt is also called pageout daemon ). It writes dirty pages to disks at a low speed so that these pages can still be recycled as needed. This mode supports the virtual storage subsystem.

The Linux kernel uses twoDaemon bdflush and kupdatedFl data in the cache to the disk. When the available memory reaches the limit, the bdflush daemon clears the dirty buffer from the buffer pool (buffer cache) to the disk. At intervals, the kupdated daemon flushes dirty pages to the disk to reduce data loss when the system fails.

Port ingDaemon portmapProvides services that map Remote Procedure Call (RPC) program numbers to network port numbers.Syslogd daemonProvides the service for logging system messages. You can print these messages on an actual console or write them to a file.

Mentioned in http://www.cnblogs.com/nufangrensheng/p/3513254.htmlInetd daemon(Xinetd), which listens to system network interfaces to obtain requests from networks for various network service processes.Nfsd, lockd, and rpciod daemonProvides support for Network File System (NFS.

Cron Daemon (crond) Run the specified command on the specified date and time. Many system management tasks are implemented by cron regularly executing related programs.Cupsd daemonIt is a fake offline printing process that processes all print requests made to the system.

Note that most daemon run with the superuser (User ID: 0) privilege. No daemon has a control terminal, and its terminal is set to question mark (?), The frontend Process Group ID of the terminal is set to-1. The kernel daemon is started as a non-control terminal. The user-layer daemon does not have a control terminal. It may be the result that the daemon calls setsid. All user-layer daemon processes are the leader processes of the process group and the first processes of the session. They are also the only processes in these process groups and sessions. Finally, it should be noted that the parent process of most daemon processes is the init process.

This blog is excerpted from advanced programming for UNIX environments (version 2) and used only for personal learning records. For more information about this book, see:Http://www.apuebook.com/.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.