[systemd-devel] F15: wrong cgroup?

Kay Sievers kay.sievers at vrfy.org
Wed Jul 6 05:28:41 PDT 2011


2011/7/6 Michał Piotrowski <mkkp4x4 at gmail.com>:
> I use sudo to start my deamons.
>
> $ ps xawf -eo pid,user,cgroup,args
>
> show that daemons are in my personal cgroups /sys/fs/cgroup/systemd/user/michal
>
>  1483 root     name=systemd:/user/michal/4 python daemon_foo1

> If I'm using sudo why daemons are binded to my personal cgroups not root?

Because your daemon inherits all process properties from your login
shell, including the cgroup of your user. Systemd doesn't do that for
daemons/services, it starts all services as children in a clean and
proeprly prepared environment of pid 1.

If you want a proper cgroup, you need to create service files for you
daemons and tell systemd to start the service on your behalf, instead
of forking them yourself.

Kay


More information about the systemd-devel mailing list