summaryrefslogtreecommitdiffstats
path: root/src/rspamd.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-20 16:11:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-22 10:57:29 +0100
commit390620fc357bfdb9e7f20835e3c61e857e3a5da2 (patch)
treec76cc7c463595da8053501c78d7f1db61e0985a1 /src/rspamd.h
parenteafdd221037b41ddcba0add79fd8efccecaf0775 (diff)
downloadrspamd-390620fc357bfdb9e7f20835e3c61e857e3a5da2.tar.gz
rspamd-390620fc357bfdb9e7f20835e3c61e857e3a5da2.zip
[Rework] Rework children operations
Diffstat (limited to 'src/rspamd.h')
-rw-r--r--src/rspamd.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rspamd.h b/src/rspamd.h
index e47271ca3..97e4c4c6a 100644
--- a/src/rspamd.h
+++ b/src/rspamd.h
@@ -69,6 +69,9 @@ struct rspamd_worker_accept_event {
struct rspamd_worker_accept_event *prev, *next;
};
+typedef void (*rspamd_worker_term_cb)(EV_P_ ev_child *, struct rspamd_main *,
+ struct rspamd_worker *);
+
/**
* Worker process structure
*/
@@ -95,6 +98,8 @@ struct rspamd_worker {
gpointer control_data; /**< used by control protocol to handle commands */
gpointer tmp_data; /**< used to avoid race condition to deal with control messages */
GPtrArray *finish_actions; /**< called when worker is terminated */
+ ev_child cld_ev; /**< to allow reaping */
+ rspamd_worker_term_cb term_handler; /**< custom term handler */
};
struct rspamd_abstract_worker_ctx {
@@ -280,6 +285,7 @@ struct rspamd_main {
uid_t workers_uid; /**< worker's uid running to */
gid_t workers_gid; /**< worker's gid running to */
gboolean is_privilleged; /**< true if run in privilleged mode */
+ gboolean wanna_die; /**< no respawn of processes */
gboolean cores_throttling; /**< turn off cores when limits are exceeded */
struct roll_history *history; /**< rolling history */
struct ev_loop *event_loop;