On Thu, Jun 21, 2012 at 12:31 AM, John Fastabend <john.r.fastab...@intel.com> wrote: > On 6/20/2012 11:15 AM, Balbir Singh wrote: >> >> On Wed, Jun 20, 2012 at 10:44 PM, John Fastabend >> <john.r.fastab...@intel.com> wrote: >>> >>> Add routine to scan rules.conf file and move matching running tasks >>> in /proc/pid/* into configured control groups. >>> >>> Without this adding control group after cgrulesengd has started >>> does not work correctly and processes running before cgrulesengd >>> is started are not managed. >>> >> >> Those processes are managed, they are either in /sysdefault or / >> groups. I am afraid, I don't understand the problem mentioned, could >> you please elaborate? >> >> Balbir >> > > Sure. > > I have a rule in cgrules.conf for example, > > *:ping net_prio ping > > I have two problems that I am trying to resolve. First if ping is > started before cgrulesengd it does not get moved into ping/tasks.
Yep, cgrulesengd should be up and running at startup, you can also later do a cgclassify > I guess I could resolve this by always starting cgrulesengd first > but I would prefer not to have this as a requirement. It also > proves troublesome at boot time where some processes may be > running from initrd. Think remote install/boot over the network. > > #ping host1& > #cgrulesengd <-- ping is not moved into ping/tasks > OK > The other problem is if the 'ping' directory has not been created > yet. The creation of the ping group is dependent on an external event. > I could create the directory upfront but I don't want to do this > because I would prefer the program actually stays in the default > tasks list until the external event occurs. Because I create > groups and remove groups dynamically its easier in my opinion > to just let cgrulesengd scan the proc list and match any running > processes. > > #cgrulesengd > #ping host1& <-- launch process > #mkdir ping <-- external event triggers this > > I suppose my external application could link libcg and manage this > directly but this doesn't make sense IMHO when cgrulesengd already > does a good job of this for most cases. > > Specifically I'm enabling 'cgdcbxd' to work with net_prio and > the external event is from DCBX (a TLV in LLDP) which maps well > known port numbers to priorities. I don't know which applications > will be negotiated or what the priority will be ahead of time. > > So if you wanted to your httpd server to use the negotiated > priority if/when the negotiation occurs I use a rule like this, > > *:httpd net_prio dcb-1-80 > > Where '1-80' is TCP/UDP socket on port 80 and cgdcbxd creates > the 'dcb-1-80' directory when/if it is negotiated successfully. > > https://github.com/jrfastab/cgdcbxd > Yep, quite a bit, Thanks! Balbir ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel