int stop;
bool enabled;
bool running;
+ bool use_procd;
} entry;
};
if (c->entry.stop >= 0)
blobmsg_add_u16(c->buf, "stop", c->entry.stop);
blobmsg_add_u8(c->buf, "enabled", c->entry.enabled);
- blobmsg_add_u8(c->buf, "running", c->entry.running);
+ if (c->entry.use_procd)
+ blobmsg_add_u8(c->buf, "running", c->entry.running);
blobmsg_close_table(c->buf, e);
}
case -1:
return -errno;
case 0:
+ if (!c->entry.use_procd)
+ exit(-EOPNOTSUPP);
+
/* Set stdin, stdout & stderr to /dev/null */
fd = open("/dev/null", O_RDWR);
if (fd >= 0) {
int count = 0;
beginning = true;
- while ((c->entry.start < 0 || c->entry.stop < 0) &&
+ while ((c->entry.start < 0 || c->entry.stop < 0 || !c->entry.use_procd) &&
count <= 10 && fgets(line, sizeof(line), fp)) {
if (beginning) {
if (!strncmp(line, "START=", 6)) {
c->entry.start = strtoul(line + 6, NULL, 0);
} else if (!strncmp(line, "STOP=", 5)) {
c->entry.stop = strtoul(line + 5, NULL, 0);
+ } else if (!c->skip_running_check && !strncmp(line, "USE_PROCD=", 10)) {
+ c->entry.use_procd = !!strtoul(line + 10, NULL, 0);
}
count++;
}