-
Notifications
You must be signed in to change notification settings - Fork 104
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
Default /etc/resolv.conf mount incompatible with systemd #58
Comments
Related to pull request #50 |
not too familiar with this, how would you check for systemd? do your have a heuristic in mind? |
I think it would be fine to just check for the |
Presuming this isn't just images based on systemd. You could potentially have a base image that already puts the correct file there (e.g. by installing dnsmasq or whatnot). In my opinion that file should either be mounted defensively or the mount should explicitly be enabled through an option rather than by default. Having |
I've tried your workaround with ubuntu 20.04 guest (on a ubuntu 20.04 host with packer-builder-arm-image 0.1.4.5 and packer 1.5.6) and it seems to work, but when I try to execute the shell provisioner with: "provisioners": [
{
"type": "shell",
"execute_command": "bash {{ .Path }}",
"script": "provision.sh"
}
] It errors out with (no mater what I put in
Using an Do you have any clue of what is going on? |
closing as fixed by #70 |
Related to #22, when using a systemd-based image like Ubuntu 18.04.4 LTS, the default mount of /etc/resolv.conf fails:
/etc
does exist and so does/etc/resolv.conf
; however it's a symbolic link to../run/systemd/resolve/stub-resolv.conf
which does not exist without starting up systemd.To work around this issue I had to specify
chroot_mounts
in the packer config file to un-include the/etc/resolv.conf
bind, then addadditional_chroot_mounts
to bind/run/systemd
from the host.I think it would be helpful to check for systemd in order to default to the
/run/systemd
chroot mount. If that directory doesn't exist, then I think it's safe to say we're using a sysvinit system and can use the existing/etc/resolv.conf
bind. Of course, this will only work so long as the host VM in vagrant or docker is a systemd host.The text was updated successfully, but these errors were encountered: