mirror_lxcfs.git
5 months agoMerge pull request #270 from tomponline/tp-reload master
Christian Brauner [Wed, 23 Jan 2019 11:45:08 +0000 (12:45 +0100)]
Merge pull request #270 from tomponline/tp-reload

config: Adds reload mode to sysvinit and systemd scripts.

5 months agoMerge pull request #268 from tomponline/tp-lock
Christian Brauner [Wed, 23 Jan 2019 10:24:44 +0000 (11:24 +0100)]
Merge pull request #268 from tomponline/tp-lock

Revert "bindings: protect do_release_file_info() with mutex"

5 months agoconfig: Adds reload mode to sysvinit and systemd scripts.
tomponline [Tue, 22 Jan 2019 14:23:05 +0000 (14:23 +0000)]
config: Adds reload mode to sysvinit and systemd scripts.

To to close down https://github.com/lxc/lxcfs/pull/188

Signed-off-by: tomponline <tomp@tomp.uk>
5 months agoRevert "bindings: protect do_release_file_info() with mutex"
tomponline [Tue, 22 Jan 2019 12:38:25 +0000 (12:38 +0000)]
Revert "bindings: protect do_release_file_info() with mutex"

This reverts commit 0108dc1cc6eab76392d228ee4ca844729096473d.

I am still experiencing hangs in lxcfs even with this patch.

Signed-off-by: tomponline <tomp@tomp.uk>
6 months agoMerge pull request #266 from tomponline/master
Christian Brauner [Fri, 18 Jan 2019 14:24:08 +0000 (16:24 +0200)]
Merge pull request #266 from tomponline/master

Adds mutex to do_release_file_info

6 months agobindings: protect do_release_file_info() with mutex
tomponline [Fri, 18 Jan 2019 13:05:09 +0000 (13:05 +0000)]
bindings: protect do_release_file_info() with mutex

Add a mutex to do_release_file_info to avoid lxcfs crash when stopping
multiple containers concurrently

Signed-off-by: tomponline <tomp@tomp.uk>
[christian.brauner@ubuntu.com: use correct commit message style]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 months agoMerge pull request #262 from brauner/2018-12-12/cg_readdir
Wolfgang Bumiller [Wed, 12 Dec 2018 16:09:12 +0000 (17:09 +0100)]
Merge pull request #262 from brauner/2018-12-12/cg_readdir

bindings: prevent NULL pointer dereference

7 months agobindings: prevent NULL pointer dereference
Christian Brauner [Wed, 12 Dec 2018 11:49:16 +0000 (12:49 +0100)]
bindings: prevent NULL pointer dereference

Fixes: https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1807628
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 months agoMerge pull request #260 from aither64/cpu-views
Serge Hallyn [Sat, 8 Dec 2018 19:28:55 +0000 (13:28 -0600)]
Merge pull request #260 from aither64/cpu-views

CPU views based on quotas

8 months agostat: check for out of bound access to cpuacct usage data
Jakub Skokan [Wed, 24 Oct 2018 12:39:39 +0000 (14:39 +0200)]
stat: check for out of bound access to cpuacct usage data

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
8 months agoCPU view: handle disabling/enabling of physical CPUs at runtime
Jakub Skokan [Sun, 21 Oct 2018 13:13:07 +0000 (15:13 +0200)]
CPU view: handle disabling/enabling of physical CPUs at runtime

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
8 months agoCPU view: handle CPU hotplug at runtime
Jakub Skokan [Sun, 21 Oct 2018 07:04:12 +0000 (09:04 +0200)]
CPU view: handle CPU hotplug at runtime

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
8 months agoCPU view: add mutexes
Jakub Skokan [Mon, 25 Jun 2018 16:24:14 +0000 (18:24 +0200)]
CPU view: add mutexes

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
8 months agoCPU view: prune stale entries
Jakub Skokan [Mon, 25 Jun 2018 12:47:43 +0000 (14:47 +0200)]
CPU view: prune stale entries

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
8 months agostat: use cpu views
Jakub Skokan [Mon, 25 Jun 2018 07:05:30 +0000 (09:05 +0200)]
stat: use cpu views

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
8 months agocalc_hash(): do not apply modulo LOAD_SIZE
Jakub Skokan [Mon, 25 Jun 2018 06:55:23 +0000 (08:55 +0200)]
calc_hash(): do not apply modulo LOAD_SIZE

This will allow `calc_hash()` to be used for other purposes than
the loadavg implementation.

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
8 months agocpuinfo: use cpu view based on cpu quotas
Jakub Skokan [Mon, 25 Jun 2018 06:54:15 +0000 (08:54 +0200)]
cpuinfo: use cpu view based on cpu quotas

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
10 months agoMerge pull request #255 from brauner/2018-08-26/fix_makedev
Stéphane Graber [Sun, 26 Aug 2018 20:09:35 +0000 (16:09 -0400)]
Merge pull request #255 from brauner/2018-08-26/fix_makedev

tests: include missing sys/sysmacros.h header

10 months agotests: include missing sys/sysmacros.h header
Christian Brauner [Sun, 26 Aug 2018 10:23:31 +0000 (12:23 +0200)]
tests: include missing sys/sysmacros.h header

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
11 months agoMerge pull request #253 from brauner/2018-08-17/prevent_double_free
Stéphane Graber [Fri, 17 Aug 2018 16:00:00 +0000 (12:00 -0400)]
Merge pull request #253 from brauner/2018-08-17/prevent_double_free

bindings: prevent double free

11 months agobindings: prevent double free
Christian Brauner [Fri, 17 Aug 2018 15:33:22 +0000 (17:33 +0200)]
bindings: prevent double free

Closes #252.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
11 months agoMerge pull request #250 from brauner/2018-07-30/improve_error_message
Stéphane Graber [Mon, 30 Jul 2018 21:47:32 +0000 (17:47 -0400)]
Merge pull request #250 from brauner/2018-07-30/improve_error_message

bindings: better logging for write_string()

11 months agobindings: better logging for write_string()
Christian Brauner [Mon, 30 Jul 2018 08:53:19 +0000 (10:53 +0200)]
bindings: better logging for write_string()

Closes #249.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
12 months agoMerge pull request #248 from aither64/meminfo
Christian Brauner [Wed, 4 Jul 2018 16:26:09 +0000 (18:26 +0200)]
Merge pull request #248 from aither64/meminfo

meminfo: read shmem from memory cgroup

12 months agomeminfo: set ShmemHugePages and ShmemPmdMapped to zero
Jakub Skokan [Wed, 4 Jul 2018 15:50:30 +0000 (17:50 +0200)]
meminfo: set ShmemHugePages and ShmemPmdMapped to zero

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
12 months agomeminfo: read shmem from cgroup parameter memory.stat
Jakub Skokan [Wed, 4 Jul 2018 15:48:52 +0000 (17:48 +0200)]
meminfo: read shmem from cgroup parameter memory.stat

Shmem was passed as-is from the host, but other fields weren't (such as
Cached and SReclaimed), which has caused htop to show incorrect memory usage.
If `total_shmem` is found in `memory.stat`, it is used, otherwise `Shmem`
is reported as zero.

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
13 months agoMerge pull request #245 from aither64/loadavg-leak
Christian Brauner [Thu, 21 Jun 2018 07:58:45 +0000 (09:58 +0200)]
Merge pull request #245 from aither64/loadavg-leak

bindings: fix memory leak in calc_pid()

