[systemd-devel] [PATCH 2/2] Libcgroup: added cgconfig.service unit for systemd.

Jan Safranek jsafrane at redhat.com
Tue Dec 13 04:06:43 PST 2011


On 12/13/2011 12:46 PM, Lennart Poettering wrote:
> On Fri, 09.12.11 15:32, Jan Safranek (jsafrane at redhat.com) wrote:

<snip>

> Note that this will set up the cgroup structure only during late boot,
> which should be fine for most cases. However, in some cases it might
> make sense to initialize this due to early boot (for example, to handle
> early-boot service, like udev).if you care for those add lines like
> the following:
> 
> DefaultDependencies=no
> Conflicts=shutdown.target
> Before=basic.target shutdown.target

I expect that the services that needs cgroups would have
"After=cgconfig.service" and systemd will start cgconfig before any of
them, regardless how early in the boot it is. In the end I might not
need any After/Before in cgconfig.conf at all. Of course, admin must add
this "After=cgconfig.service" manually to all dependent services, but he
already needs to add "ControlGroup=..." there.

I would end up with this simple service in the end:

[Unit]
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/cgconfigparser -l /etc/cgconfig.conf -s 1664
ExecStop=/sbin/cgclear -l /etc/cgconfig.conf -e

[Install]
WantedBy=sysinit.target


Could this work?

Jan


More information about the systemd-devel mailing list