etckeeper (with git) deletes empty directories on apt-get upgrade

Bug #305642 reported by Henning Sprang
4
Affects Status Importance Assigned to Milestone
etckeeper (Debian)
Fix Released
Unknown
etckeeper (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: etckeeper

1)
lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04

2)
apt-cache policy etckeeper
etckeeper:
  Installed: 0.14ubuntu2
  Candidate: 0.14ubuntu2
  Version table:
 *** 0.14ubuntu2 0
        500 file: hardy/universe Packages
        100 /var/lib/dpkg/status

3)
I did a security upgrade of the package mysql-server-5.0, and would expect it to work fine after the upgrade.
To reproduce:
* install a plain ubuntu system 8.04
* disable security and hardy updates (or disconnect from network) in sources.list
* apt-get install etckeeper
* etckeeper init
* apt-get install mysql-server
* check mysql - it's running
* check dir /etc/mysql/conf.d - it's there and a file inside
* add security update repository / network connection
* apt-get update
* apt-get upgrade
* check dir /etc/mysql/conf.d - it's missing, mysql not running

If I leave etckeeper out, the directory is there, empty, and mysql is working.

4)
Instead of just kepp running, mysql refuses to restart, seemingly because the directory /etc/mysql/conf.d is not there anymore.
As described in bug 305107 ( which keeps valid for mysql because it should not refuse to start because a missing empty and optional directory.)

Tags: git
Revision history for this message
Daniel Hahler (blueyed) wrote :

What VCS are you using (setting VCS in /etc/etckeeper/etckeeper.conf)?

Changed in etckeeper:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Henning Sprang (henning) wrote : Re: [Bug 305642] Re: etckeeper deletes empty directories on apt-get upgrade

On Sat, Dec 6, 2008 at 2:26 PM, Daniel Hahler <email address hidden> wrote:
> What VCS are you using (setting VCS in /etc/etckeeper/etckeeper.conf)?

nothing changed, the default - git, I guess.

Revision history for this message
Daniel Hahler (blueyed) wrote : Re: etckeeper deletes empty directories on apt-get upgrade

Please check this, since it is probably an issue with the implementation for this particular VCS, which removes empty directories.
I think the bug should get forwarded to upstream (Debian), since they/he probably know where to fix it it from the top of their/his head(s).

Changed in etckeeper:
status: Incomplete → Triaged
Revision history for this message
Henning Sprang (henning) wrote : Re: [Bug 305642] Re: etckeeper deletes empty directories on apt-get upgrade

Sorry, but I can't due to time restrictions.
But I can give some more explanations:

With "nothing changed", I mean:
I am absolutely sure that I did not change any default.
I exactly entered the commands I wrote here and nothing else, starting
with a completely plain Ubuntu Desktop install from Live CD with no
actions taken after the install apart from the ones reported here.
Especially, I never ever in my whole life touched any etckeeper config
file on any system I ever used.

With "git, I guess", I mean:
Given the previous explanation, if etckeeper installs with git as
default, it is git. If something else is etckeeper's default, it is
this. But I assume and am 99,9% sure it is git.

This problem already took about a day for me to find everything I
reported until now, much more than I thought when originally reporting
this bug and other things start to press me - I might find some time
to check back next week or the week after.

Please remind me if you still think it's necessary.

Revision history for this message
Daniel Hahler (blueyed) wrote : Re: etckeeper deletes empty directories on apt-get upgrade

I did not meant that you should forward the issue, but only stated that it should be done.

As documented, git cannot track empty directories and therefore this extra metadata should get stored in /etc/.etckeeper.
Please provide the output of
  sudo grep -E 'mkdir|mysql' /etc/.etckeeper
There it should be stored that /etc/mysql.d needs to get created.

You could also track the history of this meta file, e.g. by using "sudo git log /etc/.etckeeper" and find out, why /etc/mysql.d has been removed from it (or if it has ever been added).
There should be graphical browsers for Git, but I don't know any from the top of my head.

Revision history for this message
Thierry Carrez (ttx) wrote :

Fixed in 0.26

Thierry Carrez (ttx)
Changed in etckeeper:
assignee: nobody → tcarrez
status: Triaged → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote :

This bug was fixed in the package etckeeper - 0.28ubuntu1

---------------
etckeeper (0.28ubuntu1) jaunty; urgency=low

  * Merge from debian unstable. Remaining changes:
    * etckeeper.conf: Default to bzr
  * debian/control: Default to bzr as well (LP: #321809)

etckeeper (0.28) unstable; urgency=low

  * Support darcs. Thanks to Gian Piero Carrubba. Closes: #510032

etckeeper (0.27) unstable; urgency=low

  * Use SUDO_USER as the committer if set. Closes: #498739
    (Thierry Carrez)
  * bzr: Avoid use of etckeeper pre-commit on Trees not on the
    filesystem. (Jelmer Vernooij)

etckeeper (0.26) unstable; urgency=low

  * Add Japanese debconf translation. Closes: #512869
  * Prevent git from removing a directory when the last file in it
    has been removed, but the directory is left existing and empty,
    by touching a flag file before calling git rm. Closes: 513006

 -- Thierry Carrez <email address hidden> Fri, 13 Feb 2009 13:58:42 +0000

Changed in etckeeper:
assignee: tcarrez → nobody
status: In Progress → Fix Released
Changed in etckeeper (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.