mirror_lxc/config/init/systemd/lxc-devsetup
Stéphane Graber dc0682900a init: Add upstart jobs and some more changes (v3)
This adds the 3 upstart jobs that we've had in Ubuntu for a while:
 - lxc.conf: Main upstart job, triggers lxc-net.conf based on config
 - lxc-instance.conf: Triggered by lxc.conf for each auto-started container
 - lxc-net.conf: Triggered by lxc.conf, sets up lxcbr0, NAT, mangling, ...

In addition, there are two extra config files in /etc/default:
 - lxc: Allows setting some values like http proxying, disabling autostart, ...
 - lxc-net: Network configuration for the lxcbr0 bridge

This change also disables the sysv script for all distros but Oracle as
the current script won't work on either Ubuntu nor Debian and I suspect
quite a few more distros, so it's not nearly as distro-agnostic as we
thought.

For Debian, only install the upstart jobs and systemd unit.
For Ubuntu, only install the upstart jobs.

This change also moves all the init related stuff to config/init/

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-16 17:18:38 -05:00

26 lines
496 B
Bash
Executable File

#!/bin/sh -
# lxc.devsetup - Setup host /dev for container /dev subdirectories.
if [[ ! -d /dev/.lxc ]]
then
echo "Creating /dev/.lxc"
mkdir /dev/.lxc
chmod 755 /dev/.lxc
fi
if grep -q "/dev devtmpfs " /proc/self/mounts
then
echo "/dev is devtmpfs"
else
echo "/dev is not devtmpfs - mounting tmpfs on .lxc"
mount -t tmpfs tmpfs /dev/.lxc
fi
if [[ ! -d /dev/.lxc/user ]]
then
echo "Creating /dev/.lxc/user"
mkdir /dev/.lxc/user
chmod 1777 /dev/.lxc/user
fi