aboutsummaryrefslogtreecommitdiffstats
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
parent8f6713833256ebd299f20c9634262009fafee359 (diff)
downloadiurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar.gz
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar.bz2
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.tar.xz
iurt-7f45a579b350d4ff449994a92fa3f76919302f01.zip
Make sure hostname resolves
-rw-r--r--NEWS2
-rwxr-xr-xiurt_root_command6
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index be905fb..cb885a9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-- iurt: bring lo up in the chroot
+- iurt: bring lo up in the chroot and point hostname to 127.0.0.1
0.7.1
- iurt: also use --urpmi-root for urpmi.addmedia
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 {