Project

General

Profile

Actions

User story #8082

open

Rudder/cfengine fails to edit bind-mounted files on docker

Added by Janos Mattyasovszky over 8 years ago. Updated almost 7 years ago.

Status:
New
Priority:
N/A
Assignee:
-
Category:
Documentation
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

On Docker /etc/hosts is a bind-mounted file, which cannot be moved, just edited.

root@rts_m01_r01:/# cat /proc/mounts  | grep hosts
/dev/sdb /etc/hosts btrfs rw,noatime,space_cache,subvolid=5,subvol=/containers/df161786fd391f3afd72e7f671dad354ae0bae730261b80b79ebbc50b6fcd737/hosts 0 0
root@rts_m01_r01:/#

This causes a promise to fail:

2016-03-18T00:08:57+0100    error: /default/check_generic_file_content/files/'/etc/hosts'[0]: Can't rename '/etc/hosts.cf-after-edit' to '/etc/hosts' - so promised edits could not be moved into place. (rename: Device or resource busy)
2016-03-18T00:08:57+0100    error: /default/check_generic_file_content/files/'/etc/hosts'[0]: Unable to save file '/etc/hosts' after editing

Not sure how this could be solved. I on my side did this by copying the file away, editing it, then cat'ing it back to the same inode it used to have.

Actions

Also available in: Atom PDF