diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2019-09-14 13:22:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-14 13:22:35 +0000 |
commit | a0a3f5c86ce04a820035855a081d3acb7f353201 (patch) | |
tree | 5ed645bad97a92e471c48faea82ba35f086b5fbe /pkgs/tools/virtualization | |
parent | 0b32f6f78cc3082c80b96b9507af4f35b3d44578 (diff) | |
parent | 7cb100b6833e020d4a4b25c3766cfde507e763e6 (diff) |
Merge pull request #67332 from uvNikita/nixos-container/run
nixos-container: use systemd-run instead of nsenter
Diffstat (limited to 'pkgs/tools/virtualization')
-rwxr-xr-x | pkgs/tools/virtualization/nixos-container/nixos-container.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/tools/virtualization/nixos-container/nixos-container.pl b/pkgs/tools/virtualization/nixos-container/nixos-container.pl index b5ceb522e230..2a9625501b65 100755 --- a/pkgs/tools/virtualization/nixos-container/nixos-container.pl +++ b/pkgs/tools/virtualization/nixos-container/nixos-container.pl @@ -9,7 +9,6 @@ use Getopt::Long qw(:config gnu_getopt); use Cwd 'abs_path'; use Time::HiRes; -my $nsenter = "@utillinux@/bin/nsenter"; my $su = "@su@"; # Ensure a consistent umask. @@ -270,9 +269,10 @@ sub restartContainer { # Run a command in the container. sub runInContainer { my @args = @_; - my $leader = getLeader; - exec($nsenter, "-t", $leader, "-m", "-u", "-i", "-n", "-p", "--", @args); - die "cannot run ‘nsenter’: $!\n"; + + exec("systemd-run", "--machine", $containerName, "--pty", "--quiet", "--", @args); + + die "cannot run ‘systemd-run’: $!\n"; } # Remove a directory while recursively unmounting all mounted filesystems within |