]> git.proxmox.com Git - mirror_lxcfs.git/blame - README.md
Fix test_proc on s390x
[mirror_lxcfs.git] / README.md
CommitLineData
60f73aff
SG
1# lxcfs
2
c397924a 3## Introduction
12993ccc
CB
4LXCFS is a small FUSE filesystem written with the intention of making Linux
5containers feel more like a virtual machine. It started as a side-project of
6`LXC` but is useable by any runtime.
758ad80c 7
12993ccc
CB
8LXCFS will take care that the information provided by crucial files in `procfs`
9such as:
10
11```
12/proc/cpuinfo
13/proc/diskstats
14/proc/meminfo
15/proc/stat
16/proc/swaps
17/proc/uptime
18```
19
20are container aware such that the values displayed (e.g. in `/proc/uptime`)
21really reflect how long the container is running and not how long the host is
22running.
23
24Prior to the implementation of cgroup namespaces by Serge Hallyn `LXCFS` also
25provided a container aware `cgroupfs` tree. It took care that the container
26only had access to cgroups underneath it's own cgroups and thus provided
27additional safety. For systems without support for cgroup namespaces `LXCFS`
28will still provide this feature.
955ce662 29
c397924a 30## Usage
758ad80c
SH
31The recommended command to run lxcfs is:
32
c397924a 33 sudo mkdir -p /var/lib/lxcfs
40dd7f1b 34 sudo lxcfs /var/lib/lxcfs
7456f3b5 35
12993ccc
CB
36A container runtime wishing to use `LXCFS` should then bind mount the
37approriate files into the correct places on container startup.
38
39### LXC
7456f3b5
SG
40In order to use lxcfs with systemd-based containers, you can either use
41LXC 1.1 in which case it should work automatically, or otherwise, copy
77647bf9
EG
42the `lxc.mount.hook` and `lxc.reboot.hook` files (once built) from this tree to
43`/usr/share/lxcfs`, make sure it is executable, then add the
44following lines to your container configuration:
5b1e45dd 45```
77647bf9 46lxc.mount.auto = cgroup:mixed
1a188fcb 47lxc.autodev = 1
ef65395d 48lxc.kmsg = 0
77647bf9 49lxc.include = /usr/share/lxc/config/common.conf.d/00-lxcfs.conf
5b1e45dd 50```
12993ccc
CB
51
52## Upgrading LXCFS without breaking running containers
53LXCFS is implemented using a simple shared library without any external
54dependencies other than `FUSE`. It is completely reloadable without having to
55umount it. This ensures that container can be kept running even when the shared
56library is upgraded.
57
58To force a reload of the shared library at the next possible instance simply
59send `SIGUSR1` to the pid of the running `LXCFS` process. This can be as simple
60as doing:
61
62 kill -s USR1 $(pidof lxcfs)