13 months agobindings: fix memory leak in calc_pid()
Jakub Skokan [Wed, 20 Jun 2018 18:24:28 +0000 (20:24 +0200)]
bindings: fix memory leak in calc_pid()

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
13 months agotravis: fix .travis.yml
Christian Brauner [Wed, 20 Jun 2018 13:45:09 +0000 (15:45 +0200)]
travis: fix .travis.yml

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
13 months agotravis: add coverity support
Christian Brauner [Wed, 20 Jun 2018 10:54:10 +0000 (12:54 +0200)]
travis: add coverity support

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
13 months agoMerge pull request #244 from aither64/perct-cpu-usage
Christian Brauner [Wed, 20 Jun 2018 10:44:12 +0000 (12:44 +0200)]
Merge pull request #244 from aither64/perct-cpu-usage

Per-container CPU usage in /proc/stat

13 months agoPer-container CPU usage in /proc/stat
Jakub Skokan [Mon, 18 Jun 2018 08:50:02 +0000 (10:50 +0200)]
Per-container CPU usage in /proc/stat

Containers can see utilization of all available CPUs, even if the CPU
is utilized by other containers or by the host. The contents
of `/proc/stat` is shared across the system, except for hiding CPUs
excluded by cpuset. This commit attempts to fix that, but at a cost.
CPU usage is read from cpuacct cgroup, but that accounts only for
`user` and `system` fields from `/proc/stat`. Idle time can be
calculated, but other fields cannot, thus are always set to 0.
Additionally, idle time is based on values from the host, so even
a freshly started container has large initial idle time.

If the cpuacct cgroup is not present, or reading from it fails, LXCFS
will return CPU usage stats from the host as before.

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
13 months agoMerge pull request #242 from aither64/loadavg-reload
Christian Brauner [Thu, 14 Jun 2018 07:39:36 +0000 (09:39 +0200)]
Merge pull request #242 from aither64/loadavg-reload

loadavg: restart thread on library reload

13 months agoloadavg: restart thread on library reload
Jakub Skokan [Mon, 11 Jun 2018 13:05:14 +0000 (15:05 +0200)]
loadavg: restart thread on library reload

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
13 months agoMerge pull request #241 from aither64/loadavg-leak
Christian Brauner [Wed, 13 Jun 2018 09:00:41 +0000 (11:00 +0200)]
Merge pull request #241 from aither64/loadavg-leak

bindings: fix memory leak in proc_loadavg_read()

13 months agobindings: fix memory leak in proc_loadavg_read()
Jakub Skokan [Mon, 11 Jun 2018 13:12:22 +0000 (15:12 +0200)]
bindings: fix memory leak in proc_loadavg_read()

Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
13 months agoMerge pull request #237 from zhang2639/master
Christian Brauner [Thu, 24 May 2018 14:58:18 +0000 (16:58 +0200)]
Merge pull request #237 from zhang2639/master

loadavg

13 months agoClaim and use load_free() to free hash table.
zhang2639 [Thu, 24 May 2018 10:46:53 +0000 (18:46 +0800)]
Claim and use load_free() to free hash table.

Signed-off-by: zhang2639 <zhangshiqiang@hust.edu.cn>
Signed-off-by: yuwang <yuwang@linux.alibaba.com>
13 months agoCalculate and read the average load.
zhang2639 [Thu, 24 May 2018 10:42:37 +0000 (18:42 +0800)]
Calculate and read the average load.

Use load daemon to calculate the loadavg and use proc_loadavg_read() to read the loadavg.
calc_pid : find the process pid from cgroup path of a container.
calc_load : calculate the loadavg of a container.
refresh_load : refresh the loadavg of a container.
load_begin : traverse the hash table and update it.

Signed-off-by: zhang2639 <zhangshiqiang@hust.edu.cn>
Signed-off-by: yuwang <yuwang@linux.alibaba.com>
13 months agoUse hash table to store load information
zhang2639 [Thu, 24 May 2018 10:27:34 +0000 (18:27 +0800)]
Use hash table to store load information

