{"width":"100%","description":"SIGTERM\u3092\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3059\u308b\u3002 \u8abf\u3079\u305f\u3089\u3001\u6a19\u6e96\u30d1\u30c3\u30b1\u30fc\u30b8\u306esignal \u304c\u3042\u3063\u305f import signal import sys def sigterm_handler(signal_number, stack_frame): some_function_to_clean_up() sys.exit(0) signal(signal.SIGTERM, sigterm_handler) \u306a\u308b\u307b\u3069\u30fc \u3053\u308c\u3067\u3001 SIGTERM \u3084 SIGINIT \u53d7\u3051\u305f\u6642\u306e\u52d5\u4f5c\u304c\u4f5c\u308c\u305d\u3046\u3067\u3059\u306d\u3002 \u53c2\u8003\u8cc7\u6599 http://stackoverflow.com/questions/18499497/how-to-p\u2026","type":"rich","height":"190","author_name":"takuya_1st","blog_url":"https://takuya-1st.hatenablog.jp/","provider_name":"Hatena Blog","categories":["python"],"version":"1.0","title":"Python\u3067\u30b7\u30b0\u30ca\u30eb(sig term)\u3092\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3059\u308b\u3002","provider_url":"https://hatena.blog","blog_title":"\u305d\u308c\u30de\u30b0\u3067\uff01","url":"https://takuya-1st.hatenablog.jp/entry/2016/04/25/034932","published":"2016-04-25 03:49:32","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakuya-1st.hatenablog.jp%2Fentry%2F2016%2F04%2F25%2F034932\" title=\"Python\u3067\u30b7\u30b0\u30ca\u30eb(sig term)\u3092\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3059\u308b\u3002 - \u305d\u308c\u30de\u30b0\u3067\uff01\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/takuya_1st/"}