A daemon is a process that has a long lifetime. They often start when the system boots, and only terminate when the system shuts down. Because they do not have control terminals, they are running in the background.Features of the daemon processThe
Review:Process creationFork ();Process terminationExit (0)/return 0;Process waitWait ()/waitpid (pid,null,0);Process substitutionexec function Family------------------------1.system () functionSystem-execute a shell command#include int system (const
1, what is the pipelineThe pipe is half-duplex, the data can only flow in one direction, need to establish two pipelines when the two sides communicate, can only be used for parent-child process or sibling process (affinity process); Separate file
What is a daemon process? The daemon (Daemon process), which is usually called the Daemon process (daemon), is the background service process in Linux. It is a long-lived process, usually independent of the control terminal and periodically performs
The system () function is powerful, I know more about the implementation of Linux, the specific analysis of this, the similar in Windows is an unknown solution. OK, first look at the Linux version of the system function source code: #include
Man vfork:NAMEVfork- Create a child process and block parentSynopsis#include #include pid_t vfork (void);DESCRIPTIONStandard description(from Posix.1) The Vfork () function has the same effect as fork (2), except that the behav‐IOR is undefined if
Orphan process and daemon processThrough the previous study we learned how to create a process through the fork () function and the vfork () function. Now let's go into two special processes: The orphan process and the daemon.I. The orphan process1.
Linux Server Development Preliminary
Chen Qin Yang
server development needs to consider a lot of things, such as server architecture, stability, performance and load capacity, and so on. In fact, in the process of developing a server,
one, System () Understanding
Function: the system () function calls "/bin/sh-c command" to execute a specific command, blocking the current process until the command command has finished executing
Prototype:
int system (const char *command);
return
When there is more than one process in the system, which process executes first, and which process after execution is determined by the priority of the process. The priority of a process is determined by the Nice value, and the lower the Nice value,
Void DaemonInit (void){
// LOG: INF ("[ServerMeeting] service initialization. \ n ");Int pid;
// If it is a parent process, terminate the parent process and the child process continuesIf (pid = fork ()){Exit (0 );}/* Else if (pid {Exit (1); // fork
By using the code downloaded from the internet, the daemon process is successfully implemented. The original daemon process is very simple.
Execute in main Function
Init_daemon (); // initialize to Daemon
You can turn the process into a daemon
The following articles mainly introduce the actual configuration of qmailadmin + vpopmail + MySQLfilter. If you are interested in the actual operations, you can click and view the following articles. I hope it will help you with the actual
I received a telephone interview from an Internet company a few days ago. The interviewer asked me twice about the role of fork (). I was confused and said I did not know. The knowledge is still too narrow. The following summarizes the functions of
The Linux daemon (Daemon) is a Linux background service process that is disconnected from the control terminal and is managed directly by the Linux init process, and even if you close the console, Daemon works in the background.In a word, daemon
1. What is a zombie process?
The zombie, defunct, PS, and top commands of zombie processes can be seen. It refers to a process in the "zombie" state. Such a process is dead, but it is still stored in some way. It is said that it has died because
Description:
Simple file transfer is achieved through the TCP protocol. Requirements:1. The server is a daemon and the port number is 10000.2. Before transferring files, the client should first enter the user name and password for authentication.
I. inter-process communication
Each process has a different user address space. The global variables of any process cannot be seen in another process. Therefore, to exchange data between processes, a buffer zone must be opened in the kernel through
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.