struct load_head{} contains three locks for thread synchronization
and a pointer to the hash list.
struct load_node{} contains special information of container and
pointers to the hash node.
static struct load_head *load_hash[LOAD_SIZE] is hash table.
calc_hash : get the hash of a special container.
init_load : initialize hash table.
insert_node : insert a container node to the hash table.
locate_node : find the specital container node.
del_node : delete a specital container node and return the next node
of it.

Signed-off-by: zhang2639 <zhangshiqiang@hust.edu.cn>
Signed-off-by: yuwang <yuwang@linux.alibaba.com>
14 months agoNecessary instructions for loadavg
zhang2639 [Thu, 3 May 2018 03:14:47 +0000 (11:14 +0800)]
Necessary instructions for loadavg

Signed-off-by: zhang2639 <zhangshiqiang@hust.edu.cn>
Signed-off-by: yuwang <yuwang@linux.alibaba.com>
14 months agoMerge pull request #236 from geaaru/nonempty-opt
Christian Brauner [Wed, 2 May 2018 15:08:53 +0000 (17:08 +0200)]
Merge pull request #236 from geaaru/nonempty-opt

Add support to nonempty option

14 months agoAdd support to nonempty option
Geaaru [Tue, 24 Apr 2018 22:01:03 +0000 (00:01 +0200)]
Add support to nonempty option

Signed-off-by: Geaaru <geaaru@gmail.com>
15 months agoRelease LXCFS 3.0.0
Stéphane Graber [Tue, 27 Mar 2018 03:17:37 +0000 (23:17 -0400)]
Release LXCFS 3.0.0

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
16 months agoMerge pull request #234 from stgraber/master
Christian Brauner [Fri, 2 Mar 2018 22:16:00 +0000 (23:16 +0100)]
Merge pull request #234 from stgraber/master

Fix test_proc on s390x

16 months agoFix test_proc on s390x
Stéphane Graber [Fri, 2 Mar 2018 22:13:47 +0000 (17:13 -0500)]
Fix test_proc on s390x

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
16 months agoRelease LXCFS 3.0.0.beta1
Stéphane Graber [Thu, 1 Mar 2018 18:46:21 +0000 (13:46 -0500)]
Release LXCFS 3.0.0.beta1

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
16 months agoMerge pull request #233 from brauner/2018-02-26/remove_pam_cgfs
Stéphane Graber [Mon, 26 Feb 2018 17:11:39 +0000 (12:11 -0500)]
Merge pull request #233 from brauner/2018-02-26/remove_pam_cgfs

pam: remove from LXCFS (is now in LXC)

16 months agopam: remove from LXCFS (is now in LXC)
Christian Brauner [Mon, 26 Feb 2018 16:40:46 +0000 (17:40 +0100)]
pam: remove from LXCFS (is now in LXC)

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
19 months agoMerge pull request #228 from asokoloski/fix-175-c
Christian Brauner [Mon, 4 Dec 2017 20:04:10 +0000 (21:04 +0100)]
Merge pull request #228 from asokoloski/fix-175-c

Change MemAvailable figure in /proc/meminfo to include cache memory -- Fixes #175 I think.

19 months agoChange MemAvailable figure in /proc/meminfo to include cache memory -- Fixes #175...
Aaron Sokoloski [Mon, 4 Dec 2017 18:30:37 +0000 (12:30 -0600)]
Change MemAvailable figure in /proc/meminfo to include cache memory -- Fixes #175 I think.

MemAvailable represents roughly how much more memory we can use before
we start swapping.  Page cache memory can be reclaimed if it's needed
for something else, so it should count as available memory.  This
change should also fix the "available" column of the "free" command,
as well as the "avail Mem" value in "top", both of which come from
MemAvailable.

Note that this isn't perfectly accurate.  On a physical machine, the
value for MemAvailable is the result of a calculation that takes into
account that when memory gets low (but before it's completely
exhausted), kswapd wakes up and starts paging things out.  See:

https://github.com/torvalds/linux/blob/a0908a1b7d68706ee52ed4a039756e70c8e956e9/mm/page_alloc.c#L4553
(si_mem_available function)

I tried to think of a way to be more exact, but this calculation
includes figures that we don't have available for a given cgroup
hierarchy, such as reclaimable slab memory and the low watermark for
zones.  So it's not really feasible to reproduce it exactly.

Anyway, since the kernel calculation itself is just an estimation, it
doesn't seem too bad that we're a little bit off.  Adding in the
amount of memory used for page cache seems much better than what we
were doing before (just copying the free memory figure), because that
can be wrong by gigabytes.

For a more detailed understanding of how MemAvailable comes about one
should look at 34e431b0ae398fc54ea69ff85ec700722c9da773 in the Linux
kernel tree.

Signed-off-by: Aaron Sokoloski <asokoloski@gmail.com>
19 months agoMerge pull request #225 from asokoloski/master
Christian Brauner [Sat, 2 Dec 2017 19:15:43 +0000 (20:15 +0100)]
Merge pull request #225 from asokoloski/master

Fix inaccurate values in /proc/meminfo for containers with child cgroups

19 months agoFix inaccurate values in /proc/meminfo for containers with child cgroups
Aaron Sokoloski [Sat, 2 Dec 2017 18:43:06 +0000 (12:43 -0600)]
Fix inaccurate values in /proc/meminfo for containers with child cgroups

The values for Cached, Active, Inactive, Active(anon), Inactive(anon),
Active(file), Inactive(file), and Unevictable are derived/computed
from these values in the relevant meminfo.stat:

cache
active_anon
inactive_anon
active_file
inactive_file
unevictable

However, these value apply only to the cgroup of the lxc container
itself.  If your container uses memory cgroups internally, and thus
the container cgroup has children, their memory is not counted.

In order to take the memory usage of child cgroups into account, we
need to look at the "total_" prefixed versions of these values.

Signed-off-by: Aaron Sokoloski <asokoloski@gmail.com>
20 months agoMerge pull request #221 from brauner/2017-11-02/cgroup_v2_fixes
Serge Hallyn [Sat, 11 Nov 2017 00:55:31 +0000 (18:55 -0600)]
Merge pull request #221 from brauner/2017-11-02/cgroup_v2_fixes

pam: cgroup v2 fixes

20 months agopam: adapt to changed cgroup v2 layout
Christian Brauner [Thu, 2 Nov 2017 12:30:13 +0000 (13:30 +0100)]
pam: adapt to changed cgroup v2 layout

In order to enable proper unprivileged cgroup delegation on newer kernels we not
just need delegate the "cgroup.procs" file to the user but also to
"cgroup.threads". But don't report an error in case it doesn't exist.
Also delegate "cgroup.subtree_control" to enable users to hand over controllers
to descendant cgroups.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
20 months agobindings: remove unused function
Christian Brauner [Thu, 2 Nov 2017 12:30:03 +0000 (13:30 +0100)]
bindings: remove unused function

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
20 months agobindings: record mount namespace
Christian Brauner [Thu, 2 Nov 2017 12:26:36 +0000 (13:26 +0100)]
bindings: record mount namespace

This will allows us to attach to the mount namespace in case we need to debug or
perform some action on update.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
21 months agoMerge pull request #220 from yuwang888/master
Serge Hallyn [Sat, 21 Oct 2017 17:02:46 +0000 (13:02 -0400)]
Merge pull request #220 from yuwang888/master

Fix wrong calc of swaptoal and swapfree

21 months agoFix wrong calc of swaptoal and swapfree
yuwang.yuwang [Fri, 20 Oct 2017 06:28:03 +0000 (14:28 +0800)]
Fix wrong calc of swaptoal and swapfree

