[systemd-devel] systemd-time
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Sun Sep 29 11:33:00 PDT 2013
On Sun, Sep 29, 2013 at 08:11:53PM +0200, Andi Kleen wrote:
>
> Hi,
>
> Is there a way to do the following in systemd?
>
> Run a program from the command line in a new cgroup container.
> After running output all the statistics accounted by cgroups,
> like CPU time, IO bytes, max memory usage etc.
>
> Essentially like time(1), just using cgroups: systemd-time.
> time does a lot of what I need, but not everything.
Not out of the box, no. In principle various parts are
there, but there's no single tool. If you use RemainAfterExit=yes,
and turn on memory, cpu, and bandwith accounting, you should be
able to query the usage after the unit is finished.
grawity posted some perl code to wait unitl a unit is finished:
http://sprunge.us/DDbY
Zbyszek
More information about the systemd-devel
mailing list