Hi, all,
Should spawn_kill_process send a SIGTERM or SIGKILL to the child under *nix?
- SIGTERM lets the child exit gracefully, removing temporary files etc.
- the original build.c:kill_process from Geany <= 1.24 sends SIGTERM
- the child may refuse to terminate on SIGTERM (or be unable to respond to it because of blocking I/O)
- under Windows, TerminateProcess() is an equivalent of SIGKILL, not SIGTERM
- the API name is "kill", not terminate.
-- E-gards: Jimmy
On 23 September 2015 at 00:35, Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
Hi, all,
Should spawn_kill_process send a SIGTERM or SIGKILL to the child under *nix?
- SIGTERM lets the child exit gracefully, removing temporary files etc.
This says it all, blasting a process and possibly leaving the build system in an unknown state is a "bad thing" (tm).
Also consider the effect when there is more than one spawned process in the build, you may not kill them all, leave zombies, not clean up backend build servers etc. The build should be politely given the chance to clean up, since it might be designed to do so, we don't know.
- the original build.c:kill_process from Geany <= 1.24 sends SIGTERM
Yes, this has been discussed before, but I can't remember where.
- the child may refuse to terminate on SIGTERM (or be unable to respond to
it because of blocking I/O)
- under Windows, TerminateProcess() is an equivalent of SIGKILL, not SIGTERM
Does Windows have a sigterm equivalent? We should not make Linux worse to match Windows.
- the API name is "kill", not terminate.
Its too late to change it now if its in the API.
-- E-gards: Jimmy _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 15-09-22 03:42 PM, Lex Trotman wrote:
On 23 September 2015 at 00:35, Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
Hi, all,
Should spawn_kill_process send a SIGTERM or SIGKILL to the child under *nix?
- SIGTERM lets the child exit gracefully, removing temporary files etc.
This says it all, blasting a process and possibly leaving the build system in an unknown state is a "bad thing" (tm).
[...]
Agree SIGTERM sounds more polite. I think well behaved DEs (or is it in the window manager?) will prompt you to really kill a process if it's not responding, so we could leave that to them.
[...]
- the API name is "kill", not terminate.
Its too late to change it now if its in the API.
For now we could do something like:
/** @deprecated @see spawn_terminate_process() */ gboolean spawn_kill_process(GPid pid, GError **error) { return spawn_terminate_process(pid, error); }
Cheers, Matthew Brush
On 23.9.2015 г. 01:42, Lex Trotman wrote:
On 23 September 2015 at 00:35, Dimitar Zhekovdimitar.zhekov@gmail.com wrote:
Should spawn_kill_process send a SIGTERM or SIGKILL to the child under *nix?
- SIGTERM lets the child exit gracefully, removing temporary files etc.
This says it all, blasting a process and possibly leaving the build system in an unknown state is a "bad thing" (tm).
[...]
Does Windows have a sigterm equivalent? We should not make Linux worse to match Windows.
The standard API doesn't AFAIK. Being "Windows", it's assumed that the used will close the program window for a graceful exit.
It's actually better that way. Tons of misbehaving crap lives under Win~1, and I'd imagine all of it will reject a request for termination if given the chance. :)
- the API name is "kill", not terminate.
Its too late to change it now if its in the API.
On 23.9.2015 г. 03:15, Matthew Brush wrote:
For now we could do something like:
/** @deprecated @see spawn_terminate_process() */ gboolean spawn_kill_process(GPid pid, GError **error) { return spawn_terminate_process(pid, error); }
The name is half-right - it does kill the process under Windows, and actually *asks* it to terminate under POSIX... Also, since both kill(1) and kill(2) are "kill", but you can send any signal, I see no compelling reason to change the name.
-- E-gards: Jimmy