mirror of
https://github.com/troglobit/finit.git
synced 2026-10-29 12:40:44 +00:00
Add support for configuring cgroups and their settings on services
This patch adds support for modifying settings for the default cgroups;
init, user, and system, as well as adding up to a total of eight groups
for the system.
Services can now be assigned to a cgroup, with optional extra settings
for that particular process group. The syntax is slightly contrivied
but follows the overall Finit syntax of prop:value,prop':value', e.g.
cgroup maint cpu.weight:123,mem.max:10000
Starting with the introduction of rlimits, a group of services sharing
the same .conf file can share the same (locally "global") rlimits, and
now also the same cgroup, e.g.
cgroup.maint
service foo
service bar cgroup:mem.max:1000
This puts foo and bar in the same top-level cgroup 'maint', with an
extra memory restriction on bar for max 1000 bytes memory.
NOTE: 'mem.' is a Finit extension, a shorthand for cgroups2 'memory.'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
9e6e653c57
commit
665d212bd6
8 files changed
+282
-28
No files matched your search
@@ -24,16 +24,22 @@
|
||||
#ifndef FINIT_CONF_H_
|
||||
#define FINIT_CONF_H_
|
||||
|
||||
#include "cgroup.h"
|
||||
#include "svc.h"
|
||||
|
||||
extern int logfile_size_max;
|
||||
extern int logfile_count_max;
|
||||
|
||||
extern struct rlimit global_rlimit[];
|
||||
extern struct cgroup cgroups[];
|
||||
extern size_t cgroup_num;
|
||||
extern char cgroup_current[];
|
||||
|
||||
int str2rlim(char *str);
|
||||
char *rlim2str(int rlim);
|
||||
|
||||
struct cgroup *conf_cgfind(char *name);
|
||||
|
||||
int conf_init (uev_ctx_t *ctx);
|
||||
void conf_reload (void);
|
||||
int conf_any_change (void);
|
||||
|
||||
Reference in new issue
Block a user