it make the value of (memswlimit - memlimit) to be swaptotal,
it is wrong, because swapsize in cgroup/container can up to
[0,memswlimit], sometimes if the memsize(unless swap) of all tasks in
cgroup/container is very small, the swaptoal can to be memswlimit
so make the swaptotal to be min(host swtoal,memswlimit)

Signed-off-by: yuwang.yuwang <yuwang.yuwang@alibaba-inc.com>
21 months agoMerge pull request #216 from nagarathnam200/master
Serge Hallyn [Mon, 2 Oct 2017 19:06:10 +0000 (14:06 -0500)]
Merge pull request #216 from nagarathnam200/master

Fix the installation directory for liblxcfs to ${libdir}/lxcfs

21 months agoFix the installation directory for liblxcfs to ${libdir}/lxcfs
Nagarathnam Muthusamy [Tue, 26 Sep 2017 00:32:09 +0000 (17:32 -0700)]
Fix the installation directory for liblxcfs to ${libdir}/lxcfs

Signed-off-by: Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>
22 months agoMerge pull request #211 from cyphar/pam_cgfs-all-option
Christian Brauner [Fri, 15 Sep 2017 01:35:29 +0000 (18:35 -0700)]
Merge pull request #211 from cyphar/pam_cgfs-all-option

pam_cgfs: add an 'all' option for -c

22 months agopam_cgfs: add an 'all' option for -c
Aleksa Sarai [Fri, 15 Sep 2017 01:05:40 +0000 (11:05 +1000)]
pam_cgfs: add an 'all' option for -c

In order to not require a user to manually list all cgroup controllers
in their PAM configuration, add an "all" option that effectively just
sets all controllers as read-write.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
23 months agoMerge pull request #205 from bmiklautz/uptime_read
Christian Brauner [Thu, 3 Aug 2017 13:01:33 +0000 (09:01 -0400)]
Merge pull request #205 from bmiklautz/uptime_read

uptime: fix a problem with subsequent reads.

23 months agouptime: fix a problem with subsequent reads.
Bernhard Miklautz [Thu, 3 Aug 2017 11:37:37 +0000 (13:37 +0200)]
uptime: fix a problem with subsequent reads.

When doing subsequent reads of uptime on an open file handle
in the form:

read
lseek 0L, SEEK_SET
read

the second (and later) reads cause that the error
"failed to write to cache" was printed. This
happens for example with "top". top would print the error:

bad data in /proc/uptime

To fix this problem use the whole size of the buffer instead of the d->size
because this is set on the first read.

This behavior was introduced with commit 0ecddf023a4caf8e8d2fe7e9125d777a06c5ec12.

Signed-off-by: Bernhard Miklautz <bernhard.miklautz@shacknet.at>
2 years agoMerge pull request #198 from elianka/elianka-dev
Serge Hallyn [Tue, 4 Jul 2017 15:46:54 +0000 (10:46 -0500)]
Merge pull request #198 from elianka/elianka-dev

add common fallback dlopen for liblxcfs.so

2 years agoadd common fallback dlopen for liblxcfs.so
Daniel Kang [Sat, 1 Jul 2017 16:23:44 +0000 (00:23 +0800)]
add common fallback dlopen for liblxcfs.so

Signed-off-by: Daniel Kang <kangliang424@gmail.com>
2 years agoMerge pull request #196 from elianka/elianka-dev
Christian Brauner [Wed, 28 Jun 2017 11:55:59 +0000 (13:55 +0200)]
Merge pull request #196 from elianka/elianka-dev

enable debug option

2 years agoenable debug option
Daniel Kang [Wed, 28 Jun 2017 11:40:50 +0000 (19:40 +0800)]
enable debug option

Signed-off-by: Daniel Kang <kangliang424@gmail.com>
2 years agoMerge pull request #195 from evgeni/should-start-after-cgroupfs-mount
Christian Brauner [Thu, 22 Jun 2017 09:35:52 +0000 (11:35 +0200)]
Merge pull request #195 from evgeni/should-start-after-cgroupfs-mount

