cperl
cperl copied to clipboard
Improve sig handling as PID 1 (bypass kernel 10s timeout)
See http://tech-blog.cv-library.co.uk/2017/08/31/perl-as-pid-1-under-docker/
linux treats PID 1 (init) esp. on shutdown, adding a 10 sec timeout (by the kernel).
docker run debian perl -E 'sleep 300' ^C [ waits 10s ]
There's also the reaping childs problem: https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/
go does it's own signal handling, thus enables fast shutdown of docker processes. cperl could easily do the same, when detecting linux and PID 1 bypassing the kernel's timeout on INT and TERM by adding empty SIG_DFL (i.e. undef) signal handlers for those two.