After installing Hadoop, there are a few processes that can be used with JPS.In Master there are:NamenodeSecondarynamenodeJobtrackerThere are slaves in theTasktrackerDatanode1. NameNodeIt is the primary server in Hadoop, which manages the file System namespace and access to files stored in the cluster.2. SecondarynamenodeIt is not a redundant daemon for namenode, but rather a periodic checkpoint and cleanup
to turn this job into a foreground job run. But what happens if background jobs are output to the control terminal? We can prohibit this situation by stty order. At this point, the terminal driver sends a SIGTTOU signal to the background job to block its process, and of course we can also use FG to move it to the foreground.Daemon ProcessThe daemon (daemon) often starts when the system boots and terminates when the system shuts down. Because the daemon does not control the terminal (its termina
A daemon (Daemon) is a special process that runs in the background. It is independent of the control terminal and periodically performs some kind of task or waits
Handle certain events that occur. Daemons are a very useful process.
Most Linux servers are implemented with daemons. For example, the Internet server Inetd,web server httpd and so on.
At the same time, the daemon completes many system tasks. For
what is daemon and services (service)Linux Daemon (daemon) is a special process running in the background. It is independent of the control terminal and periodically performs some sort of task or waits for certain events to be processed. It does not require user input to run and provide some kind of service, is not the whole system is to provide services to a user program. Most of the servers in a Linux system are implemented through a daemon process.Common
I. Daemon processDaemons, also known as the wizard (Daemon) process, as the name implies, the Guardian is always there, it is running in the background of a special process, independent of the control terminal and periodically perform certain tasks or wait to handle certain occurrences of the event. For example, when the Linux system starts, it starts some system service processes, because these processes do not control the terminal and therefore cannot directly interact with the user, its life
Daemon: It is usually defined as a background process, and it does not belong to any Terminal session (Terminal sessions). Many system services are implemented by daemons, such as network services, printing, and so on. The following article gives you a sample of how Python implements the daemon, and the friends you need can refer to it.
Scene Settings:
You write a Python service program and start at the command line, and your command lines are contro
than its virtual address space of the Sigsys system call in the wrong parameter, such as the system call number illegal sigpipe write data to a non-read pipeline sigalrm alarm. This signal is sent when a process wants to receive a signal after a certain time. SIGTERM software termination (software termination) SIGUSR1 user-defined signal 117 SIGUSR2 user-defined signal 218 SIGCLD a child process dead 19 SIGPWR Power failure
Implementing Daemons
A daemon is a special process that runs in the background. It is independent of the control terminal and periodically performs some sort of task or waits to handle certain occurrences. Daemons are a useful process, and most Linux servers are implemented with daemons.Steps to create the daemon:1. Make the process run in the background (create child process, parent process exits)if ((Pid=fork ()) >0)Exit (0);else if (pid{Perror ("fail to fork");Exit (-1
Daemons, sessions, and process groups have a lot of good information on the web. I also collected a bunch of online, plus my own understanding. Dare not say original, just write in this fear oneself forget it. Caishuxueqian, inevitably have the mistake, welcome everybody to correct. The following writing is very good, we can go to see: http://www.cnblogs.com/forstudy/archive/2012/04/03/2427683.html. The following section refers to his description.Proc
CentOS Study Notes-system services (daemons), centosdaemonsSystem Service (daemons)
For some functions, the system must provide some services (whether the system itself or the network). This service is called a service. However, the provision of services always requires the running of programs! Otherwise, how should we run it? So we call the service daemon program! For example, the program that reaches the
session can be divided into a foreground process group and one or more background process groups. Therefore, a session should include the control process (session first process), a foreground process group, and any background process group.4. Control TerminalA session has only one control terminal, and the control terminal is connected to the lead process of the process group in session.5. Daemon Process。 The reason for the existence of the daemon function is because the control terminal sends
Access control of the transient daemonwe know that the transient daemon is made up of the Super daemon process xinetd management, due to the super-guardian process to accept TCP Wrappers access control, so the transient daemon also accepts TCP Wrappers of control management. Although TCP Wrappers access restrictions can be made to the transient daemon, but he can only control which users have access to which services and cannot precisely control the use of each service. For example, control the
This is a creation in
Article, where the information may have evolved or changed.
Package Main
Import (
"OS"
"Os/exec"
"Path/filepath"
)
If OS. Getppid ()!=1{//Determine if it is a child process, and the child process will be taken over by system 1th process when the parent process return
Filepath,_:=filepath. Abs (OS. ARGS[0])//Convert the execution file path in the command line argument to the available path
Cmd:=exec.command (Filepath,os. Args[1:] ...)
Passing other commands into the generat
=" Http://s2.51cto.com/wyfs02/M02/7F/D2/wKioL1cu5xzQRSIGAABqjpn3UIc316.png "style=" float: none; "title=" 3.png "alt=" Wkiol1cu5xzqrsigaabqjpn3uic316.png "/>650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/D2/wKioL1cu5xzR18BdAAAhFAph4Ec401.png "style=" float: none; "title=" 4.png "alt=" Wkiol1cu5xzr18bdaaahfaph4ec401.png "/>Viewing processes in the system using the PS AXJ commandParameter A indicates that not only the process of the current user is listed, but also all other users '
??" *stop "operation; 3, find/etc/rc.d/rcn.d/s?? * Start the file and run "/etc/rc.d/rcn.d/s"?? *start "operation. For example, the files in the corresponding RC3.D directory have changed after the VSFTPD has been set up above:[Email protected] init.d]# Ls-l/etc/rc.d/rc3.d/| grep vsftpdlrwxrwxrwx. 1 root root 13:25 s60vsftpd. /init.d/vsftpdChkconfig: Setting up your own system service requires creating a new shell script in the/ETC/INIT.D directory and then executing the chkconfig command to add
, the RPC client.
The Web server saves this ID as a task record.
RPC Service processing instructions on the node, as for the processing instructions, we also discuss on the node in a separate process P to handle, because the RPC service also can not let RPC client silly wait
After processing P has finished processing, the execution result and task ID are used as parameters to callback the Web server's web interface
After the Web server receives a callback from the RPC service, it
is not the process leader and that the process cannot open a terminalPID =Fork (); if(PID >0) {exit (0);//if the PID of the parent process (that is, the previous subprocess) is returned then end the process } Else if(PID 0 ) { return-1; } //What is Nofile //Close all file descriptors that are not required to inherit from the parent process//What isFile Descriptor for(i =0; i ) ); //change the working directory so that the process does not contact any file system//Th
connected with the terminal, so fork again, the first child process (the first fork produced by the process) exit, the latest child process ( The second fork-generated process) is not a reply to the first process is not eligible to get back to the control terminal.Some also handle sighup signals, see Advanced Programming for UNIX environments for SIGHUP signalsThe second method:Direct access to the functions provided by Linux Daemon ()1 #include 23int main ()4{5 Daemon (0,0); 6 while
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.