usr signal interpretation in kill
USR1 is also commonly used to inform application overloading profiles, for example, sending a USR1 signal to an Apache HTTP server will cause the following steps to occur: Stop accepting new connections, wait for the current connection to stop, reload the configuration file, reopen the log file, restart the server, This allows for relatively smooth, non-shutdown changes.
On POSIX-compliant platforms,SIGUSR1 and SIGUSR2 are signals sent to a process that represent user-defined situations. Their symbolic constants are defined in the header file signal.h. On different platforms, the number of the signal may change, so you need to use the symbol name.
Kill-hup pid or Killall-hup pName:
Where PID is the process identity, PName is the name of the process
If you want to change the configuration without stopping and restarting the service, you can use the two commands above. After making the necessary changes to the configuration file, issue the command to dynamically update the service configuration.
By convention, when you send a hang signal (signal 1 or HUP), most server processes (all common processes) perform a reset operation and reload their configuration files.
Description of the KILL command
-L signal, if no signal number parameter, then use "-l" parameter will list all the signal name -a When the current process is processed, the correspondence between the command name and the process number is not restricted -p specifies that the KILL command prints only the process number of the related process without sending any signal -s specifies the send signal -u specified user
Note: 1. Kill command can be with signal number option or without. If there is no signal number, the KILL command will emit astop signal (2123 It is equivalent to pressing CTRL + C while running the PID 123 process in the foreground. However, a normal user can only use a KILL command without the signal parameter or a maximum of9 signals. 2, it should be noted that the signal to force the process to terminate, which often brings some side effects, such as data loss or terminal can not return to normal state. Be careful when sending a signal, only use the Kill signal (9) only if it is a last resort, because the process cannot capture it first.
0. Because some commands that run in the background start multiple processes, it's a hassle to track down and find the PID of all the processes you want to kill. At this point, it is a valid method to use Kill zero to terminate all processes initiated by the current shell.
Description
Only the 9th signal (SIGKILL) can terminate the process unconditionally, other signal processes have the right to ignore. The following are commonly used signals:
HUP 1 terminal disconnection
INT 2 Interrupt (with Ctrl + C)
Quit 3 exit (with Ctrl + \)
Term 15 termination
Kill 9 Forced termination
CONT 18 Continuation (contrary to stop, FG/BG command)
Stop 19 paused (with Ctrl + Z)
Instance: kills all processes of the specified user
Command:
Kill-9 $ (ps-ef | grep peidalinux)
Kill-u Peidalinux
Output:
[[email protected] ~]# kill-9 $ (ps-ef | grep peidalinux)
[Email protected] ~]# kill-u peidalinux
Description
Method One, filter out the Hnlinux user process and kill
Linux kill command and USR1 signal interpretation