Skip to content

Commit

Permalink
Add the "pg update" svc action
Browse files Browse the repository at this point in the history
Which applies to cgroups changed values of pg_* keywords.

$ om test/svc/c1 pg update
$ om test/svc/c1 set --kw app#0.pg_mem_limit=100m
$ om test/svc/c1 pg update
@ n:aubergine o:test/svc/c1 r:app#0 sc:n
  /bin/echo 104857600 > /sys/fs/cgroup/memory/opensvc.slice/test.slice/c1.slice/app.slice/app.0.slice/memory.limit_in_bytes
  • Loading branch information
cvaroqui committed Sep 3, 2020
1 parent 4090938 commit 25dbca4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opensvc/commands/svc/parser.py
Expand Up @@ -576,6 +576,10 @@
"msg": "Kill the tasks of a process group.",
"options": mp.ACTION_OPTS,
},
"pg_update": {
"msg": "Update cappings of process groups to reflect configuration changes.",
"options": mp.ACTION_OPTS,
},
}
ACTIONS.update({
"Compliance": {
Expand Down
4 changes: 4 additions & 0 deletions opensvc/core/objects/svc.py
Expand Up @@ -364,6 +364,7 @@ def signal_handler(*args):
ACTIONS_DO_MASTER_AND_SLAVE = [
"boot",
"migrate",
"pg_update",
"provision",
"prstart",
"prstop",
Expand Down Expand Up @@ -3921,6 +3922,9 @@ def pg_remove(self):
def pg_pids(self):
return sorted(self.pg.pids(self))

def pg_update(self):
self.sub_set_action(START_GROUPS, "create_pg", xtags=set(["zone", "docker", "podman"]))

@lazy
def pg(self):
"""
Expand Down

0 comments on commit 25dbca4

Please sign in to comment.