Commit Graph

479 Commits

Author SHA1 Message Date
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
Johannes Kastl
8f3a3cd805 lxc-opensuse: default release changed to 13.1, as 12.3 reaches end-of-life soon
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-19 13:43:21 -05:00
Veres Lajos
ec64264d78 typofixes - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-04 18:40:26 -05:00
Cameron Norman
4de03d375b lxc-debian: mask both Wheezy and Jessie udev services
Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:59:21 -05:00
Cameron Norman
2b75b644f8 lxc-debian: adjust init system configurations
Do as much as possible to allow containers switching from non-systemd to
systemd to work as intended (but nothing that will cause side effects).
Use update-rc.d disable instead of remove so the init scripts are not
re-enabled when the package is updated

Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:59:16 -05:00
Johannes Kastl
de548c6055 lxc-opensuse: Disabling builds on openSUSE Tumbleweed, detection improved.
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:47:10 -05:00
Johannes Kastl
f38788b405 lxc-opensuse: Disable on 13.2
Disabled building openSUSE containers on openSUSE 13.2 and  openSUSE
Tumbleweed due to faulty behaviour with newer versions of
init_buildsystem.

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-27 17:52:22 -05:00
Natanael Copa
646b1ef753 lxc-alpine: create a default tty for console
Create a tty so we get login prompt on console by default

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-27 17:50:31 -05:00
Natanael Copa
b55a662242 lxc-alpine: make sure /dev/shm is world writeable
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-27 17:50:28 -05:00
Johannes Kastl
3e892287ba lxc-opensuse: Check if given argument is a valid release
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-25 14:32:14 -05:00
Johannes Kastl
0ce7569856 lxc-opensuse: Added explanation on how to use the template
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-25 14:31:59 -05:00
Johannes Kastl
2e7a16a5a5 lxc-opensuse: template now understands release arguments
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-25 14:31:48 -05:00
謝致邦
6bfb727c4b Fix lxc-centos.in typo.
Signed-off-by: 謝致邦 <Yeking@Red54.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:41:38 -05:00
謝致邦
cd2738c457 Fix lxc-openmandriva.in typo.
Signed-off-by: 謝致邦 <Yeking@Red54.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:40:23 -05:00
Serge Hallyn
6b41056280 lxc-cirros: support creating+running unprivileged
Support creation and use of lxc-cirros by unprivileged users.

If we detect we are an unprivileged user, then insist that we
be in a userns with a id mapping.

If we are in a userns, then don't extract /dev when extracting
the rootfs.

If we are not root, then save the tarball to ~/.cache/lxc/cirros
instead of /var/cache/lxc/cirros.

If we are not roo, then include entries to auto-mount proc and sys,
as well as bind-mount devices.

Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-24 16:32:00 -05:00
TAMUKI Shoichi
6df4f94574 lxc-plamo: mount tmpfs on /dev/shm
Do mkdir $rootfs/dev/shm and then mount tmpfs on /dev/shm.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-24 16:07:08 -05:00
Antonio Terceiro
a9bf60bab5 lxc-debian: support systemd as PID 1
Containers with systemd need a somewhat special setup, which I borrowed
and adapted from lxc-fedora. These changes are required so that Debian 8
(jessie) containers work properly, and are a no-op for previous Debian
versions.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-11-24 16:06:52 -05:00
Gu1
5d20559cff lxc-debian: Fix default mirrors
Fix a typo in the lines inserted in the default sources.list.
Change the default mirror to http.debian.net which is (supposedly) more
accurate and better than cdn.debian.net for a generic configuration.
Use security.debian.org directly for the {release}/updates repository.

Signed-off-by: Gu1 <gu1@aeroxteam.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-11-06 13:41:02 -05:00
Simon Deziel
df7216f664 Create the apt proxy in the cache instead of the 1st container
This addresses https://github.com/lxc/lxc/issues/280.

Signed-off-by: Simon Deziel <simon@sdeziel.info>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-10-27 17:39:24 -04:00
Dark Templar
3d8b68b1d5 Fix another gentoo template typo
I've found one more typo in the gentoo template, configuration in the
generated file /etc/conf.d/hostname was not valid, but it didn't impact
me due to "lxc.utsname" being set in the configuration file of container
and hostname service being not used. Anyway, I've made a patch and
sending it with this mail.

Signed-off-by: Dark Templar <dark_templar@hotbox.ru>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-10-22 09:35:08 -05:00
Bogdan Purcareata
12c3b43fbe busybox template: mount fstab when available
When running unprivileged, lxc-create will touch a fstab file, with bind-mounts
for the ttys and other devices. Add this entry in the container config.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-10-22 09:18:14 -05:00
Bogdan Purcareata
a542dd3c1a busybox template: support for unprivileged containers
Apply the changes found in templates/lxc-download to the busybox template as
well. Change ownership of the config and fstab files to the unprivileged user,
and the ownership of the rootfs to root in the new user namespace.

Eliminate the "unsupported for userns" flag.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-10-22 09:18:05 -05:00
Dark Templar
4167102e93 Fix typo in lxc-gentoo template
Signed-off-by: Dark Templar <dark_templar@hotbox.ru>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-10-20 16:38:32 -05:00
Dwight Engen
fce070c815 fixups to init script rework
- move action() from common to sysvinit wrapper since its only really
  applicable for sysvinit and not the other init systems

- fix bug in action() fallback, need to shift away msg before executing action

- make lxc-net 98 so it starts before lxc-container (99), otherwise the lxcbr0
  won't be available when containers are autostarted

- make the default RUNTIME_PATH be /var/run instead of /run. On older
  distros (like ol6.5) /run doesn't exist. lxc-net will create this directory
  and attempt to create the dnsmasq.pid file in it, but this will fail when
  SELinux is enabled because the directory will have the default_t type.
  Newer systems have /var/run symlinked to /run so you get to the same place
  in that case.

- add %postun to remove lxc-dnsmasq user when pkgs are removed

- fix bug in lxc-oracle template that was creating /var/lock/subsys/lxc as
  a dir and interfering with the init scripts

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-29 12:17:11 -04:00