diff --git a/Changes b/Changes index 5422159..29c1cfc 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for Sys::Linux::Namespaces +0.015 - May 21 2017 + * Remove a few hacks for signals inside the child that aren't needed since using Linux::Clone instead of unshare only + +0.014 - May 21 2017 + * Return the exit code from waitpid so you can see the status of a process + 0.013 - May 7 2017 * Force target mount option to be an absolute path * Do kill child subprocess on any signal by default. This helps prevent zombie PID 1 processes. diff --git a/lib/Sys/Linux/Namespace.pm b/lib/Sys/Linux/Namespace.pm index ae0b278..1b0018e 100644 --- a/lib/Sys/Linux/Namespace.pm +++ b/lib/Sys/Linux/Namespace.pm @@ -21,8 +21,8 @@ sub debug { print STDERR @_ if $debug; } -our $VERSION = v0.013; -my @signames = keys %SIG; # capture before anyone has probably localized it. +our $VERSION = v0.015; +my @signames = grep {!/^__/} keys %SIG; # capture before anyone has probably localized it. for my $p (qw/tmp mount pid net ipc user uts sysvsem/) { my $pp = "private_$p"; @@ -51,7 +51,6 @@ sub _subprocess { debug "Forking\n"; my $pid = Linux::Clone::clone (sub { local $$ = POSIX::getpid(); # try to fix up $$ if we can. - local %SIG = map {$_ => sub {debug "Got signal in $$, exiting"; _exit(0)}} @signames; debug "Inside Child $$\n"; $code->(%args); @@ -60,7 +59,6 @@ sub _subprocess { croak "Failed to fork: $!" if ($pid < 0); - my $sighandler = local %SIG = map {my $q=$_; $q => sub { debug "got signal $q in $$\n"; kill 'TERM', $pid; diff --git a/t/02-namespace.t b/t/02-namespace.t index 5a9a8d9..06f2f6a 100644 --- a/t/02-namespace.t +++ b/t/02-namespace.t @@ -36,7 +36,7 @@ SKIP: { alarm(5); $pid_ns->run(code => sub { is($$, 1, "Second alarmed init"); - + my $pid = fork(); isnt($pid, undef, "Fork succeeded");