|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63275 Enhance register_shutdown_function docs about SIGTERM handling
Submitted: 2012-10-13 17:44 UTC Modified: 2012-11-12 22:41 UTC
From: eric at wepay dot com Assigned: salathe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2012-10-13 17:44 UTC] eric at wepay dot com
There should be a note added to the documentation on register_shutdown_function 
that the callbacks will not be run if the process is killed via SIGTERM/SIGKILL, 
however they will run if SIGTERM is intercepted with pcntl_signal and the callback 
causes the script to exit cleanly; i.e. pcntl_signal(SIGTERM, function() { exit; 

Given the semantics of SIGTERM (request a clean shutdown of the process), it's 
unintuitive to not get the behavior of using "exit;", although I can see the 
reasoning for doing so.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-31 20:19 UTC] mail+php at requinix dot net
Did you know you can easily submit changes to the online documentation? Look for 
the [edit] link in the top-right corner of manual pages.

Here's a patch with your suggestions:
"register_shutdown_function: callbacks not executed if SIGTERMed/SIGKILLed (bug 
 [2012-11-12 22:34 UTC]
Automatic comment from SVN on behalf of salathe
Log: Adding a note that shutdown functions won't be executed if the script gets a SIGTERM or SIGKILL, though you can pcntl_signal() for the TERM and exit;. (doc #63275)

Provided by anonymous #22227 (
 [2012-11-12 22:41 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Committed requinix's patch.
 [2012-11-12 22:41 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: salathe
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 17:01:28 2023 UTC