Commit Graph

502 Commits

Author SHA1 Message Date
有张纸
0f541e3313 Update lxc-debian.in
fix "bash: warning: setlocale: LC_ALL: cannot change locale"

Signed-off-by: <feng xiahou xiahoufeng@yahoo.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-05-26 10:59:16 -04:00
Cyril Bitterich
19fcf68ffb lxc-debian.in: Fixed errors if dbus is not installed
The lxc-debian template debootstraps a minimum debian system which does not contain dbus.
If systemd is used this will result in getty-static.service to be used instead of getty@ .
The systemd default files uses 6 tty's instead of the 4 the script creates.
This will lead to repeated error messages in the systemd journal.

Signed-off-by: Cyril Bitterich <Cyril.Bitterich@1und1.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-05-12 10:05:47 -04:00
Natanael Copa
83828d6770 lxc-alpine: create /dev/shm before mounting
This is needed for lxc.autodev=1 to work.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-04-24 11:04:32 -04:00
Bogdan Purcareata
ed52814c77 lxc-busybox: add OpenSSH support
Add an additional template parameter for SSH support in the container. Currently
this can be implemented using the Dropbear or OpenSSH utility. The respective
tool needs to be available on the host Linux.

If the parameter is omitted, the template will look for the Dropbear utility on
the host and install it if it is available (legacy behavior).

Adding OpenSSH support has been done following the model in the lxc-sshd
template.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-04-22 12:34:19 -04:00
Laurent Vivier
e97aa8176f lxc-fedora: manage secondary architectures
URL for packages and LiveOS differs from x86, x86_64 and ARM.

This patch allows to select the good mirror URL according to
the architecture.

Primary architecture: http://mirrors.kernel.org/fedora
Secondary architecture: http://mirrors.kernel.org/fedora-secondary

The managed secondary architectures are only ppc64 and s390x,
the secondary architectures for Fedora 20 (the base of initial bootstrap).

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-04-13 16:57:44 -05:00
teruo-oshida
3335c60896 update path of tty.conf
$container_rootfs may not be used so 'sed' will try to patch
"/etc/init/tty.conf". It must not be correct.

Signed-off-by: Teruo Oshida <teruo.oshida@miraclelinux.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-04-07 12:10:53 -04:00
Alexandre Létourneau
85ccd3d569 Now including grep -q
Signed-off-by: Alexandre Letourneau <letourneau.alexandre@gmail.com>
2015-04-01 18:22:54 -04:00
Alexandre Létourneau
87a92d42ce Added a more reliable test for yum --releasever in the centos template
Signed-off-by: Alexandre Létourneau <letourneau.alexandre@gmail.com>
2015-03-30 18:25:42 -04:00
Erik Mackdanz
7785e39c96 Fix the --auth-key flag in gentoo template
Fix a typo in the getopt call,  should be auth-key not auth_key.
Also provide the argument to cat, so the script doesn't hang waiting
on stdin.

Closes #379

Signed-off-by: Erik Mackdanz <erikmack@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-03-13 19:20:24 -04:00
Stéphane Graber
214b8bfce4 Merge pull request #456 from itoffshore/master
fix lxc-console on centos / oracle unprivileged containers
2015-03-10 12:24:45 -04:00
Stuart Cardall
6e53ca56a4 fix lxc-console on centos / oracle unprivileged containers
Signed-off-by: Stuart Cardall <developer@it-offshore.co.uk>
2015-03-10 10:55:42 +00:00
lxc@zitta.fr
35e68b0447 gentoo container building fails during wget.
follow new gentoo's download server configuration.
Should be backported in earlier lxc versions.

