.I mount
and
.I group
-sections. These sections can be in arbitrary order. Any line starting
-with '#' is considered a comment line and is ignored.
+sections. These sections can be in arbitrary order and both are optional.
+Any line starting with '#' is considered a comment line and is ignored.
.LP
.I mount
section has this form:
automatically on cgconfig service startup if it does not exist and
is deleted on service shutdown.
.LP
+
+If no
+.I mount
+section is specified, no controllers are mounted.
+
.I group
section has this form:
.RS
and other special characters.
.RE
+If no
+.I group
+section is specified, no groups are created.
+
.\"********************************************"
.SH EXAMPLES
.LP
mount_enabled = (config_mount_table[0].name[0] != '\0');
/*
- * The configuration should have either namespace or mount.
- * Not both and not none.
+ * The configuration should have namespace or mount, not both.
*/
- if (namespace_enabled == mount_enabled) {
+ if (namespace_enabled && mount_enabled) {
free(config_cgroup_table);
return ECGMOUNTNAMESPACE;
}
- /*
- * We do not allow both mount and namespace sections in the
- * same configuration file. So test for that
- */
-
error = cgroup_config_mount_fs();
if (error)
goto err_mnt;
error = cgroup_init();
+ if (error == ECGROUPNOTMOUNTED && cgroup_table_index == 0) {
+ /*
+ * The config file seems to be empty.
+ */
+ error = 0;
+ goto err_mnt;
+ }
if (error)
goto err_mnt;