@@ -9,6 +9,7 @@ use Getopt::Long qw(:config gnu_getopt);
99use Cwd 'abs_path';
1010use Time::HiRes;
1111
12+my $nsenter = "@utillinux@/bin/nsenter";
1213my $su = "@su@";
1314
1415# Ensure a consistent umask.
@@ -319,10 +320,9 @@ sub restartContainer {
319320# Run a command in the container.
320321sub runInContainer {
321322 my @args = @_;
322−
323− exec("systemd-run", "--machine", $containerName, "--pty", "--quiet", "--", @args);
324−
325− die "cannot run ‘systemd-run’: $!\n";
323+ my $leader = getLeader;
324+ exec($nsenter, "-t", $leader, "-m", "-u", "-i", "-n", "-p", "--", @args);
325+ die "cannot run ‘nsenter’: $!\n";
326326}
327327
328328# Remove a directory while recursively unmounting all mounted filesystems within