Skip to content

pkg update of base system pkg enters infinite loop if upgrade target file is mountpoint #2589

@dch

Description

@dch

background

In OCI containers, the podman tool mounts a per-network /etc/hosts file into the jail, to provide name resolution between containers. pkg does not like this, and is unable to handle the failure.

issue

During pkg update -r FreeBSD-base the FreeBSD-runtime package includes /etc/hosts as well.

The update will appear to hang, consuming 100% CPU core indefinitely.

procstat was unhelpful but ktrace shows this happening continuously:

 99531 pkg      NAMI  "etc/.[pkgtemp.hosts](http://pkgtemp.hosts/).n1H6tDhSrrjZ"
 99531 pkg      NAMI  "etc/hosts"
 99531 pkg      NAMI  "etc/.[pkgtemp.hosts](http://pkgtemp.hosts/).n1H6tDhSrrjZ"
 99531 pkg      NAMI  "etc/hosts"
 99531 pkg      NAMI  "etc/.[pkgtemp.hosts](http://pkgtemp.hosts/).n1H6tDhSrrjZ"
 99531 pkg      NAMI  "etc/hosts"
...

workaround

For oci containers, add --no-hosts during your podman build or buildah invocation and the /etc/hosts file will not be mounted, avoiding the loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions