Page MenuHomeVyOS Platform

Double bind mount of /config makes files in /config and /opt/vyatta/etc/config go out of sync
Closed, ResolvedPublicBUG

Description

Must be overlayfs playing tricks on us. I've noticed this when testing my new migration script. I'm not sure if it happens with old migration scripts, that needs verification.

Reproducing steps:

Make a config with system@7 and "system gateway-address" option. Reboot the system to have it run.

After reboot:

vyos@vyos-test# grep commit-revisions /config/config.boot
        commit-revisions "2000"

vyos@vyos-test# grep commit-revisions /opt/vyatta/etc/config/config.boot
        commit-revisions "2000"

So far so good. Now make a change and save it:

vyos@vyos-test# set system config-management commit-revisions 3000
[edit]
vyos@vyos-test# commit
[edit]
vyos@vyos-test# save

The files are now different:

vyos@vyos-test# grep commit-revisions /opt/vyatta/etc/config/config.boot
        commit-revisions 3000
[edit]
vyos@vyos-test# grep commit-revisions /config/config.boot
        commit-revisions "2000"
[edit]

Somehow the files are different now!
Reboot fixes it, and the saved changes load as expected, but the situation is confusing.

Details

Difficulty level
Unknown (require assessment)
Version
1.2.0
Why the issue appeared?
Will be filled on close

Event Timeline

Even simpler way to reproduce:

sg vyattacfg -c "$vyatta_sbindir/vyatta_config_migrate.pl /opt/vyatta/etc/config/config.boot"

Even more interestingly, trying to run that command on a file with /config/... path after running it on the /opt/vyatta/etc/config/... one gives:

vyos@vyos-test# sg vyattacfg -c "$vyatta_sbindir/vyatta_config_migrate.pl /config/config.test2"
sed: cannot rename /config/sedAhRk5f: Stale file handle
syncer changed the task status from Open to In progress.Jun 3 2018, 8:21 AM
syncer triaged this task as Normal priority.
dmbaturin renamed this task from /config/config.boot gets out of sync with /opt/vyatta/etc/config/config.boot to Double bind mount of /config makes files in /config and /opt/vyatta/etc/config go out of sync.Aug 4 2018, 7:03 PM
dmbaturin claimed this task.
dmbaturin edited projects, added VyOS 1.2 Crux (VyOS 1.2.0-rc1); removed VyOS 1.2 Crux.

I believe I've fixed it, though feedback won't harm.