Signed-off-by: Guillaume ZITTA <lxc@zitta.fr>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-03-09 21:26:11 -04:00
Bogdan Purcareata
22fb28a946 lxc-busybox: use lxc.rebootsignal = SIGTERM
Otherwise lxc-stop -r has no effect on the container.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-02-18 09:42:40 -08:00
tukiyo
6d41f7dfa6 no such option: --releasever on CentOS5's yum
Signed-off-by: tukiyo3 <tukiyo3@gmail.com>
2015-02-17 10:05:25 +09:00
KATOH Yasufumi
a61848fe21 plamo: Change how to create objects under /dev in the container
lxc-plamo stop:
* creating objects under /dev when creating the container
* removing /dev population process from original rc script

now populate /dev at container boot time, and allow to enable
lxc.autodev=1

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-02-08 18:08:25 +02:00
Stéphane Graber
ae0aeadeaa ubuntu: Drop lucid support and refresh releaess list
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-30 00:08:05 +01:00
Stéphane Graber
c60edd1865 oracle: Fix /dev/shm
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-30 00:08:02 +01:00
Stéphane Graber
a79df22733 centos: Fix booting a Centos 6 container
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-30 00:07:30 +01:00
Stéphane Graber
f24a52d5f5 Use consistent /proc, /sys and /sys/fs/cgroup (v2)
- Implements mixed mode for /sys where it's mounted read-only but with
   /sys/devices/virtual/net/ writable.

 - Sets lxc.mount.auto to "cgroup:mixed proc:mixed sys:mixed" for all
   templates.

 - Drop any template-specific mount for /proc, /sys or /sys/fs/cgroup.

 - Get rid of the fstab file by default, using lxc.mount.entry instead.

 - Set sys:mixed as the default for "sys". sys:mixed is slightly more
   permissive than sys:ro so this shouldn't be a problem.

The read-only bind mount of /sys on top of itself is there so that
mountall and other init systems don't attempt to remount /sys
read-write.

v2 changes:
 - Fix the mount list, don't specify a source for the remount.
 - Update the documentation.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-29 11:44:02 +01:00
Stéphane Graber
9f177a0013 lxc-{centos|fedora}: Respect --rootfs
Close #406

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-28 12:47:15 +01:00
Serge Hallyn
cfe615f031 fix busybox unpriv
1. tty5 is not needed
2. the devices should be optional in case they didn't exist in the
host / parent-container
3. switch from 'touch $rootfs/dev/$dev' to using create=file in the
mount entry.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-27 10:30:29 +01:00
Tomas Pospisek
9cbffb9f57 improve "lxc-create -t debian -h" help text
- document environment variables
- add missing --packages switch to command line
- describe how to pass template options to lxc-create (since
  lxc-create -h doesn't tell you)
- render help text in the same pretty format as lxc-create does

Signed-off-by: Tomáš Posíšek <tpo_deb@sourcepole.ch>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-25 12:10:36 -05:00
Vicente Olivert Riera
b8ebaa9c78 Gentoo template - Add a hwaddr if there is only one veth
Reuse the code from the Debian template to associate a hwaddr if there
is only one veth interface in the container's config file.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-24 16:47:24 -05:00
Michael Adam
c2af30847a add "--mask-tmp" to lxc-fedora, plus some template script fixes]
Hi Michael,

do you have any concerns with the attached patch to
the fedora template that adds an option --mask-tmp
that prevents fedora/systemd from over-mounting
/tmp with tmpfs, which is useful in some cases?

Thanks - Michael

----- Forwarded message from Michael Adam <obnox@samba.org> -----

Date: Sat, 10 Jan 2015 13:12:06 +0100
From: Michael Adam <obnox@samba.org>
To: LXC development mailing-list <lxc-devel@lists.linuxcontainers.org>
Subject: Re: [lxc-devel] [PATCHES] add "--mask-tmp" to lxc-fedora, plus some
	template script fixes
User-Agent: Mutt/1.5.23 (2014-03-12)

On 2015-01-10 at 13:08 +0100, Michael Adam wrote:
> On 2015-01-10 at 04:05 +0000, Serge Hallyn wrote:
>
> > The less controversial one is adding mask-tmp to the fedora template.
> > It looks fine to me, but that should go separately to mwarfield, our
> > fedora template maintainer :)
>
> I had notified mhw of my patches on irc, but apparently he is
> currently very busy.
>
> For a start, following is an update of the uncontroversial fix
> patches, i.e. the fix patche without the path ones, and without
> the mask-tmp patch.

