Fix #143: redesign condition subsystem

Change service conditions from the non-obvious <svc/path/to/foo> to
<pid/foo:id>, utilizing the unique name of the service instead of the
weird composition of paths from /run and PID file names.  Hopefully
making it more clear that one service's pidfile is another service's
`<pid/foo>` condition.

Note: this is an incompatible change to the condition system!
      The Finit major version will be stepped to indicate this.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-02-11 07:58:06 +01:00
1 parent 3e9c170e6b
commit d1fac6f5b3
3 files changed
+34 -71

No files matched your search

+5 -4
View File
@@ -237,10 +237,11 @@ void conf_parse_cond(svc_t *svc, char *cond)
}
if (!strncmp(ptr, "svc/", 4)) {
snprintf(svc->cond, sizeof(svc->cond), "pid/%s", &ptr[4]);
logit(LOG_INFO, "Migrating cond syntax of %s: %s -> %s", svc->cmd, ptr, svc->cond);
} else
strlcpy(svc->cond, ptr, sizeof(svc->cond));
logit(LOG_ERR, "Unsupported cond syntax for %s: <%s", svc->cmd, ptr);
return;
}
strlcpy(svc->cond, ptr, sizeof(svc->cond));
}
struct rlimit_name {