Page MenuHomePhabricator

Nested ".d" dirs in /etc/apt/
Closed, ResolvedPublic

Description

On 2015-06-25 & 26 I created Precise and Trusty instances. They contains the directories:

/etc/apt/apt.conf.d/apt.conf.d/
/etc/apt/preferences.d/preferences.d/
/etc/apt/sources.list.d/sources.list.d/

When I run 'apt-get update' it exits 0 but says:

N: Ignoring 'apt.conf.d' in directory '/etc/apt/apt.conf.d/' as it is not a regular file
N: Ignoring 'sources.list.d' in directory '/etc/apt/sources.list.d/' as it is not a regular file

When I run 'apt-get upgrade' it exits 0 but says:

N: Ignoring 'apt.conf.d' in directory '/etc/apt/apt.conf.d/' as it is not a regular file
N: Ignoring 'sources.list.d' in directory '/etc/apt/sources.list.d/' as it is not a regular file
N: Ignoring 'sources.list.d' in directory '/etc/apt/sources.list.d/' as it is not a regular file
N: Ignoring 'preferences.d' in directory '/etc/apt/preferences.d/' as it is not a regular file
N: Ignoring 'sources.list.d' in directory '/etc/apt/sources.list.d/' as it is not a regular file

The contents of these directories differs from that of their parents:

/etc/apt/apt.conf.d/01autoremove
/etc/apt/apt.conf.d/01autoremove-kernels
/etc/apt/apt.conf.d/20auto-upgrades
/etc/apt/apt.conf.d/20changelog
/etc/apt/apt.conf.d/50unattended-upgrades
/etc/apt/apt.conf.d/70debconf
/etc/apt/apt.conf.d/80old-releases-proxy
/etc/apt/apt.conf.d/80security-ubuntu-proxy
/etc/apt/apt.conf.d/80ubuntu-cloud-archive-proxy
/etc/apt/apt.conf.d/90cloud-init-pipelining
/etc/apt/apt.conf.d/90no-recommends
/etc/apt/apt.conf.d/apt.conf.d/01autoremove
/etc/apt/apt.conf.d/apt.conf.d/01autoremove-kernels
/etc/apt/apt.conf.d/apt.conf.d/10periodic
/etc/apt/apt.conf.d/apt.conf.d/15update-stamp
/etc/apt/apt.conf.d/apt.conf.d/20archive
/etc/apt/apt.conf.d/apt.conf.d/20auto-upgrades
/etc/apt/apt.conf.d/apt.conf.d/20changelog
/etc/apt/apt.conf.d/apt.conf.d/50unattended-upgrades
/etc/apt/apt.conf.d/apt.conf.d/70debconf
/etc/apt/apt.conf.d/apt.conf.d/80old-releases-proxy
/etc/apt/apt.conf.d/apt.conf.d/80security-ubuntu-proxy
/etc/apt/apt.conf.d/apt.conf.d/80ubuntu-cloud-archive-proxy
/etc/apt/apt.conf.d/apt.conf.d/80workaround-squid-issues
/etc/apt/apt.conf.d/apt.conf.d/90cloud-init-pipelining
/etc/apt/apt.conf.d/apt.conf.d/90no-recommends
/etc/apt/apt.conf.d/apt.conf.d/98labs-timeout
/etc/apt/apt.conf.d/apt.conf.d/99update-notifier

/etc/apt/preferences.d/wikimedia.pref
/etc/apt/preferences.d/preferences.d/puppet_base_2.7
/etc/apt/preferences.d/preferences.d/wikimedia.pref

Event Timeline

Gage raised the priority of this task from to Needs Triage.
Gage updated the task description. (Show Details)
Gage added a project: Cloud-Services.
Gage added subscribers: Gage, Andrew.
Gage set Security to None.

Change 221268 had a related patch set uploaded (by Andrew Bogott):
Avoid nesting some dirs into themselves due to cp -r behavior

https://gerrit.wikimedia.org/r/221268

Change 221268 merged by Andrew Bogott:
Avoid nesting some dirs into themselves due to cp -r behavior

https://gerrit.wikimedia.org/r/221268

I'm surprised to report that this is still happening on instances created after the patch was merged. I tried twice.

The patch only changed the script that builds the base images. So someone will need to build new images and deploy them; then you will see that it has been resolved (probably).

Andrew changed the task status from Open to Stalled.Jun 27 2015, 12:24 AM

Building new base images is tedious, and there's a fairly expensive (permanent) overhead for each image that we install; so I won't be rebuilding just for this :)

Because new images were not built, I tried to work around this myself like so:

sudo mv /etc/apt/apt.conf.d/apt.conf.d/* /etc/apt/apt.conf.d/
sudo mv /etc/apt/preferences.d/preferences.d/* /etc/apt/preferences.d/
sudo mv /etc/apt/sources.list.d/sources.list.d/* /etc/apt/sources.list.d/
sudo rmdir /etc/apt/apt.conf.d/apt.conf.d/
sudo rmdir /etc/apt/preferences.d/preferences.d/
sudo rmdir /etc/apt/sources.list.d/sources.list.d/

However that results in this error:

N: Ignoring file 'puppet_base_2.7' in directory '/etc/apt/preferences.d/' as it has an invalid filename extension

So I gave it the proper extension:

sudo mv /etc/apt/preferences.d/puppet_base_2.7{,.pref}

However that installs puppet 2.7.11-1ubuntu2 instead of 3.4.3-1~ubuntu12.04.1. Puppet 2.7's version of the 'exec' type doesn't support the 'umask' attribute, resulting in this cryptic error when I apply role::puppet::self:

err: Failed to apply catalog: Invalid parameter umask at /etc/puppet/modules/git/manifests/clone.pp:147

Solution:

sudo rm /etc/apt/preferences.d/puppet_base_2.7.pref
chasemp subscribed.
bd808 assigned this task to Andrew.
bd808 subscribed.

Many new base images have been built in the last 3.5 years. ;)