aboutsummaryrefslogtreecommitdiffstats
path: root/iurt_root_command
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2017-10-04 09:12:10 +0100
committerPascal Terjan <pterjan@mageia.org>2017-10-04 09:12:57 +0100
commit7f45a579b350d4ff449994a92fa3f76919302f01 (patch)
tree2f8f190f10e2bc45004aa7ea53101a0af8ca2537 /iurt_root_command
parent8f6713833256ebd299f20c9634262009fafee359 (diff)
downloadiurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar.gz
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar.bz2
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar.xz
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.zip
Make sure hostname resolves
Diffstat (limited to 'iurt_root_command')
-rwxr-xr-xiurt_root_command6
1 files changed, 5 insertions, 1 deletions
diff --git a/iurt_root_command b/iurt_root_command
index 18068d0..df9b5e5 100755
--- a/iurt_root_command
+++ b/iurt_root_command
@@ -418,7 +418,11 @@ sub netfs_create {
check_path_authorized($dest) or return;
my $nsname = basename($dest);
system("ip", "netns", "add", $nsname) and return;
- return !system("ip", "netns", "exec", $nsname, "ifconfig", "lo", "up");
+ system("ip", "netns", "exec", $nsname, "ifconfig", "lo", "up");
+ my $hostname = `hostname`;
+ system("echo '127.0.0.1 localhost $hostname' > $dest/etc/hosts");
+ system("echo > $dest/etc/resolv.conf");
+ return 1;
}
sub netfs_delete {