Commit Graph

450 Commits

Author SHA1 Message Date
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
Stéphane Graber
3cd988ccdb download: Make --keyserver actually work
Reported-by: NeilGreenwood <neil.greenwood@gmail.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-23 10:25:47 -04:00
TAMUKI Shoichi
dc5518b82e lxc-gentoo: keep original uid/gid of files/dirs when installing
Call tar with --numeric-owner option to use numbers for user/group
names because the whole uid/gid in rootfs should be consistently
unchanged as in original stage3 tarball and private portage.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-19 17:02:36 -04:00
TAMUKI Shoichi
d0348408b5 lxc-plamo: keep original uid/gid of files/dirs when installing
Regardless of whether "installpkg" command exists or not, install the
command temporarily with static linked tar command into the lxc cache
directory to keep the original uid/gid of files/directories.  Also,
use sed command instead of ed command for simplicity.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-19 16:58:00 -04:00
Bill Kolokithas
8fefbee406 lxc-archlinux: Properly set default locale in /etc/locale.conf
Signed-off-by: Bill Kolokithas <kolokithas.b@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-25 16:15:32 -04:00
Denis Pynkin
05e61b82cf Additional checks in ALTLinux template
Added check of services in container before start or stop.
Added check of syslog config existence prior changing.

Signed-off-by: Denis Pynkin <dans@altlinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-25 16:14:13 -04:00
TAMUKI Shoichi
ea00a202cd Update plamo template
- If "installpkg" command does not exist, lxc-plamo temporarily
  install the command with static linked tar command into the lxc
  cache directory.  The tar command does not refer to passwd/group
  files, which means that only a few files/directories are extracted
  with wrong user/group ownership.  To avoid this, the installpkg
  command now uses the standard tar command in the system.
- Change mode to 666 for $rootfs/dev/null to allow write access for
  all users.
- Small fix in usage message.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2014-08-19 07:49:01 -04:00
Denis Pynkin
a9ae28a05a Updated template for ALTLinux.
- Added predefined package list if /etc/lxc/profiles/default is absent.
- Fixed syntax mistake in options list.

Signed-off-by: Denis Pynkin <dans@altlinux.ru>
Acked-by: Stéphne Graber <stgraber@ubuntu.com>
2014-08-15 21:09:34 -04:00
Stéphane Graber
206a255e17
ubuntu: Check that btrfs is actually available
Before calling btrfs and playing with subvolumes, let's make sure the
btrfs command is available.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-15 19:59:45 -04:00
rabisg
b69e7bf14e Use portageq to determine portage distdir
Signed-off-by: Rabi Shanker Guha <guha.rabishankar@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-08 12:17:02 -04:00
Kalman Olah
91c5c53f59 Include hostname in DHCP requests
With the current old CentOS template, dnsmasq was not able to resolve
the hostname of an lxc container after it had been created. This minor
change rectifies that.

Signed-off-by: Kalman Olah <hello@kalmanolah.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-08 12:15:07 -04:00
Nikolay Martynov
b78b2e23a1 ssh: send hostname to dhcp server
Send container's hostname to dhcp server when getting ip address.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-08 12:14:19 -04:00
Michael Werner
4849ab991b templates: switch from arch command to uname -m
Signed-off-by: Michael Werner <xaseron@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-08 12:12:21 -04:00
Serge Hallyn
68c36a303f ubuntu templates: don't check for $rootfs/run/shm
/dev/shm must be turned from a directory into a symlink to /run/shm.
The templates do this only if they find -d $rootfs/run/shm.  Since /run
will be a tmpfs, checking for it in the rootfs is silly.  It also is
currently broken as ubuntu cloud images have an empty /run.

