]> git.proxmox.com Git - mirror_lxcfs.git/log
mirror_lxcfs.git
8 years agoconfigure.ac: v0.10 lxcfs-0.10
Stéphane Graber [Thu, 3 Sep 2015 22:55:54 +0000 (18:55 -0400)]
configure.ac: v0.10

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agofix symlink
Serge Hallyn [Thu, 3 Sep 2015 13:46:52 +0000 (08:46 -0500)]
fix symlink

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc mount hook: implement stgraber's suggestions
Serge Hallyn [Thu, 3 Sep 2015 04:00:11 +0000 (23:00 -0500)]
lxc mount hook: implement stgraber's suggestions

revert to using sh and use symlinks instead of extra mounts.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoUpdate lxc mount hook to ovver a mount per co-mounted controller
Serge Hallyn [Thu, 3 Sep 2015 03:28:59 +0000 (22:28 -0500)]
Update lxc mount hook to ovver a mount per co-mounted controller

If cpu,cpuacct are comounted, then in addition to cpu,cpuacct make
mounts for 'cpu' and 'cpuacct'.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc mount hook: don't mount lxcfs fs for any controller already setup
Serge Hallyn [Wed, 24 Jun 2015 23:26:06 +0000 (18:26 -0500)]
lxc mount hook: don't mount lxcfs fs for any controller already setup

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agodon't thread
Serge Hallyn [Wed, 24 Jun 2015 23:15:34 +0000 (18:15 -0500)]
don't thread

The pieces are there, but for now it's still not safe with libdbus

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoReturn host's meminfo file if no memory cgroup
Serge Hallyn [Fri, 5 Jun 2015 04:18:20 +0000 (23:18 -0500)]
Return host's meminfo file if no memory cgroup

If memory cgroup is not available (that is, we can't find a
memory cgroup for the reading task), then just return the
contents of the host's /proc/meminfo.  (Same for all proc file
reads)

Closes #30

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agofix two threading issues
Serge Hallyn [Wed, 20 May 2015 15:56:46 +0000 (08:56 -0700)]
fix two threading issues

Make sure to prep dbus for threading before we start.

And use _exit() any time we are exiting from a forked child.  This is
to avoid calling the at_exit() functions.  Once a thread in the main
program has called nih_error_init(), this registers an at_exit fn which
asserts that the nih_context not be null - but after we fork, if libnih
is built with --enable-threading, then the nih_context is in fact null.
The only way to clear the atexit fns would be to exec().  So call
_exit() instead of exit(), because _exit() avoids calling the atexit
fns.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agouse threads when safe
Serge Hallyn [Tue, 19 May 2015 21:27:05 +0000 (14:27 -0700)]
use threads when safe

libnih, when not built with --enable-threading, cannot be safely
used by a threaded application.  Detect whether it is built to be
threadsafe using a new libnih helper, and, if so, run threaded by
(a) not passing '-s' to fuse, and (b) making the dbus connection
and detected api version thread-local.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoconfigure.ac: v0.9 lxcfs-0.9
Serge Hallyn [Sat, 9 May 2015 00:52:28 +0000 (19:52 -0500)]
configure.ac: v0.9

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #26 from mikemccracken/maybe-fix-24
Stéphane Graber [Fri, 8 May 2015 21:09:38 +0000 (21:09 +0000)]
Merge pull request #26 from mikemccracken/maybe-fix-24

Add error handling for snprintf calls inside *_read() funcs

9 years agoinside *_read() funcs, return 0 for snprintf errors and truncations
Michael McCracken [Fri, 8 May 2015 20:24:03 +0000 (16:24 -0400)]
inside *_read() funcs, return 0 for snprintf errors and truncations

Signed-off-by: Michael McCracken <mike.mccracken@canonical.com>
9 years agocheck return value from snprintf to avoid FUSE errors. Potentially fixes #24.
Michael McCracken [Fri, 8 May 2015 08:46:02 +0000 (04:46 -0400)]
check return value from snprintf to avoid FUSE errors. Potentially fixes #24.

Signed-off-by: Michael McCracken <mike.mccracken@canonical.com>
9 years agoconfigure.ac: release 0.8 lxcfs-0.8
Serge Hallyn [Thu, 7 May 2015 19:39:34 +0000 (14:39 -0500)]
configure.ac: release 0.8

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement --version
Serge Hallyn [Thu, 7 May 2015 16:25:52 +0000 (11:25 -0500)]
implement --version

Because this is needed for help2man to determine the program name.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix the check for cpu being in cpuset range
Serge Hallyn [Thu, 30 Apr 2015 11:07:34 +0000 (13:07 +0200)]
Fix the check for cpu being in cpuset range

