Skip to content

Commit

Permalink
Merge pull request #83392 from Ma27/nixos-container-nsenter-20.03
Browse files Browse the repository at this point in the history
Revert "nixos-container: use systemd-run instead of nsenter"
  • Loading branch information
worldofpeace committed Mar 26, 2020
2 parents 01c61f3 + 7f1ba60 commit a3a02d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkgs/tools/virtualization/nixos-container/nixos-container.pl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Cwd 'abs_path';
use Time::HiRes;

my $nsenter = "@utillinux@/bin/nsenter";
my $su = "@su@";

# Ensure a consistent umask.
Expand Down Expand Up @@ -319,10 +320,9 @@ sub restartContainer {
# Run a command in the container.
sub runInContainer {
my @args = @_;

exec("systemd-run", "--machine", $containerName, "--pty", "--quiet", "--", @args);

die "cannot run ‘systemd-run’: $!\n";
my $leader = getLeader;
exec($nsenter, "-t", $leader, "-m", "-u", "-i", "-n", "-p", "--", @args);
die "cannot run ‘nsenter’: $!\n";
}

# Remove a directory while recursively unmounting all mounted filesystems within
Expand Down

0 comments on commit a3a02d6

Please sign in to comment.