add cgroupfs-mount to Should-Start/Stop sysvinit LSB headers

2 years agoadd cgroupfs-mount to Should-Start/Stop sysvinit LSB headers
Evgeni Golov [Thu, 22 Jun 2017 06:22:07 +0000 (08:22 +0200)]
add cgroupfs-mount to Should-Start/Stop sysvinit LSB headers

otherwise init might try to start lxcfs before cgroupfs was mounted,
which will result in an empty /var/lib/lxcfs/cgroup and weird issues.

Debian-Bug: https://bugs.debian.org/859219
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2 years agoMerge pull request #194 from brauner/2017-06-19/update_readme
Stéphane Graber [Mon, 19 Jun 2017 16:25:18 +0000 (12:25 -0400)]
Merge pull request #194 from brauner/2017-06-19/update_readme

README: update

2 years agoREADME: update
Christian Brauner [Mon, 19 Jun 2017 08:29:34 +0000 (10:29 +0200)]
README: update

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #192 from hallyn/revert-btime
Christian Brauner [Sun, 18 Jun 2017 20:53:10 +0000 (22:53 +0200)]
Merge pull request #192 from hallyn/revert-btime

(temporarily?) revert the virtualization of btime field in /proc/stat

2 years ago(temporarily?) revert the virtualization of btime field in /proc/stat
Serge Hallyn [Sun, 18 Jun 2017 19:43:22 +0000 (14:43 -0500)]
(temporarily?) revert the virtualization of btime field in /proc/stat

Closes #189

This seems to be responsible for corrupting STIME on processlist
inside containers.  Hopefully we can find a reasonable way to fix
both, but compared to unvirtualized btime field, bogus STIME field
is the greater evil here.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2 years agoMerge pull request #190 from brauner/2017-06-12/bugfixes
Stéphane Graber [Mon, 12 Jun 2017 17:08:51 +0000 (13:08 -0400)]
Merge pull request #190 from brauner/2017-06-12/bugfixes

bugfixes

2 years agotests: fix invalid comparison
Christian Brauner [Mon, 12 Jun 2017 13:47:13 +0000 (15:47 +0200)]
tests: fix invalid comparison

We now follow the host's /proc/uptime in that we report two digits after the dot
too. Adapt the tests too.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agobindings: calculate btime correctly
Christian Brauner [Mon, 12 Jun 2017 12:45:44 +0000 (14:45 +0200)]
bindings: calculate btime correctly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #186 from brauner/2017-05-22/user_starttime_for_uptime
Serge Hallyn [Fri, 26 May 2017 16:17:29 +0000 (11:17 -0500)]
Merge pull request #186 from brauner/2017-05-22/user_starttime_for_uptime

bindings: calculate uptime via proc/<pid>/stat

2 years agobindings: calculate uptime via proc/<pid>/stat
Christian Brauner [Fri, 26 May 2017 03:06:30 +0000 (05:06 +0200)]
bindings: calculate uptime via proc/<pid>/stat

Closes #165.
Closes #184.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #182 from brauner/2017-05-16/pam_cgv2_improvements
Serge Hallyn [Thu, 18 May 2017 21:46:27 +0000 (16:46 -0500)]
Merge pull request #182 from brauner/2017-05-16/pam_cgv2_improvements

pam: bugfixes

2 years agopam: chown cgroup.procs file on unified hierarchy
Christian Brauner [Mon, 15 May 2017 23:08:10 +0000 (01:08 +0200)]
pam: chown cgroup.procs file on unified hierarchy

On the unified hierarchy cgroup.procs must be owned by the user in order for him
to be able to move processes into other cgroups.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #183 from brauner/2017-05-17/add_unified_mount
Serge Hallyn [Wed, 17 May 2017 19:02:15 +0000 (14:02 -0500)]
Merge pull request #183 from brauner/2017-05-17/add_unified_mount

bindings: add mountpoint for unified hierarchy

