summaryrefslogtreecommitdiff
path: root/uxc.c
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-07-24 01:28:10 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-07-25 00:51:59 +0100
commit772292e0a37f42e9c6b3fdbe4d9f8e675db5d1d4 (patch)
treec7dfd2357381b7d0508bf6aa579a1931557f6208 /uxc.c
parent9bd1b7f0951ec2bcf56674fa729af3872b276057 (diff)
downloadprocd-772292e0a37f42e9c6b3fdbe4d9f8e675db5d1d4.tar.gz
uxc: don't restart containers when mount shows up
procd triggers 'uxc boot' every time a new mount shows up which results in containers to be restarted which had already been run and may have ended reguarly, crashed or deliberately stopped. As the intention of 'uxc boot' is to start containers which were still waiting for volumes to become ready, really do only that. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'uxc.c')
-rw-r--r--uxc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/uxc.c b/uxc.c
index d1afc4c..b801d7f 100644
--- a/uxc.c
+++ b/uxc.c
@@ -742,6 +742,7 @@ static void block_cb(struct ubus_request *req, int type, struct blob_attr *msg)
static int uxc_boot(void)
{
struct blob_attr *cur, *tb[__CONF_MAX];
+ struct runtime_state *s;
int rem, ret = 0;
char *name;
unsigned int id;
@@ -759,6 +760,10 @@ static int uxc_boot(void)
if (!tb[CONF_NAME] || !tb[CONF_PATH] || !tb[CONF_AUTOSTART] || !blobmsg_get_bool(tb[CONF_AUTOSTART]))
continue;
+ s = avl_find_element(&runtime, blobmsg_get_string(tb[CONF_NAME]), s, avl);
+ if (s)
+ continue;
+
/* make sure all volumes are ready before starting */
if (tb[CONF_VOLUMES])
if (checkvolumes(tb[CONF_VOLUMES]))