annotate src/master/child-process.h @ 8971:163c3f85a3aa HEAD

namespaces: list=children wasn't working correctly.
author Timo Sirainen <tss@iki.fi>
date Mon, 20 Apr 2009 13:28:00 -0400
parents f8fdabb30c0a
children 366a327b028b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5846
diff changeset
1 #ifndef CHILD_PROCESS_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5846
diff changeset
2 #define CHILD_PROCESS_H
5843
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 enum process_type {
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 PROCESS_TYPE_UNKNOWN,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 PROCESS_TYPE_AUTH,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 PROCESS_TYPE_AUTH_WORKER,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 PROCESS_TYPE_LOGIN,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 PROCESS_TYPE_IMAP,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 PROCESS_TYPE_POP3,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 PROCESS_TYPE_SSL_PARAM,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 PROCESS_TYPE_DICT,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14 PROCESS_TYPE_MAX
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 };
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 struct child_process {
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 enum process_type type;
8628
e85c7cb22ad7 If login process crashes, log the IP address that (maybe) caused it.
Timo Sirainen <tss@iki.fi>
parents: 7334
diff changeset
19 struct ip_addr ip;
e85c7cb22ad7 If login process crashes, log the IP address that (maybe) caused it.
Timo Sirainen <tss@iki.fi>
parents: 7334
diff changeset
20 unsigned int allow_change_ip:1;
6542
402d14b5ef8b If child process logged a fatal failure, don't show "returned error 89"
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
21 unsigned int seen_fatal:1;
8628
e85c7cb22ad7 If login process crashes, log the IP address that (maybe) caused it.
Timo Sirainen <tss@iki.fi>
parents: 7334
diff changeset
22 unsigned int ip_changed:1;
5843
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 };
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24
5846
21e529b8a701 Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents: 5843
diff changeset
25 typedef void child_process_destroy_callback_t(struct child_process *process,
21e529b8a701 Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents: 5843
diff changeset
26 pid_t pid, bool abnormal_exit);
5843
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
27
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28 extern const char *process_names[];
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
29 extern struct hash_table *processes;
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
30
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
31 struct child_process *child_process_lookup(pid_t pid);
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
32 void child_process_add(pid_t pid, struct child_process *process);
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
33 void child_process_remove(pid_t pid);
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
34
7109
e6823d781317 Reverted "environment array" changes. It broke overriding imap/pop3 settings
Timo Sirainen <tss@iki.fi>
parents: 7091
diff changeset
35 void child_process_init_env(void);
e6823d781317 Reverted "environment array" changes. It broke overriding imap/pop3 settings
Timo Sirainen <tss@iki.fi>
parents: 7091
diff changeset
36 void client_process_exec(const char *cmd, const char *title);
7334
ae8180a4febd Allow dovecot --exec-mail ext program arguments.
Timo Sirainen <tss@iki.fi>
parents: 7109
diff changeset
37 void client_process_exec_argv(const char *executable, const char **argv);
5843
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
39 void child_process_set_destroy_callback(enum process_type type,
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
40 child_process_destroy_callback_t *cb);
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
41
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
42 void child_processes_init(void);
8735
f8fdabb30c0a master: Don't crash if auth process dies too early.
Timo Sirainen <tss@iki.fi>
parents: 8628
diff changeset
43 void child_processes_flush(void);
5843
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
44 void child_processes_deinit(void);
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
45
f655c4d4a419 Moved child process handling to child-process.[ch]. The hash table now uses
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
46 #endif