[systemd-devel] Getting the exit code of a process under a scope

2016-08-02 Thread Mrunal Patel
Is there a way to get the exit code of a process run under a systemd scope
using systemd dbus API?

Thanks,
Mrunal
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] cpu quota reset to -1?

2016-04-25 Thread Mrunal Patel
We are using systemd scopes in docker on RHEL.
As per advice on this list, we added Delegate=true to those scopes as we
are managing the cgroups under the scopes in custom code.

One thing that we are seeing is sometimes the value in cpu.cfs_period_us is
seemingly reset to -1 even though we write a non-zero value to that file.

I am trying to figure out if systemd is overwriting the value. Is that
possible? Or should I be looking at some other race?

Thanks,
Mrunal
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Issues with docker systemd cgroups integration

2016-03-15 Thread Mrunal Patel
On Tue, Mar 15, 2016 at 10:01 AM, Michal Sekletar <msekl...@redhat.com>
wrote:

> On Tue, Mar 15, 2016 at 5:42 PM, Mrunal Patel <mpa...@redhat.com> wrote:
> >
> >
> >
> >> >
> >> > docker.io did that too three weeks ago:
> >> >
> >> >   https://github.com/docker/docker/commit/65820132
> >>
> >> This seems odd. I thought you primarily want to enable delegation for
> >> scope units wrapping processes which constitute your container and not
> >> for the container manager itself. For example, on Fedora 23
> >> libvirtd.service doesn't have Delegate=yes. However libvirtd registers
> >> VMs as machines in machined. And machined will take care for creating
> >> scope unit and it also sets Delegate=yes for the scope.
> >>
> > Yes, this is the model we have. So, it looks like we should set
> Delegate=yes
> > for the scope. Last time I tried, I got some errors from the API.
> > I will try again and respond back on this thread.
>
> You can have a look at our C implementation and re-implement it in Go.
>
>
> https://github.com/systemd/systemd/blob/master/src/machine/machined-dbus.c#L1277
>
> Thanks Michal,
I created a patch setting Delegate to true and it seems to be working. We
will need to see how the new version behaves on Openshift builds where this
problem was originally reported.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Issues with docker systemd cgroups integration

2016-03-15 Thread Mrunal Patel
>
> > docker.io did that too three weeks ago:
> >
> >   https://github.com/docker/docker/commit/65820132
>
> This seems odd. I thought you primarily want to enable delegation for
> scope units wrapping processes which constitute your container and not
> for the container manager itself. For example, on Fedora 23
> libvirtd.service doesn't have Delegate=yes. However libvirtd registers
> VMs as machines in machined. And machined will take care for creating
> scope unit and it also sets Delegate=yes for the scope.
>
> Yes, this is the model we have. So, it looks like we should set
Delegate=yes for the scope. Last time I tried, I got some errors from the
API.
I will try again and respond back on this thread.

Thanks,
Mrunal
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Issues with docker systemd cgroups integration

2016-03-15 Thread Mrunal Patel
On Tue, Mar 15, 2016 at 8:56 AM, Martin Pitt  wrote:

> Michal Sekletar [2016-03-15 16:06 +0100]:
> > We had similar problem in the past with libvirtd and it got solved by
> > introducing Delegate option (man systemd.resource-control).
>
> docker.io did that too three weeks ago:
>
>   https://github.com/docker/docker/commit/65820132
>
> There are two cgroups implementations in docker. One is directly managed
using the fs and other that I am talking about uses dbus to create a
transient scope.
The docker PR set Delegate=yes for the first implementation.

However, from Michal's advise it looks like we should be setting
Delegate=yes for the scope and not the daemon.

> Martin
> --
> Martin Pitt| http://www.piware.de
> Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Issues with docker systemd cgroups integration

2016-03-15 Thread Mrunal Patel
>
> >> 2. cpu.proc file itself goes missing especitally with the devices
> >> subsystemd even thought we mkdir the directory and write to the file.
> It is
> >> as if the file gets deleted by some other process.
>
> We had similar problem in the past with libvirtd and it got solved by
> introducing Delegate option (man systemd.resource-control). Setting
> Delegate=yes for unit will cause that cgroup hierarchy for this unit
> will be created in all controllers. Then you can manage cgroup
> settings for controllers not managed by systemd.
>
> I think this should work for us. How do we enable this for transient
units? Just pass Delegate=yes as a property?

> Michal
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel