files listed used with the copy option cannot be copied to non existing directory in the chroot

Bug #284620 reported by Mathias Gug
6
Affects Status Importance Assigned to Milestone
VMBuilder
Fix Released
Low
Unassigned
vm-builder (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Using the copy option with the following file:

$ cat vmbuilder.files
/home/mathiaz/.ssh/authorized_keys /home/mathiaz/.ssh/authorized_keys

vmbuilder fails to install the authorized_keys file in the target chroot directory:

2008-10-16 15:50:12,827 INFO Copying files specified by --copy in: vmbuilder.files
2008-10-16 15:50:12,843 INFO cp: cannot create regular file `/tmp/vmbuilderh2WEPm/root/home/mathiaz/.ssh/authorized_keys': No such file or directory
2008-10-16 15:50:12,844 CRITICAL Oh, dear, an exception occurred
2008-10-16 15:50:12,844 INFO Cleaning up
Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 29, in <module>
    VMBuilder.run()
  File "/usr/lib/python2.5/site-packages/VMBuilder/__init__.py", line 66, in run
    frontend.run()
  File "/usr/lib/python2.5/site-packages/VMBuilder/plugins/cli/__init__.py", line 61, in run
    vm.create()
  File "/usr/lib/python2.5/site-packages/VMBuilder/vm.py", line 445, in create
    raise e
VMBuilder.exception.VMBuilderException: Process (['cp', '-LpR', '/home/mathiaz/.ssh/authorized_keys', '/tmp/vmbuilderh2WEPm/root/home/mathiaz/.ssh/authorized_keys']) returned 1. stdout: , stderr: cp: cannot create regular file `/tmp/vmbuilderh2WEPm/root/home/mathiaz/.ssh/authorized_keys': No such file or directory

This is caused by the fact that the .ssh directory doesn't exist by default. Using the execscript option to create it doesn't work as it seems that copy is run before execscript.

One solution could be to automatically create parent directories. Being able to pecify permissions and ownership may also be useful (although it could be done from the execscript).

Related branches

Revision history for this message
Nick Barcet (nijaba) wrote :

If the purpose is to copy you authorized key, the --ssh* options are tailored for this.

Marking this as wishlist for being able to create parent dirs (mkdir -p equivalent).

Changed in vmbuilder:
status: New → Confirmed
Changed in vm-builder:
importance: Undecided → Wishlist
status: New → Confirmed
Soren Hansen (soren)
Changed in vmbuilder:
importance: Undecided → Low
Soren Hansen (soren)
Changed in vmbuilder:
status: Confirmed → Fix Committed
Soren Hansen (soren)
Changed in vm-builder (Ubuntu):
status: Confirmed → Fix Committed
Soren Hansen (soren)
Changed in vmbuilder:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vm-builder - 0.12.1-0ubuntu1

---------------
vm-builder (0.12.1-0ubuntu1) lucid; urgency=low

  * New upstream, bugfix-only release. (LP: #303882, #523589, #261702,
    #284620, #527240, #527253)
 -- Soren Hansen <email address hidden> Wed, 24 Feb 2010 23:52:03 +0100

Changed in vm-builder (Ubuntu):
status: Fix Committed → 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.