Summary of PHP signal management knowledge

墨辰丷
Release: 2023-03-27 21:50:01
Original
1302 people have browsed it

This article mainly compiles and summarizes relevant information on PHP signal management knowledge. Friends who need it can refer to it

SIGQUIT Create a CORE file to terminate the process and generate a core file
SIGILL Create a CORE file Illegal command
SIGTRAP Create CORE file Tracing trap
SIGBUS Create CORE file Bus error
SIGSEGV Create CORE file Illegal segment error
SIGFPE Create CORE file Floating point exception
SIGIOT Create CORE file Execute I /O trap

SIGSTOP Stop process Stop signal from non-terminal
SIGTSTP Stop process Stop signal from terminal
SIGTTOU Stop process Background process writes to the terminal
SIGTTIN Stop process Background process reads the terminal

SIGHUP Terminate the process Terminal line hangs up
SIGINT Terminate the process Interrupt the process
SIGXGPU Terminate the process CPU time limit timeout
SIGXFSZ Terminate the process File length is too long
SIGPROF Terminate the process Use for statistical distribution chart The timer expires
SIGUSR1 Terminate the process User-defined signal 1
SIGUSR2 Terminate the process User-defined signal 2
SIGVTALRM Terminate the process Virtual timer expires
SIGKILL Terminate the process Kill the process
SIGPIPE Terminate the process Write data to a pipe with no reading process
SIGALARM Terminate process When timer expires
SIGTERM Terminate process Software terminate signal

SIGCONT Ignore signal Continue to execute a stopped process
SIGURG Ignore signal I /O emergency signal
SIGIO Ignore the signal I/O can be performed on the descriptor
SIGCHLD Ignore the signal Notify the parent process when the child process stops or exits
SIGWINCH Ignore the signal The window size changes

1 SIGHUP

This signal is issued when the user terminal connection (normal or abnormal) ends, usually when the terminal control process ends, notifying each job in the same session , then they are no longer associated with the control terminal.

2, SIGINT

The program terminates (interrupt, signal, when the user types the INTR character (usually Ctrl-C , is issued when

3. SIGQUIT

SIGQUIT is similar to SIGINT, but is controlled by the QUIT character (usually Ctrl-,). When the process exits due to receiving SIGQUIT A core file will be generated, which is similar to a program error signal in this sense.

4, SIGILL

SIGILL executed an illegal instruction. Usually because of the executable file itself An error occurs, or an attempt is made to execute the data segment. This signal may also be generated when the stack overflows.

5, SIGTRAP

SIGTRAP is generated by breakpoint instructions or other trap instructions. Used by the debugger.

6. SIGABRT

SIGABRT is generated when the program finds an error and calls abort.
6. SIGIOT

SIGIOT is generated by the iot command on PDP-11, and is the same as SIGABRT on other machines.

7, SIGBUS

SIGBUS illegal address, including memory address alignment ( alignment, error. eg: Accessing a four-word integer, but its address is not a multiple of 4.

8, SIGFPE

SIGFPE Fatal arithmetic occurred Issued when an operation error occurs. It includes not only floating point operation errors, but also all other arithmetic errors such as overflow and division by 0.

9, SIGKILL

SIGKILL Use to immediately end the running of the program. This signal cannot be blocked, processed or ignored.

10. SIGUSR1

SIGUSR1 is left to the user

11. SIGSEGV

SIGSEGV attempts to access memory that is not allocated to itself, or attempts to write data to a memory address that does not have write permission.

12. SIGUSR2

SIGUSR2 is reserved for users

13、 SIGPIPE

Broken pipe

14、 SIGALRM

SIGALRM clock timing signal, which calculates the actual time or clock time. The alarm function uses this signal.

15, SIGTERM

SIGTERM program End (terminate, signal, unlike SIGKILL, this signal can be blocked and processed. It is usually used to require the program to exit normally. Shell command

Kill generates this signal by default.

17. SIGCHLD

SIGCHLD When the child process ends, the parent process will receive this signal.

18. SIGCONT

SIGCONT allows a stopped process to continue execution. This signal cannot be blocked. A handler can be used to allow the program to continue execution when it changes from the stopped state to Complete a specific job. For example, redisplay the prompt

19, SIGSTOP

SIGSTOP to stop the execution of the process. Note the difference from terminate and interrupt: The process has not ended, but execution is suspended. This signal cannot be blocked, processed or ignored.

20. SIGTSTP

SIGTSTP stops the running of the process, but this signal can be processed and ignored. This signal is emitted when the user types the SUSP character (usually Ctrl-Z)

21, SIGTTIN

SIGTTIN when the background job is to be started from the user terminal When reading data, all processes in the job will receive the SIGTTIN signal. By default, these processes will stop executing.

22, SIGTTOU

SIGTTOU is similar to SIGTTIN , but received when writing the terminal (or modifying the terminal mode).

23, SIGURG

SIGURG There is "urgent" data or out-of-band data arriving. Produced when socket.

24, SIGXCPU

SIGXCPU exceeds the CPU time resource limit. This limit can be read/changed by getrlimit/setrlimit

25. SIGXFSZ

SIGXFSZ exceeds the file size resource limit.

26. SIGVTALRM

SIGVTALRM Virtual clock signal. Similar to SIGALRM, but calculates the CPU time occupied by the process.

27, SIGPROF

SIGPROF is similar to SIGALRM/SIGVTALRM, but includes the CPU time used by the process and System call time.

28. SIGWINCH

SIGWINCH is issued when the window size changes.

29. SIGIO

The SIGIO file descriptor is ready and input/output operations can begin.

30, SIGPWR

SIGPWR Power failure

Yes Two signals can stop a process: SIGTERM and SIGKILL. SIGTERM is more friendly. The process can catch this signal and close the program according to your needs. You can end open log files and complete tasks you are doing before closing the program. In some cases, if the process is working and cannot be interrupted, the process can ignore the SIGTERM signal.

The process cannot ignore the SIGKILL signal. This is a "I don't care what you're doing, stop it now" signal. If you send a SIGKILL signal to a process, Linux stops the process there.

The above is the entire content of this article, I hope it will be helpful to everyone's study.


Related recommendations:

PHP userManagement Commonly used interface call methods

php implementation fileManagementMethods to operate with basic functions

php sessionManagementand control

The above is the detailed content of Summary of PHP signal management knowledge. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template