]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Libcgroup: added cgconfig.service unit for systemd.
authorJan Safranek <jsafrane@redhat.com>
Thu, 15 Dec 2011 13:55:51 +0000 (14:55 +0100)
committerJan Safranek <jsafrane@redhat.com>
Fri, 16 Dec 2011 12:51:41 +0000 (13:51 +0100)
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.

Changelog:
 - updated After/Before dependencies

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
dist/cgconfig.service [new file with mode: 0644]

diff --git a/dist/cgconfig.service b/dist/cgconfig.service
new file mode 100644 (file)
index 0000000..e63f26d
--- /dev/null
@@ -0,0 +1,17 @@
+[Unit]
+Description=Control Group configuration service
+
+# The service should be able to start as soon as possible,
+# before any 'normal' services:
+DefaultDependencies=no
+Conflicts=shutdown.target
+Before=basic.target shutdown.target
+
+[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