Bug 684548

Summary: hardlinked files could cause problems with git for network configuration files
Product: [Fedora] Fedora EPEL Reporter: Dominic Hopf <dmaphy>
Component: etckeeperAssignee: Thomas Moschny <thomas.moschny>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: el5CC: thomas.moschny
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-02 11:50:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dominic Hopf 2011-03-13 11:55:29 UTC
The issue is easily described, the daily cronjob causes following mails for me on a CentOS 5.5 machine:

/etc/cron.daily/etckeeper:

etckeeper warning: hardlinked files could cause problems with git:
sysconfig/network-scripts/ifcfg-eth0
sysconfig/networking/devices/ifcfg-eth0
sysconfig/networking/profiles/default/hosts
sysconfig/networking/profiles/default/resolv.conf
sysconfig/networking/profiles/default/ifcfg-eth0
hosts
resolv.conf


It seems this issue occurs when the files in /etc/sysconfig/networking/profiles/default are listed. A virtual server I have, also with CentOS 5.5, doesn't send those mails. The files (or rather hard links) in the mentioned directory are missing there. I also do not have this issue with my Fedora installation, the behavior is the same, the hard links in /etc/sysconfig/networking/profiles/default do not exist.

Not sure how to handle this, though. Maybe it is some mis-configuration on my CentOS machine or there is some way to avoid those links? Maybe it would be a solution to exclude the files under /etc/sysconfig/networking/ from version control?

Comment 1 Thomas Moschny 2011-03-25 23:44:59 UTC
Hard linked network configuration files in /etc is quite normal for static network configs on RHEL or Fedora, but will vanish eventually when people use Network Manager only.

Discussed a little bit with upstream, but it is not clear yet how to fix that issue.

Git simply cannot handle hard links (and also breaks them when updating one of the linked files). That is not something etckeeper can easily simulate in general.

For the case of the hard linked network config files though, one could come up with a special script that runs after /etc/etckeeper/pre-commit.d/30store-metadata and records them in /etc/.etckeeper, so they can be restored later.

Patches welcome!

Comment 2 Thomas Moschny 2011-07-02 11:50:44 UTC
Closing for now, unless sb comes up with a good idea how to deal with hardlinks in in Git in general.