And here comes the mask-tmp patch.
It needs to be applied onto the previous fix-patchset.

From 9589dca113535ed2f4faad89db2fab33bb8a9d7e Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox@samba.org>
Date: Thu, 8 Jan 2015 10:25:24 +0100
Subject: [PATCH] lxc-fedora: add a new option --mask-tmp

This will configure the container to prevent the standard
behaviour of over-mounting /tmp with tmpfs, which can be
undesirable in some cases.

My personal use case is vagrant-lxc in combination with
vagrant-cachier.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-21 12:48:59 -06:00
Stéphane Graber
d89de2399c Set kmsg to 0 by default
It's now been proven over and over again that the symlink from /dev/kmsg
to /dev/console is harmful for everything but upstart systems. As Ubuntu
is now switching over to systemd too, lets switch the default.

Upstart users wishing to see boot messages can always set lxc.kmsg = 1
manually in their config (so long as they don't expect to then
dist-upgrade the container to systemd succesfuly).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-20 19:47:17 -05:00
Stéphane Graber
124fa0a869 Turn autodev on by default
Now that autodev works fine with unprivileged containers and shouldn't
come with any side effect, lets turn it on by default.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-20 19:47:14 -05:00
Alexander Vladimirov
97e1e9bbb2 lxc-centos: pass releasever parameter to yum
Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-16 18:09:28 -05:00
Michael Adam
7d540a2663 lxc-download: improve help text.
--help and --list are special in the sense that they
are independent of the other options and exit early.
Document them separately.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-15 19:09:14 -05:00
Michael Adam
308f4f391a lxc-download: make --list more useful.
Make it possible to use --list without having to specify
--dist, --release, and --arch, which does not make a lot
of sense.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-15 19:08:47 -05:00
Michael Adam
e145b7bb6d lxc-download: fix typo in help text.
Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-15 19:08:20 -05:00
Michael Adam
fccc348be4 lxc-fedora: let help text fit into 80 columns
by breaking and shortening some lines.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
9aed78fad1 lxc-fedora: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
98d316e29a lxc-fedora: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
a2780518da lxc-centos: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
2ae8252a4f lxc-centos: fix tab/space mixup in help text.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
6976826fed lxc-centos: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
c4834f3c12 lxc-openmandriva: protect possibly unset variable with quotes in -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
fe9d4df40a lxc-openmandriva: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
4986f1c435 lxc-altlinux: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
217535de29 lxc-altlinux: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
b5a285ea8f lxc-opensuse: protect possibly unset variable with quotes in -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
eb4cd29636 lxc-opensuse: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
1111674232 lxc-opensuse: fix tab/whitespace mixup in usage text.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
227c560065 lxc-debian: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
a64da4c358 lxc-debian: document "--clean" in the usage.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
e4d4da6211 lxc-debian: fix parsing of option "--clean": it takes no argument.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Natanael Copa
abf117c398 lxc-alpine: use yaml for detection of latest release
Alpine Linux provides yaml files with latest release instead of the old
approach with .latest.txt.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-05 16:27:39 -05:00
Michael Adam
afc55ed279 lxc-fedora: In fedora21, the fedora-repos package is needed.
fedora-release has been split into fedora-release and fedora-repos.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-05 16:25:42 -05:00
Michael Adam
5b75ee4747 lxc-fedora: when using systemd, set lxc.kmsg = 0 in the config
This is to prevent systemd-journald to enter a 100% cpu loop.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-05 16:25:37 -05:00
Johannes Kastl
d3eccbbf80 lxc-opensuse: Disable building openSUSE containers on 13.2/Tumbleweed only if wrong version of build package is installed
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-19 13:45:07 -05:00