Ubuntu

cloud-init cloud-config-mounts can add duplicate fstab entries

Reported by Scott Moser on 2010-02-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Low
Scott Moser

Bug Description

Binary package hint: cloud-init

If you do:
  sudo rm /var/lib/cloud/config-mounts*
  sudo start cloud-config-mounts

You'll notice that /etc/fstab something like:
# cloud-config mounts
/dev/sda2 /mnt auto defaults 0 0
/dev/sda3 none swap sw 0 0
# cloud-config mounts
/dev/sda2 /mnt auto defaults 0 0
/dev/sda3 none swap sw 0 0

The second comment and entries are written even though they're already present.
It seems reasonable that to not write a new entry if an existing entry is present.

The fallout of this, is that if /etc/fstab is as shown above, a 'reboot' will never end up with 'filesystems' being emitted, and anything that depends on that will never run (quite a lot).

ProblemType: Bug
Architecture: i386
Date: Fri Feb 19 17:53:29 2010
DistroRelease: Ubuntu 10.04
Package: cloud-init 0.5.5-0ubuntu2
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: User Name 2.6.32-302.6-ec2
SourcePackage: cloud-init
Uname: Linux 2.6.32-302-ec2 i686

Scott Moser (smoser) wrote :
Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Dustin Kirkland  (kirkland) wrote :

Might be nice to pipe the file through uniq -u, write to a tmpfile, and move it back to /etc/fstab to prune dupes.

Eric Hammond (esh) wrote :

I don't think that "uniq -u" does what is needed here.This might be closer to what you're looking for:

  perl -ni -e 'print if !$seen{$_}++' /etc/fstab

but that would also remove repeated comment lines which may be desired in some cases. Best to just not add duplicates in the first place.

Scott Moser (smoser) on 2010-03-04
Changed in cloud-init (Ubuntu):
assignee: nobody → Scott Moser (smoser)
status: Confirmed → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.5.9-0ubuntu1

---------------
cloud-init (0.5.9-0ubuntu1) lucid; urgency=low

  * New upstream release.
  * rename apt list files. 'ubuntu-bug' now works without update (LP: #513060)
  * replace 'cloudconfig' entries in fstab rather than appending (LP: #524562)
  * fix to fstab writing on ebs-root instances
 -- Scott Moser <email address hidden> Mon, 08 Mar 2010 13:07:02 -0500

Changed in cloud-init (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers