Remove some hacks and clean it up a little
This commit is contained in:
parent
8ce0412a8f
commit
66a2d6bd01
3 changed files with 9 additions and 5 deletions
6
Changes
6
Changes
|
@ -1,5 +1,11 @@
|
||||||
Revision history for Sys::Linux::Namespaces
|
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
|
0.013 - May 7 2017
|
||||||
* Force target mount option to be an absolute path
|
* 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.
|
* Do kill child subprocess on any signal by default. This helps prevent zombie PID 1 processes.
|
||||||
|
|
|
@ -21,8 +21,8 @@ sub debug {
|
||||||
print STDERR @_ if $debug;
|
print STDERR @_ if $debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
our $VERSION = v0.013;
|
our $VERSION = v0.015;
|
||||||
my @signames = keys %SIG; # capture before anyone has probably localized it.
|
my @signames = grep {!/^__/} keys %SIG; # capture before anyone has probably localized it.
|
||||||
|
|
||||||
for my $p (qw/tmp mount pid net ipc user uts sysvsem/) {
|
for my $p (qw/tmp mount pid net ipc user uts sysvsem/) {
|
||||||
my $pp = "private_$p";
|
my $pp = "private_$p";
|
||||||
|
@ -51,7 +51,6 @@ sub _subprocess {
|
||||||
debug "Forking\n";
|
debug "Forking\n";
|
||||||
my $pid = Linux::Clone::clone (sub {
|
my $pid = Linux::Clone::clone (sub {
|
||||||
local $$ = POSIX::getpid(); # try to fix up $$ if we can.
|
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";
|
debug "Inside Child $$\n";
|
||||||
|
|
||||||
$code->(%args);
|
$code->(%args);
|
||||||
|
@ -60,7 +59,6 @@ sub _subprocess {
|
||||||
|
|
||||||
croak "Failed to fork: $!" if ($pid < 0);
|
croak "Failed to fork: $!" if ($pid < 0);
|
||||||
|
|
||||||
my $sighandler =
|
|
||||||
local %SIG = map {my $q=$_; $q => sub {
|
local %SIG = map {my $q=$_; $q => sub {
|
||||||
debug "got signal $q in $$\n";
|
debug "got signal $q in $$\n";
|
||||||
kill 'TERM', $pid;
|
kill 'TERM', $pid;
|
||||||
|
|
Loading…
Add table
Reference in a new issue