summaryrefslogtreecommitdiffstats
path: root/src/daemon
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup the infinite loop of cgrulesengddaemon.Ken'ichi Ohmichi2009-05-191-2/+3
| | | | | | | | | | | | | Hi, This patch clarifies the infinite loop. Thanks Ken'ichi Ohmichi Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* There is the problem that cgrulesengd cannot get Gid from /proc/PID/status,Masayuki Igawa2009-05-141-2/+0
| | | | | | | | | | | | | | | | because the function breaks just after getting Uid data: $ cat /proc/$$/status [snip] Uid: 500 500 500 500 Gid: 500 500 500 500 [snip] $ This patch fixes this problem. Signed-off-by: Masayuki Igawa <igawa@mxs.nes.nec.co.jp> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
* Changelog v2:\"Ken'ichi Ohmichi\2009-05-082-1/+105
| | | | | | | | | | | | | | | | | | | | | | | * Use clock_gettime(2) for getting timestamp since a system boot. * Change parent_info's memory to dynamic allocation. This patch is for changing the cgroup of a forked process while parent changing. This patch adds the following sequence: 1. Store both the timestamp and the process-id when changing the cgroup. 2. If receiving a PROC_EVENT_FORK packet, check its parent-pid and its timestamp. 3. If its parent-pid and the stored process-id are same and its timestamp is older than the stored timestamp, change the cgroup of forked process. Thanks Ken'ichi Ohmichi Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
* I have been testing a cgrulesengd daemon and I noticed it fails to\"Ken'ichi Ohmichi\2009-05-081-60/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | change the cgroup of child occasionally. I tested it by following configulation file: /etc/cgrules.conf: user01 cpuset group01/user01 % memory group01/user01 A cpuset subsystem and a memory subsystem are mounted on different mount points, and a cgrulesengd daemon manages each subsystem. I login this environment as a user "user01", and each susbystem's tasks file is the following: # cat /mnt/cgroups/cpuset/group01/user01/tasks 31801 31805 31806 # # cat /mnt/cgroups/memory/group01/user01/tasks 31801 31805 # # pstree -p 32105 sshd(31801)---sshd(31805)---bash(31806) # They should be the same, but they are different. I investigated this problem, and I found the cause. The reason is that the process(31806) was forked just after writing the process(31805) to a cpuset subsystem's tasks file: <1> The UID/GID CHANGE event of the process 31805 happens. <2> The daemon writes "31805" to a cpuset subsystem's tasks file. <3> The process 31806 is forked, and it appears on a cpuset subsystem's tasks file. <4> The daemon writes "31805" to a memory subsystem's tasks file. <5> The process 31806 does not appears on a memory subsystem's tasks file. For solving this problem, I propose the following sequence. 1. Store both the timestamp and the process-id when the step <4>. 2. If receiving a PROC_EVENT_FORK packet, check its parent-pid and its timestamp. 3. If its parent-pid and the stored process-id are same and its timestamp is older than the stored timestamp, change the cgroup of forked process. Changelog of v2: * Change only [PATCH 2/2] and there is not any changes in [PATCH 1/2]. This patch adds the method for getting euid/egid from /proc/<pid>/status file. For changing the cgroup of a forked process, the method is usefull because a PROC_EVENT_FORK packet does not inform of its euid and its egid. Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
* Merge branch 'master' of ↵Balbir Singh2009-04-211-1/+3
|\ | | | | | | ssh://balbir_singh@libcg.git.sourceforge.net/gitroot/libcg
| * Fix infinite loop if receiving a NLMSG_NOOP packet.Ken'ichi Ohmichi2009-04-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi, I tested 'cgred' service and I saw the problem that some processes are not moved to a right cgroup. This problem did not occur always, and it did sometimes. I reviewed cgrulesengd.c and found the bug cgrulesengd stays in an infinite loop if receiving a NLMSG_NOOP packet. This patch fixes this problem. Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
* | Remove autogenerated files and update documentation. More documentationBalbir Singh2009-04-011-470/+0
|/ | | | | | updates will be needed and will be done in subsequent cleanups. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
* Rework the way how so version is definedJan Safranek2009-03-261-3/+5
| | | | | | | | | Make the shared object version a bit more usable, the notation with double colons cannot be used on different places (see next patch). Also run automake && autoconf to refresh the generated stuff. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Generate everythingautomakeJan Safranek2009-03-261-0/+468
| | | | | | Finally run autoreconf -f -i to generate all the stuff that should be generated Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Add automake makefilesJan Safranek2009-03-261-0/+6
| | | | | | | | Add automake makefiles and prepare everything to run, but don't actually run the automake - it would generate lot of noise, where my manual changes would get lots. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Distribute files to various subdirectoriesJan Safranek2009-03-262-0/+920
Signed-off-by: Jan Safranek <jsafrane@redhat.com>