$SIG{'TERM'} = sub { if (MCE->wid > 0) { # worker MCE->exit(0); } else { # parent MCE::Signal::stop_and_exit('TERM'); } };