~wgrant/ubuntu/quantal/lxc/bug-1050351

« back to all changes in this revision

Viewing changes to debian/local/lxc-start-ephemeral

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2012-08-30 10:05:06 UTC
  • Revision ID: package-import@ubuntu.com-20120830100506-ep8o8prv5cpu7yud
Tags: 0.8.0~rc1-4ubuntu32
* 0204-ubuntu-cloud-userdata-path: Fix broken behavior when a relative
  path is passed into '--userdata' argument.  (LP: #1043582)
* 0205-lxc-ls-manpage-document-two-lines: Document the default two-line
  output format of lxc-ls.  (LP: #1043018)
* lxc-start-ephemeral: support fedora and centos  (LP: #1042431)

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
    }
181
181
 
182
182
    # Update the ephemeral lxc's configuration to reflect the new container name.
183
 
    sudo sed -i -e "s/$LXC_BASE/$LXC_NAME/" $LXC_DIR/fstab $LXC_DIR/config $LXC_DIR/rootfs/etc/hostname $LXC_DIR/rootfs/etc/hosts
 
183
    # Check all the places known distros keep hostnames.
 
184
    # FIXME: should we sanity check the hostname to make sure it contains no bad chars?
 
185
    for file in $LXC_DIR/fstab $LXC_DIR/config \
 
186
                $LXC_DIR/rootfs/etc/hostname \
 
187
                $LXC_DIR/rootfs/etc/hosts \
 
188
                $LXC_DIR/rootfs/etc/sysconfig/network \
 
189
                $LXC_DIR/rootfs/etc/sysconfig/network-scripts/ifcfg-eth0
 
190
    do
 
191
        if test -f "$file"
 
192
        then
 
193
            sudo sed -i -e "s/$LXC_BASE/$LXC_NAME/" $file
 
194
        fi
 
195
    done
184
196
 
185
197
    # Update the fstab to have all bind mounts be ephemeral.
186
198
    sudo cp $LXC_DIR/fstab $LXC_DIR/fstab.old