lxc-lucid.in revision 3930b7453e9b6d3cc77bf8433f04c446da949060
fd5c4f905861964cb473cf3df3336447a9365962Stéphane Graber# template script for generating ubuntu/lucid container for LXC
16216c83297543692b8dede52c9dd8a998758e9cStéphane Graber# This script is based on lxc-debian (Daniel Lezcano <daniel.lezcano@free.fr>)
16216c83297543692b8dede52c9dd8a998758e9cStéphane Graber# Copyright � 2010 Wilhelm Meier
16216c83297543692b8dede52c9dd8a998758e9cStéphane Graber# Author: Wilhelm Meier <wilhelm.meier@fh-kl.de>
16216c83297543692b8dede52c9dd8a998758e9cStéphane Graber# This program is free software; you can redistribute it and/or modify
16216c83297543692b8dede52c9dd8a998758e9cStéphane Graber# it under the terms of the GNU General Public License version 2, as
afeecbba0359d2b4404cdf896e6b6d0b5a8443b0Serge Hallyn# published by the Free Software Foundation.
9be53773792fc9e8bd173edc3b7ac7e144875387Serge Hallyn# This program is distributed in the hope that it will be useful,
0115f8fd27b1a31d367bb161a121694f92b45e62Dwight Engen# but WITHOUT ANY WARRANTY; without even the implied warranty of
20ab58c777136a449b3199e0733b62fa87ecfa61Serge Hallyn# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20ab58c777136a449b3199e0733b62fa87ecfa61Serge Hallyn# GNU General Public License for more details.
f209d63a97a8a2df5324608fee7b0d7a494d69ebS.Çağlar Onur# You should have received a copy of the GNU General Public License along
b494d2ddf769220da1ef75fd24275ce68cdf297cSerge Hallyn# with this program; if not, write to the Free Software Foundation, Inc.,
2aa123185e055bbe2506a6210e795e0b9375e477Serge Hallyn# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
72863294f63e27ac263a774aab37aace20dc1bc5Dwight Engeniface lo inet loopback
72863294f63e27ac263a774aab37aace20dc1bc5Dwight Engeniface eth0 inet dhcp
525421c923d798cdea9e5691bcee1e5e5530491dStéphane Graber127.0.0.1 localhost $hostname
525421c923d798cdea9e5691bcee1e5e5530491dStéphane Graber# fake some events needed for correct startup other services
90341b9e39561e37797777a34d0589c14c0c2a68Dwight Engendescription "Container Upstart"
90341b9e39561e37797777a34d0589c14c0c2a68Dwight Engenstart on startup
90341b9e39561e37797777a34d0589c14c0c2a68Dwight Engen rm -rf /var/run/*.pid
90341b9e39561e37797777a34d0589c14c0c2a68Dwight Engen rm -rf /var/run/network/*
90341b9e39561e37797777a34d0589c14c0c2a68Dwight Engen /sbin/initctl emit stopped JOB=udevtrigger --no-wait
90341b9e39561e37797777a34d0589c14c0c2a68Dwight Engen /sbin/initctl emit started JOB=udev --no-wait
f5dd1d532a76a1b57cf341db821eae85ea1118c5Serge Hallyn# ssh - OpenBSD Secure Shell server
b494d2ddf769220da1ef75fd24275ce68cdf297cSerge Hallyn# The OpenSSH server provides secure shell access to the system.
a41f104bfbd69e5f068e5ca312a2eb513d9e81b8Serge Hallyndescription "OpenSSH server"
packages=dialog,apt,apt-utils,resolvconf,iproute,inetutils-ping,vim,dhcp3-client,ssh,lsb-release,gnupg
cache=$1
arch=$2
if [ $? -ne 0 ]; then
debootstrap --verbose --variant=minbase --components=main,universe --arch=$arch --include=$packages lucid $cache/partial-$arch
if [ $? -ne 0 ]; then
cache=$1
arch=$2
rootfs=$3
rootfs=$1
flock -n -x 200
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
path=$1
rootfs=$2
name=$3
if [ $? -ne 0 ]; then
if [ ! -e $cache ]; then
flock -n -x 200
cat <<EOF
eval set -- "$options"
type debootstrap
if [ -z "$path" ]; then
if [ ! -z $clean ]; then