On Fri, 09.12.11 15:32, Jan Safranek (jsafr...@redhat.com) wrote:

> The cgconfig.service unit file should create all groups in
> /etc/cgconfig.conf and (if not overriden in the config file) with sticky
> bit on their tasks file. On service stop, only control groups specified in the
> config file are cleared and only if they are empty (i.e. no subgroups and no
> processes inside).
> 
> Please review carefully, especially the ordering. I want the service to
> start as early as possible, but not before local filesystem is ready.
> 
> Signed-off-by: Jan Safranek <jsafr...@redhat.com>
> ---
> 
>  dist/cgconfig.service |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
>  create mode 100644 dist/cgconfig.service
> 
> diff --git a/dist/cgconfig.service b/dist/cgconfig.service
> new file mode 100644
> index 0000000..0150609
> --- /dev/null
> +++ b/dist/cgconfig.service
> @@ -0,0 +1,12 @@
> +[Unit]
> +Description=Control Group configuration service
> +After=syslog.target

The After=syslog.target ordering is unnecessary these days. You should
be able to safely drop this.

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

Starting the cgroup structure during early boot has the advantage that
you can make use of it during early boot already, but otherwise is not
necessary. It's up to you when you want to start this service...

> +
> +[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

Otherwise looks good!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to