Redis Sigterm Signal

Source: Internet
Author: User
Tags pkill

This is the case that happened today when testing the Redis3.0.0 cluster. When I stopped the Redis service, I stopped the Redis service using Pkill redis-server and kill-9 Redis-pid respectively, but the Redis log output was different.

when using Pkill to stop Redis, enter the following log. Indicates that Redis is exiting normally.

16017:signal-handler  (1423639887)  Received SIGTERM scheduling  Shutdown ... 16017:m 10 feb 23:31:27.163 # user requested shutdown ... 16017:m 10 feb 23:31:27.164 * calling fsync ()  on the AOF  File.16017:m 10 feb 23:31:27.164 * saving the final rdb snapshot  before exiting.16017:M 10 Feb 23:31:27.213 * DB saved on  Disk16017:m 10 feb 23:31:27.213 # redis is now ready to exit ,  bye bye ... 


Redis does not have any log output when using kill-9 to stop Redis, stating that it is not right to stop the Redis service with the KILL command.


from the above log can also be seen, if redis normal exit, need to send a sigterm signal to Redis. And Pkill is to kill all the processes that contain parameters, if you want to kill a single process, and the Sigterm command can be issued? The answer is yes, through kill-15 redis-pid.


Now, to summarize, if you want to stop the Redis service properly, you can stop all Redis services with the Pkill command or use kill-15 redis-pid to stop a Redis service.


By the way, Pkill and kill.

Pkill: Find or signal to a process by name and other attributes .

Kill: There are 64 parameters that can be viewed through the kill-l command, with 5 commonly used as follows:

    • 1) SIGHUP: This signal is issued at the end of the user terminal connection (normal or abnormal), usually at the end of the control process of the terminal, notify the same session of the various jobs, then they are no longer associated with the control terminal.

    • 2) SIGINT: Program termination (interrupt) signal, issued when the user types Intr characters (usually ctrl-c), to notify the foreground process group to terminate the process.

    • 3) Sigquit: Similar to SIGINT, but controlled by the quit character (usually ctrl-\). The process generates a core file when it receives a sigquit exit, similar to a program error signal in this sense.

    • 9) SIGKILL: Used to immediately end the operation of the program. This signal cannot be blocked, processed, or ignored. If an administrator discovers that a process is not terminating, try sending this signal.

    • SIGTERM: End of program (terminate) signal, unlike Sigkill, the signal can be blocked and processed. Typically used to require the program to exit gracefully, the shell command kill generates this signal by default. If the process does not stop, we will try to Sigkill.



Redis Sigterm Signal

Related Article

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.