Also add a testcase to make sure that the new function is correct.
In order to share the cpuset range checking code with with the
test, move it into cpuset.c.  Not sure whether we want that in a
utils.c instead.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoAdd some more sanity checks
Serge Hallyn [Mon, 20 Apr 2015 13:40:39 +0000 (08:40 -0500)]
Add some more sanity checks

Limit string size in sscanf, convert some sprintfs to snprintfs
(to make them future-proof), and free d in case of error.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agofree d at program end
Serge Hallyn [Sun, 19 Apr 2015 04:51:03 +0000 (23:51 -0500)]
free d at program end

to silence warnings from memory checkers

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMake sure that that '/cgroup' and the controller are sep'd by /
Serge Hallyn [Sun, 19 Apr 2015 04:03:45 +0000 (23:03 -0500)]
Make sure that that '/cgroup' and the controller are sep'd by /

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocg_read: add ending newline
Serge Hallyn [Fri, 17 Apr 2015 21:13:33 +0000 (16:13 -0500)]
cg_read: add ending newline

Closes #23

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agouse direct_io
Serge Hallyn [Fri, 17 Apr 2015 20:39:35 +0000 (15:39 -0500)]
use direct_io

This will prevent a file read for over getattr.

File sizes show up as 0, but they do so in cgroupfs and procfs as well.

Closes #20.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoProvide the fuse options we want ourselves
Serge Hallyn [Fri, 17 Apr 2015 20:28:04 +0000 (15:28 -0500)]
Provide the fuse options we want ourselves

continue to allow the options which in the past we basically required
callers to provide ("-s -f -o allow_other"), exit on anything else.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoCleanup whitespace
Serge Hallyn [Fri, 10 Apr 2015 18:54:46 +0000 (13:54 -0500)]
Cleanup whitespace

and remove commented out debug statement

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #22 from hustcat/cache.1
Serge Hallyn [Fri, 10 Apr 2015 18:52:02 +0000 (13:52 -0500)]
Merge pull request #22 from hustcat/cache.1

cache for proc file

9 years agoinfo as parent when malloc memory for file buf
Ye Yin [Fri, 10 Apr 2015 07:19:44 +0000 (15:19 +0800)]
info as parent when malloc memory for file buf
reduce one blank for /proc/stat

Signed-off-by: Ye Yin <eyniy@qq.com>
9 years agoMerge pull request #19 from hallyn/cache.1
Serge Hallyn [Thu, 9 Apr 2015 21:18:06 +0000 (16:18 -0500)]
Merge pull request #19 from hallyn/cache.1

Cache.1

9 years agoadd cache for proc file, for support multiple read
Ye Yin [Thu, 9 Apr 2015 11:01:10 +0000 (19:01 +0800)]
add cache for proc file, for support multiple read

Signed-off-by: Ye Yin <eyniy@qq.com>
9 years agoLXC hook fixes
Stéphane Graber [Tue, 7 Apr 2015 20:17:40 +0000 (16:17 -0400)]
LXC hook fixes

 - Detects whether cgroups are enabled in the container's config
 - Don't mount a second tmpfs on /sys/fs/cgroup

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agocache: use file_dir object as parent for alloc'ed objects
Serge Hallyn [Tue, 7 Apr 2015 03:10:17 +0000 (22:10 -0500)]
cache: use file_dir object as parent for alloc'ed objects

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agodon't check for cgroup perms when opendir'ing /cgroup
Serge Hallyn [Mon, 6 Apr 2015 22:24:11 +0000 (17:24 -0500)]
don't check for cgroup perms when opendir'ing /cgroup

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoadd a file_info cache pointer for procfile reads
Serge Hallyn [Mon, 6 Apr 2015 22:11:39 +0000 (17:11 -0500)]
add a file_info cache pointer for procfile reads

This doesn't actually use them yet, but now fi->fh->buf can be
used in https://github.com/lxc/lxcfs/pull/18

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoadd cache types for each procfile type that we provide
Serge Hallyn [Mon, 6 Apr 2015 22:03:14 +0000 (17:03 -0500)]
add cache types for each procfile type that we provide

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocheck that file and dir entries don't get mixed up
Serge Hallyn [Mon, 6 Apr 2015 21:35:20 +0000 (16:35 -0500)]
check that file and dir entries don't get mixed up

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocache verified controller/cgroup info at cg file read/write
Serge Hallyn [Mon, 6 Apr 2015 21:30:54 +0000 (16:30 -0500)]
cache verified controller/cgroup info at cg file read/write

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocache opendir work and re-use it at readdir
Serge Hallyn [Mon, 6 Apr 2015 21:13:54 +0000 (16:13 -0500)]
cache opendir work and re-use it at readdir

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agorelease 0.7 lxcfs-0.7
Serge Hallyn [Fri, 3 Apr 2015 20:09:09 +0000 (15:09 -0500)]
release 0.7

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agobe robust to glibc fork failures
Serge Hallyn [Fri, 3 Apr 2015 18:25:57 +0000 (13:25 -0500)]
be robust to glibc fork failures

kill child and retry when __glibc_fork() child hangs on an assert
(newpid != ppid) failure.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agotimeout the reception of a scm_cred
Serge Hallyn [Fri, 3 Apr 2015 01:44:39 +0000 (20:44 -0500)]
timeout the reception of a scm_cred

Else if the peer is killed at a strange time we will hang forever waiting.

Also don't kill children - always just let them time out

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agonih_local's must be initialized as NULL
Serge Hallyn [Fri, 3 Apr 2015 01:28:58 +0000 (20:28 -0500)]
nih_local's must be initialized as NULL

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #16 from hustcat/diskstats
Serge Hallyn [Wed, 18 Mar 2015 14:59:02 +0000 (09:59 -0500)]
Merge pull request #16 from hustcat/diskstats

Add /proc/diskstats

9 years agoAdd /proc/diskstats
Ye Yin [Wed, 11 Mar 2015 08:33:08 +0000 (16:33 +0800)]
Add /proc/diskstats
Signed-off-by: Ye Yin <eyniy@qq.com>
9 years agoMerge pull request #15 from steelbrain/master
Serge Hallyn [Wed, 25 Feb 2015 05:00:27 +0000 (23:00 -0600)]
Merge pull request #15 from steelbrain/master

Fix formatting of README

9 years agoFix formatting of README
steelbrain [Wed, 25 Feb 2015 04:49:57 +0000 (23:49 -0500)]
Fix formatting of README
Signed-off-by: Anees Iqbal <aneesiqbalbhatti@gmail.com>
9 years agoFix test_proc following the stat fix
Stéphane Graber [Tue, 17 Feb 2015 04:42:33 +0000 (23:42 -0500)]
Fix test_proc following the stat fix

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRelease LXCFS 0.6 lxcfs-0.6
Serge Hallyn [Tue, 17 Feb 2015 03:56:10 +0000 (21:56 -0600)]
Release LXCFS 0.6

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoShow cpu-average in /proc/stat and start cup numbering at 0
Christian Brauner [Tue, 17 Feb 2015 01:41:54 +0000 (19:41 -0600)]
Show cpu-average in /proc/stat and start cup numbering at 0

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoclean up after several functions
Serge Hallyn [Mon, 16 Feb 2015 22:33:53 +0000 (16:33 -0600)]
clean up after several functions

which weren't freeing line of closing an open file.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoUpdate README
Stéphane Graber [Sat, 31 Jan 2015 12:47:45 +0000 (13:47 +0100)]
Update README

Close #10

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRelease LXCFS 0.5 lxcfs-0.5
Stéphane Graber [Wed, 28 Jan 2015 14:45:54 +0000 (15:45 +0100)]
Release LXCFS 0.5

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agohook: Don't spam /etc/mtab
Stéphane Graber [Wed, 28 Jan 2015 14:35:06 +0000 (15:35 +0100)]
hook: Don't spam /etc/mtab

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMake the LXC hook more robust
Stéphane Graber [Wed, 28 Jan 2015 09:07:05 +0000 (10:07 +0100)]
Make the LXC hook more robust

Don't fail if /sys/fs/cgroup or some proc files don't exist.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUpdate gitignore
Stéphane Graber [Tue, 27 Jan 2015 05:37:53 +0000 (05:37 +0000)]
Update gitignore

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoBetter detect the cgmanager version
Stéphane Graber [Mon, 26 Jan 2015 22:07:21 +0000 (17:07 -0500)]
Better detect the cgmanager version

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRelease LXCFS 0.4 lxcfs-0.4
Stéphane Graber [Fri, 23 Jan 2015 18:45:52 +0000 (13:45 -0500)]
Release LXCFS 0.4

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRemount / recursive ms-slave in our new mntns
Stéphane Graber [Fri, 23 Jan 2015 18:44:38 +0000 (13:44 -0500)]
Remount / recursive ms-slave in our new mntns

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRevert "remount / ms-slave"
Stéphane Graber [Fri, 23 Jan 2015 18:44:12 +0000 (13:44 -0500)]
Revert "remount / ms-slave"

This will affect the hostns, let's go with my implementation instead :)

This reverts commit 1ff1e28c04267064c73c5b968d31f6e5f2e1f3fa.

9 years agoremount / ms-slave
Serge Hallyn [Fri, 23 Jan 2015 18:38:42 +0000 (12:38 -0600)]
remount / ms-slave

to avoid propagating proc mounts from get_pid1_time() back to host

Signed-ff-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoRelease LXCFS 0.3 lxcfs-0.3
Stéphane Graber [Wed, 21 Jan 2015 16:15:11 +0000 (11:15 -0500)]
Release LXCFS 0.3

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFix LXC config install path
Stéphane Graber [Wed, 21 Jan 2015 06:14:40 +0000 (01:14 -0500)]
Fix LXC config install path

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRelease LXCFS 0.2 lxcfs-0.2
Stéphane Graber [Tue, 20 Jan 2015 19:48:01 +0000 (14:48 -0500)]
Release LXCFS 0.2

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUpdate the lxc hook and add a LXC config file
Stéphane Graber [Tue, 20 Jan 2015 18:07:06 +0000 (13:07 -0500)]
Update the lxc hook and add a LXC config file

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agotests: Fix return value
Stéphane Graber [Mon, 12 Jan 2015 18:16:19 +0000 (13:16 -0500)]
tests: Fix return value

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRelease LXCFS 0.1 lxcfs-0.1
Stéphane Graber [Fri, 9 Jan 2015 23:59:34 +0000 (18:59 -0500)]
Release LXCFS 0.1

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoFix autotools
Stéphane Graber [Fri, 9 Jan 2015 23:58:15 +0000 (18:58 -0500)]
Fix autotools

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agotest: Introduce a basic cgroup tree test
Stéphane Graber [Fri, 9 Jan 2015 21:49:13 +0000 (16:49 -0500)]
test: Introduce a basic cgroup tree test

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agotest: Introduce a basic proc tree test
Stéphane Graber [Fri, 9 Jan 2015 21:29:22 +0000 (16:29 -0500)]
test: Introduce a basic proc tree test

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoupdate docs
Serge Hallyn [Thu, 8 Jan 2015 22:29:11 +0000 (16:29 -0600)]
update docs

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoadd lxcfs container hook and comment
Serge Hallyn [Thu, 8 Jan 2015 22:01:28 +0000 (16:01 -0600)]
add lxcfs container hook and comment

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agowrite: make sure to null terminate the buffer
Serge Hallyn [Thu, 8 Jan 2015 15:59:54 +0000 (09:59 -0600)]
write: make sure to null terminate the buffer

We are passed a size, respect it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoAdd some more missing newlines
Stéphane Graber [Thu, 8 Jan 2015 15:45:39 +0000 (10:45 -0500)]
Add some more missing newlines

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agofix up pid conversion algorithm
Serge Hallyn [Wed, 7 Jan 2015 21:54:39 +0000 (15:54 -0600)]
fix up pid conversion algorithm

Mainly when the pid conversion task gets a ESRCH from sendmsg,
then it should send send the next message (with v='1' meaning
error) without first waiting for a ping from its peer, since
the peer already sent one and has gotten no response.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoUpdate README
Stéphane Graber [Sat, 27 Dec 2014 10:37:00 +0000 (11:37 +0100)]
Update README

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAdd some more information to error messages
Stéphane Graber [Sat, 27 Dec 2014 10:27:27 +0000 (11:27 +0100)]
Add some more information to error messages

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoconvert pids at write to tasks and cgroup.procs files
Serge Hallyn [Sat, 27 Dec 2014 04:26:05 +0000 (22:26 -0600)]
convert pids at write to tasks and cgroup.procs files

we're not yet distinguishing between thread vs threadgroup moving.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge branch 'readtasks.pass.creds.2' into m.2
Serge Hallyn [Sat, 27 Dec 2014 03:09:14 +0000 (21:09 -0600)]
Merge branch 'readtasks.pass.creds.2' into m.2

9 years agoread: translate pids into the reader's pidns
Serge Hallyn [Fri, 26 Dec 2014 04:48:43 +0000 (22:48 -0600)]
read: translate pids into the reader's pidns

When reading a cgroupfs 'tasks' or 'cgroup.procs' file, we must translate
all pids from our namespace into the reader's.

TODO - convert writes

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoAdd missing line breaks
Stéphane Graber [Thu, 25 Dec 2014 21:13:45 +0000 (22:13 +0100)]
Add missing line breaks

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoimplement read of /proc/uptime
Serge Hallyn [Fri, 19 Dec 2014 03:48:30 +0000 (21:48 -0600)]
implement read of /proc/uptime

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoadd comment describing how we'll do uptime
Serge Hallyn [Thu, 18 Dec 2014 04:39:08 +0000 (22:39 -0600)]
add comment describing how we'll do uptime

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement read for meminfo
Serge Hallyn [Thu, 18 Dec 2014 04:26:20 +0000 (22:26 -0600)]
implement read for meminfo

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement read for /proc/stat
Serge Hallyn [Wed, 17 Dec 2014 21:04:17 +0000 (15:04 -0600)]
implement read for /proc/stat

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agomove comment about caching open results
Serge Hallyn [Wed, 17 Dec 2014 18:42:23 +0000 (12:42 -0600)]
move comment about caching open results

hoping to implement this soon

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement cat of proc/cpuinfo
Serge Hallyn [Wed, 17 Dec 2014 18:22:15 +0000 (12:22 -0600)]
implement cat of proc/cpuinfo

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoadd boilerplate for the /proc file readdir+reads.
Serge Hallyn [Wed, 17 Dec 2014 06:34:45 +0000 (00:34 -0600)]
add boilerplate for the /proc file readdir+reads.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocheck for permission at opendir
Serge Hallyn [Tue, 16 Dec 2014 20:30:33 +0000 (14:30 -0600)]
check for permission at opendir

So we don't surprise the caller at readdir

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agofix some error codes
Serge Hallyn [Tue, 16 Dec 2014 20:25:56 +0000 (14:25 -0600)]
fix some error codes

userspace is looking for EACCES not EPERM for common perm deny.
Also return einval for bad names, not eio.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agodon't try to build lxcfs.1 if help2man is not available
Serge Hallyn [Tue, 16 Dec 2014 19:58:19 +0000 (13:58 -0600)]
don't try to build lxcfs.1 if help2man is not available

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoremove stmt in lxcfs.c
Serge Hallyn [Tue, 16 Dec 2014 19:26:34 +0000 (13:26 -0600)]
remove stmt in lxcfs.c

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoHide cgroups not under caller's own cgroup
Serge Hallyn [Tue, 16 Dec 2014 17:20:17 +0000 (11:20 -0600)]
Hide cgroups not under caller's own cgroup

For a directory, we show an empty directory.  For any attempt to getattr
a file, we return -ENOENT.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement chmod
Serge Hallyn [Tue, 16 Dec 2014 01:17:12 +0000 (19:17 -0600)]
implement chmod

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoremove some debug output
Serge Hallyn [Mon, 15 Dec 2014 23:55:53 +0000 (17:55 -0600)]
remove some debug output

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement rmdir
Serge Hallyn [Mon, 15 Dec 2014 23:51:17 +0000 (17:51 -0600)]
implement rmdir

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoImplement chown
Serge Hallyn [Mon, 15 Dec 2014 23:23:55 +0000 (17:23 -0600)]
Implement chown

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoimplement write
Serge Hallyn [Mon, 15 Dec 2014 18:45:27 +0000 (12:45 -0600)]
implement write

Also fix the permission checking function.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoImplement mkdir
Serge Hallyn [Mon, 15 Dec 2014 02:21:03 +0000 (20:21 -0600)]
Implement mkdir

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoAdd support for file read
Serge Hallyn [Sat, 13 Dec 2014 04:27:20 +0000 (22:27 -0600)]
Add support for file read

To make 'cat /var/lib/lxcfs/cgroup/freezer/tasks' work, we also need for
getattr to actually give a file size.  So, do that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agogetattr: fill in ownership of cgroup dirs.
Serge Hallyn [Fri, 12 Dec 2014 21:44:20 +0000 (15:44 -0600)]
getattr: fill in ownership of cgroup dirs.

Also check for privilege in uid namespaces over file uids.

And remove some extra debugging printfs.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #1 from hallyn/serge.2
Stéphane Graber [Fri, 12 Dec 2014 19:37:37 +0000 (21:37 +0200)]
Merge pull request #1 from hallyn/serge.2

Implement basic getattr/readdir

9 years agoAdd base lxcfs.c
Serge Hallyn [Fri, 12 Dec 2014 18:53:10 +0000 (12:53 -0600)]
Add base lxcfs.c

So far it just does getattr and readdir for /cgroup/*

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoadd autoconf boilerplate and cgmanager fns
Serge Hallyn [Fri, 12 Dec 2014 18:47:20 +0000 (12:47 -0600)]
add autoconf boilerplate and cgmanager fns

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>