Skip to content

Conversation

@rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented Aug 2, 2018

Ⅰ. Describe what this PR did

In some images, /etc/mtab is symbol link file, such as:
/etc/mtab -> /proc/mounts, when use /bin/cp -f to overwrite
/etc/mtab, it will cause error, because it will link to /proc/mounts
file on the host.

So we use the option of --remove-destination to remove the symbol file
before overwrite it.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

run testcase TestRunWithMtab

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang [email protected]

@pouchrobot pouchrobot added kind/bug This is bug report for project size/S labels Aug 2, 2018
@allencloud allencloud added the priority/P1 this is high priority that all maintainers should stop to handle this issue label Aug 2, 2018
mtabPrestart := specs.Hook{
Path: "/bin/cp",
Args: []string{"-f", hostmtabPath, mtabPath},
Args: []string{"-f", "--remove-destination", hostmtabPath, mtabPath},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greate work !!!

In some images, `/etc/mtab` is symbol link file, such as:
`/etc/mtab -> /proc/mounts`, when use `/bin/cp -f` to overwrite
`/etc/mtab`, it will cause error, because it will link to `/proc/mounts`
file on the host.

So we use the option of `--remove-destination` to remove the symbol file
before overwrite it.

Signed-off-by: Rudy Zhang <[email protected]>
Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fail case is known issue and it will be fixed in other PR. LGTM

@fuweid fuweid merged commit 04b5951 into AliyunContainerService:master Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug This is bug report for project priority/P1 this is high priority that all maintainers should stop to handle this issue size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants