Mercurial > dovecot > core-2.2
annotate src/master/service-anvil.h @ 23017:c1d36f2575c7 default tip
lib-imap: Fix "Don't accept strings with NULs" cherry-pick
author | Timo Sirainen <timo.sirainen@open-xchange.com> |
---|---|
date | Thu, 29 Aug 2019 09:55:25 +0300 |
parents | 926a7ceeaa10 |
children |
rev | line source |
---|---|
9235
2e2b957f1cca
Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
1 #ifndef SERVICE_ANVIL_H |
2e2b957f1cca
Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
2 #define SERVICE_ANVIL_H |
2e2b957f1cca
Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
3 |
10200
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
4 struct service_anvil_global { |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
5 pid_t pid; |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
6 unsigned int uid; |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
7 |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
8 int status_fd[2]; |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
9 /* passed to child processes */ |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
10 int blocking_fd[2]; |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
11 /* used by master process to notify about dying processes */ |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
12 int nonblocking_fd[2]; |
10454
802b9ebe79e6
anvil: After master gets a SIGHUP, start logging via new log process.
Timo Sirainen <tss@iki.fi>
parents:
10200
diff
changeset
|
13 /* master process sends new log fds to anvil via this unix socket */ |
802b9ebe79e6
anvil: After master gets a SIGHUP, start logging via new log process.
Timo Sirainen <tss@iki.fi>
parents:
10200
diff
changeset
|
14 int log_fdpass_fd[2]; |
10200
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
15 |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
16 struct service_process_notify *kills; |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
17 struct io *io_blocking, *io_nonblocking; |
9235
2e2b957f1cca
Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
18 |
10200
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
19 unsigned int process_count; |
13648
926a7ceeaa10
anvil: Handle crash restarts without failing completely.
Timo Sirainen <tss@iki.fi>
parents:
10454
diff
changeset
|
20 /* anvil crashed and we're now restarting it */ |
926a7ceeaa10
anvil: Handle crash restarts without failing completely.
Timo Sirainen <tss@iki.fi>
parents:
10454
diff
changeset
|
21 bool restarted; |
10200
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
22 }; |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
23 |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
24 extern struct service_anvil_global *service_anvil_global; |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
25 |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
26 void service_anvil_monitor_start(struct service_list *service_list); |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
27 |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
28 void service_anvil_process_created(struct service_process *process); |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
29 void service_anvil_process_destroyed(struct service_process *process); |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
30 |
10454
802b9ebe79e6
anvil: After master gets a SIGHUP, start logging via new log process.
Timo Sirainen <tss@iki.fi>
parents:
10200
diff
changeset
|
31 void service_anvil_send_log_fd(void); |
802b9ebe79e6
anvil: After master gets a SIGHUP, start logging via new log process.
Timo Sirainen <tss@iki.fi>
parents:
10200
diff
changeset
|
32 |
10200
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
33 void service_anvil_global_init(void); |
01676e67cf38
master: anvil process now stays alive across SIGHUPs.
Timo Sirainen <tss@iki.fi>
parents:
10069
diff
changeset
|
34 void service_anvil_global_deinit(void); |
9954
c998a51b7be4
master: If anvil isn't used, read and discard all anvil input coming from mail processes.
Timo Sirainen <tss@iki.fi>
parents:
9235
diff
changeset
|
35 |
9235
2e2b957f1cca
Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
36 #endif |