2 years agobindings: add mountpoint for unified hierarchy
Christian Brauner [Wed, 17 May 2017 10:11:20 +0000 (12:11 +0200)]
bindings: add mountpoint for unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agopam: report back we found the unified hierarchy
Christian Brauner [Mon, 15 May 2017 23:06:59 +0000 (01:06 +0200)]
pam: report back we found the unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agopam: non-functional changes
Christian Brauner [Mon, 15 May 2017 23:06:24 +0000 (01:06 +0200)]
pam: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #179 from brauner/2017-03-11/bugfixes
Serge Hallyn [Sun, 12 Mar 2017 02:42:07 +0000 (20:42 -0600)]
Merge pull request #179 from brauner/2017-03-11/bugfixes

{pam_cgfs, bindings}: bugfixes

2 years agobindings: increase reserved buffer size a little
Christian Brauner [Sat, 11 Mar 2017 16:19:12 +0000 (17:19 +0100)]
bindings: increase reserved buffer size a little

So far, only proc_stat_read() is fully using BUF_RESERVE_SIZE so it doesn't
actually benefit from the additional memory assigned to it like all the other
files in proc do. So double the size and have proc_stat_read() only use half of
it.

Supposedly fixes #176.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agobindings: implement guest nice
Christian Brauner [Sat, 11 Mar 2017 13:51:58 +0000 (14:51 +0100)]
bindings: implement guest nice

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agopam_cgfs: remove dead assignment
Christian Brauner [Sat, 11 Mar 2017 13:04:47 +0000 (14:04 +0100)]
pam_cgfs: remove dead assignment

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agopam_cgfs: error out on failure in cgv2_init()
Christian Brauner [Sat, 11 Mar 2017 12:58:10 +0000 (13:58 +0100)]
pam_cgfs: error out on failure in cgv2_init()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #178 from brauner/2017-03-03/fix_trim
Serge Hallyn [Fri, 3 Mar 2017 00:16:04 +0000 (18:16 -0600)]
Merge pull request #178 from brauner/2017-03-03/fix_trim

pam_cgfs: make trim() safer

2 years agopam_cgfs: make trim() safer
Christian Brauner [Thu, 2 Mar 2017 23:35:07 +0000 (00:35 +0100)]
pam_cgfs: make trim() safer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #174 from brauner/2017-02-09/bugfixes
Serge Hallyn [Thu, 9 Feb 2017 21:03:38 +0000 (15:03 -0600)]
Merge pull request #174 from brauner/2017-02-09/bugfixes

2017 02 09/bugfixes

2 years agobindings: Want space for ints? Call sizeof(int)!
Christian Brauner [Thu, 9 Feb 2017 10:49:04 +0000 (11:49 +0100)]
bindings: Want space for ints? Call sizeof(int)!

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agopam_cgfs: make sure that **p is not NULL
Christian Brauner [Thu, 9 Feb 2017 10:36:47 +0000 (11:36 +0100)]
pam_cgfs: make sure that **p is not NULL

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agopam_cgfs: return created directly
Christian Brauner [Thu, 9 Feb 2017 10:25:30 +0000 (11:25 +0100)]
pam_cgfs: return created directly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agopam_cgfs: remove dead assignment
Christian Brauner [Thu, 9 Feb 2017 10:22:50 +0000 (11:22 +0100)]
pam_cgfs: remove dead assignment

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2 years agoMerge pull request #169 from almostivan/btime
Serge Hallyn [Fri, 3 Feb 2017 06:00:12 +0000 (00:00 -0600)]
Merge pull request #169 from almostivan/btime

virtualize the 'btime' field of /proc/stat

2 years agoMerge pull request #172 from Blub/queue
Serge Hallyn [Thu, 2 Feb 2017 16:21:08 +0000 (10:21 -0600)]
Merge pull request #172 from Blub/queue

Limit memswlimit by TotalSwap