(this should fix https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1353734)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-08-08 11:40:03 -04:00
Stéphane Graber
acabe1faee download: Have wget retry 3 times
This forces wget to retry if it gets a network error.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-07-31 13:47:01 -04:00
Trần Ngọc Quân
04cda6d1d3 add help string for ubuntu templete
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-07-29 08:34:23 -05:00
Serge Hallyn
cd6b3e37a6 remove mountcgroup hook entirely
Also fix the comment in lxc-cirros template (which I overlooked last time).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-17 17:33:45 -05:00
Claudio Alarcon-Reyes
7edae51efc centos template: prevent mingetty from calling vhangup(2)
When using unprivileged containers, tty fails because of vhangup. Adding
--nohangup to nimgetty, it fixes the issue. This is the same problem
occurred for oracle template, commit 2e83f7201c

Signed-off-by: Claudio Alarcon clalarco@gmail.com
2014-07-14 20:22:39 -04:00
Alexander Dreweke
177f2cd2c2 lxc-debian: added support for package installation
- added --mirror, --security-mirror and --package parameters
- generate source.list
- install packages into final lxc instance

Signed-off-by: Alexander Dreweke <alexander@dreweke.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-09 10:20:04 -04:00
Alexander Dreweke
b3d3f3c661 lxc-debian: standardize formatting
Signed-off-by: Alexander Dreweke <alexander@dreweke.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-09 10:19:52 -04:00
Alexander Dreweke
cd44154ca7 lxc-debian: fix formatting
added space ">/" -> ">  /"

Signed-off-by: Alexander Dreweke <alexander@dreweke.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-09 10:19:38 -04:00
José Martínez
5652d61020 lxc-ubuntu: update coding style
Signed-off-by: José Martínez <xosemp@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-07 10:49:12 -04:00
José Martínez
b6e07af7c2 lxc-ubuntu: fix btrfs when rootfs == realrootfs
Fix btrfs support when lxc-create does not bind-mount the rootfs.

Signed-off-by: José Martínez <xosemp@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-07 10:49:09 -04:00
Dwight Engen
6000d5bacb lxc-oracle: mount cgroup:mixed
- Mounting cgroup:mixed prevents systemd inside the container from
  moving its children out of the cgroups lxc setup. This ensure the
  limits setup in the configuration or with lxc-cgroup are effective.

- Update for the OL7 channel name that will be used on
  public-yum.oracle.com.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-07-03 15:39:11 -04:00
hallyn
616d626b4e Merge pull request #244 from xose/btrfs
lxc-ubuntu: use btrfs subvolumes and snapshots
2014-06-30 16:18:35 -05:00
Alexander Vladimirov
23cc88bae0 lxc-archlinux.in: update securetty when lxc.devttydir is set
Update container's /etc/securetty to allow console logins when lxc.devttydir is not empty.
Also use config entries provided by shared and common configuration files.

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-27 13:05:39 -04:00
Alexander Vladimirov
99cbd2996b lxc-archlinux.in: Add pacman keyring initialization back
Shuffle around usage text a bit and add missing -d while there.

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-27 13:03:57 -04:00
Alexander Vladimirov
c194ffc100 Update Arch Linux template and add common configuration files
Move common container configuration entries into template config.
Remove unnecessary service symlinking and configuration entries, as well as
guest configs and other redundant configuration, fix minor script bugs.
Clean up template command line, add -d option to allow disabling services.
Also enable getty's on all configured ttys to allow logins via lxc-console,
set lxc.tty value corresponding to default Arch /etc/securetty configuration.

This patch simplifies Arch Linux template a bit, while fixing some
longstanding issues. It also provides common configuration based on
files provided for Fedora templates.

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-24 16:00:31 -04:00
Stéphane Graber
ce7aee4d91
lxc-download: Bump compat to 2 after OpenSUSE
OpenSUSE is now ready for the download template in the master branch,
however it's not going to be compatible with older LXC as they lack the
needed config files, so bump the compat level to 2 to indicate that the
current lxc-download can deal with the current OpenSUSE containers.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-18 17:33:10 -04:00
Michael H. Warfield
41cf1ac30d Updated lxc-opensuse for common configuration changes.
Updated the lxc-opensuse template for the changes for the common
configuration used by the download template.  Changed the default
network mode in the container to dhcp.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-18 16:56:11 -04:00