Introduce a new optional property "reload_signal" which - if set - instructs
procd to not terminate and restart supervised processes upon changes, but to
send them a kill() signal instead.
This is useful for services which fully support native config reload upon
receipt of a signal.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
INSTANCE_ATTR_TRACE,
INSTANCE_ATTR_SECCOMP,
INSTANCE_ATTR_PIDFILE,
INSTANCE_ATTR_TRACE,
INSTANCE_ATTR_SECCOMP,
INSTANCE_ATTR_PIDFILE,
+ INSTANCE_ATTR_RELOADSIG,
[INSTANCE_ATTR_TRACE] = { "trace", BLOBMSG_TYPE_BOOL },
[INSTANCE_ATTR_SECCOMP] = { "seccomp", BLOBMSG_TYPE_STRING },
[INSTANCE_ATTR_PIDFILE] = { "pidfile", BLOBMSG_TYPE_STRING },
[INSTANCE_ATTR_TRACE] = { "trace", BLOBMSG_TYPE_BOOL },
[INSTANCE_ATTR_SECCOMP] = { "seccomp", BLOBMSG_TYPE_STRING },
[INSTANCE_ATTR_PIDFILE] = { "pidfile", BLOBMSG_TYPE_STRING },
+ [INSTANCE_ATTR_RELOADSIG] = { "reload_signal", BLOBMSG_TYPE_INT32 },
{
if (!in->proc.pending)
return;
{
if (!in->proc.pending)
return;
+
+ if (in->reload_signal) {
+ kill(in->proc.pid, in->reload_signal);
+ return;
+ }
+
in->halt = false;
in->restart = true;
kill(in->proc.pid, SIGTERM);
in->halt = false;
in->restart = true;
kill(in->proc.pid, SIGTERM);
+ if (tb[INSTANCE_ATTR_RELOADSIG])
+ in->reload_signal = blobmsg_get_u32(tb[INSTANCE_ATTR_RELOADSIG]);
+
if (!in->trace && tb[INSTANCE_ATTR_JAIL])
in->has_jail = instance_jail_parse(in, tb[INSTANCE_ATTR_JAIL]);
if (!in->trace && tb[INSTANCE_ATTR_JAIL])
in->has_jail = instance_jail_parse(in, tb[INSTANCE_ATTR_JAIL]);
blobmsg_close_table(b, e);
}
blobmsg_close_table(b, e);
}
+ if (in->reload_signal)
+ blobmsg_add_u32(b, "reload_signal", in->reload_signal);
+
if (in->respawn) {
void *r = blobmsg_open_table(b, "respawn");
blobmsg_add_u32(b, "threshold", in->respawn_threshold);
if (in->respawn) {
void *r = blobmsg_open_table(b, "respawn");
blobmsg_add_u32(b, "threshold", in->respawn_threshold);
bool restart;
bool respawn;
int respawn_count;
bool restart;
bool respawn;
int respawn_count;
struct timespec start;
bool trace;
struct timespec start;
bool trace;