Bug 684548 - hardlinked files could cause problems with git for network configuration files
Summary: hardlinked files could cause problems with git for network configuration files
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: etckeeper
Version: el5
Hardware: i686
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Thomas Moschny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-13 11:55 UTC by Dominic Hopf
Modified: 2011-07-02 11:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-02 11:50:44 UTC
Type: ---


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.