Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlink $EPREFIX/etc/hosts to host #88

Closed
bedroge opened this issue Mar 4, 2021 · 1 comment · Fixed by #89
Closed

Symlink $EPREFIX/etc/hosts to host #88

bedroge opened this issue Mar 4, 2021 · 1 comment · Fixed by #89
Labels
bug Something isn't working

Comments

@bedroge
Copy link
Collaborator

bedroge commented Mar 4, 2021

I noticed that we don't do this at the moment, which means that tools will now pick up the hosts file from the Prefix. I just did some tests, and this could lead to strange issues, e.g.:

$ /cvmfs/pilot.eessi-hpc.org/2021.02/compat/linux/x86_64/startprefix 
Entering Gentoo Prefix /cvmfs/pilot.eessi-hpc.org/2021.02/compat/linux/x86_64

$ hostname
dh-node12

$ which curl
/cvmfs/pilot.eessi-hpc.org/2021.02/compat/linux/x86_64/usr/bin/curl

$ curl http://dh-node12:9100            
curl: (6) Couldn't resolve host 'dh-node12'

$ /usr/bin/curl http://dh-node12:9100
<html>
			<head><title>Node Exporter</title></head>
			<body>
			<h1>Node Exporter</h1>
			<p><a href="/metrics">Metrics</a></p>
			</body>
			</html>

$ strace curl http://dh-node12:9100 2>&1 | grep hosts
openat(AT_FDCWD, "/cvmfs/pilot.eessi-hpc.org/2021.02/compat/linux/x86_64/etc/hosts", O_RDONLY|O_CLOEXEC) = 5

So I think we should change this by uncommenting:
https://github.com/EESSI/compatibility-layer/blob/main/ansible/playbooks/roles/compatibility_layer/defaults/main.yml#L72

@bedroge bedroge added the bug Something isn't working label Mar 4, 2021
@bedroge
Copy link
Collaborator Author

bedroge commented Mar 4, 2021

Note that the list of (possible) symlinks in that file are based on suggestions by ComputeCanada, so they also have this hosts symlink. See:
#15 (comment)

@boegel boegel closed this as completed in #89 Mar 4, 2021
poksumdo pushed a commit to poksumdo/compatibility-layer that referenced this issue Jun 8, 2023
Ebuild for direnv and add it to the EESSI set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant