On Wed, 2011-08-24 at 11:19 -0300, Gustavo Sverzut Barbieri wrote: On Wed, Aug 24, 2011 at 10:42 AM, Lennart Poettering > <lenn...@poettering.net> wrote: > > On Tue, 02.08.11 15:51, Daniel Wagner (w...@monom.org) wrote: > > > >> So my thinking is, instead of using the uid driver trick, I could use > >> cgroups for collecting the network traffic. At least from the sub module > >> description it seems to be the right spot to add a new statistic > >> interface. > > > > Yupp, that makes a lot of sense I'd say. For CPU accounting there's > > already cpuacct. Adding a netacct cgroup controller would make a lot of > > sense to me. (a hackish way to achieve this with existing tools might be > > to use net_cls for this or so. dunno, might already be enough if ip > > rules allows accounting.) > > > >> A open question is how I get the whole thing persistent. So not each > >> time when an application starts the counters begin at 0. My guts feeling > >> systemd should take of this but I don't know if that is the right > >> direction. > > > > Hmm, you could simply precreate the cgroups and mark the tasks file with > > +t (sticky bit). systemd won't remove the cgroup then after use. Or, we > > could add a new switch "ControlGroupPersistant=yes" or so which would > > set +t automatically but systemd would still create the groups for you > > (so that youdon't have to pre-create anything), but not delete them > > anymore. Would that make sense? > > > > (I have added this option now to the todo list, since it will make sense > > for stuff like cpuacct where we are in the same boat) > > Likely he will need to keep accounting between reboots as well, in > this case the solution can't be in systemd or kernel, will need a tool > to walk these groups accumulate them into a persistent media. Be it > periodically, upon reboot or some other method. >
ControlGroupPersistant=yes for persistent runtime only statistics ControlGroupPersistent=/<filename> for persistent disk-backed statistics? Would this be at all feasible? if the string is not "yes"/"no" string variations, checking it for being a valid pathname and using it as an on-disk store of statistics? Feasible?
signature.asc
Description: This is a digitally signed message part
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel