Postfix3.3.1
master.c
[詳解]
1 /*++
2 /* NAME
3 /* master 8
4 /* SUMMARY
5 /* Postfix master process
6 /* SYNOPSIS
7 /* \fBmaster\fR [\fB-Dditvw\fR] [\fB-c \fIconfig_dir\fR] [\fB-e \fIexit_time\fR]
8 /* DESCRIPTION
9 /* The \fBmaster\fR(8) daemon is the resident process that runs Postfix
10 /* daemons on demand: daemons to send or receive messages via the
11 /* network, daemons to deliver mail locally, etc. These daemons are
12 /* created on demand up to a configurable maximum number per service.
13 /*
14 /* Postfix daemons terminate voluntarily, either after being idle for
15 /* a configurable amount of time, or after having serviced a
16 /* configurable number of requests. Exceptions to this rule are the
17 /* resident queue manager, address verification server, and the TLS
18 /* session cache and pseudo-random number server.
19 /*
20 /* The behavior of the \fBmaster\fR(8) daemon is controlled by the
21 /* \fBmaster.cf\fR configuration file, as described in \fBmaster\fR(5).
22 /*
23 /* Options:
24 /* .IP "\fB-c \fIconfig_dir\fR"
25 /* Read the \fBmain.cf\fR and \fBmaster.cf\fR configuration files in
26 /* the named directory instead of the default configuration directory.
27 /* This also overrides the configuration files for other Postfix
28 /* daemon processes.
29 /* .IP \fB-D\fR
30 /* After initialization, run a debugger on the master process. The
31 /* debugging command is specified with the \fBdebugger_command\fR in
32 /* the \fBmain.cf\fR global configuration file.
33 /* .IP \fB-d\fR
34 /* Do not redirect stdin, stdout or stderr to /dev/null, and
35 /* do not discard the controlling terminal. This must be used
36 /* for debugging only.
37 /* .IP "\fB-e \fIexit_time\fR"
38 /* Terminate the master process after \fIexit_time\fR seconds. Child
39 /* processes terminate at their convenience.
40 /* .IP \fB-i\fR
41 /* Enable \fBinit\fR mode: do not attempt to become a session
42 /* or process group leader; and to force termination, set an
43 /* explicit signal handler instead of relying on the default
44 /* signal action. This mode is allowed only if the process ID
45 /* equals 1.
46 /* .IP \fB-t\fR
47 /* Test mode. Return a zero exit status when the \fBmaster.pid\fR lock
48 /* file does not exist or when that file is not locked. This is evidence
49 /* that the \fBmaster\fR(8) daemon is not running.
50 /* .IP \fB-v\fR
51 /* Enable verbose logging for debugging purposes. This option
52 /* is passed on to child processes. Multiple \fB-v\fR options
53 /* make the software increasingly verbose.
54 /* .IP \fB-w\fR
55 /* Wait in a dummy foreground process, while the real master
56 /* daemon initializes in a background process. The dummy
57 /* foreground process returns a zero exit status only if the
58 /* master daemon initialization is successful, and if it
59 /* completes in a reasonable amount of time.
60 /* .sp
61 /* This feature is available in Postfix 2.10 and later.
62 /* .PP
63 /* Signals:
64 /* .IP \fBSIGHUP\fR
65 /* Upon receipt of a \fBHUP\fR signal (e.g., after "\fBpostfix reload\fR"),
66 /* the master process re-reads its configuration files. If a service has
67 /* been removed from the \fBmaster.cf\fR file, its running processes
68 /* are terminated immediately.
69 /* Otherwise, running processes are allowed to terminate as soon
70 /* as is convenient, so that changes in configuration settings
71 /* affect only new service requests.
72 /* .IP \fBSIGTERM\fR
73 /* Upon receipt of a \fBTERM\fR signal (e.g., after "\fBpostfix abort\fR"),
74 /* the master process passes the signal on to its child processes and
75 /* terminates.
76 /* This is useful for an emergency shutdown. Normally one would
77 /* terminate only the master ("\fBpostfix stop\fR") and allow running
78 /* processes to finish what they are doing.
79 /* DIAGNOSTICS
80 /* Problems are reported to \fBsyslogd\fR(8). The exit status
81 /* is non-zero in case of problems, including problems while
82 /* initializing as a master daemon process in the background.
83 /* ENVIRONMENT
84 /* .ad
85 /* .fi
86 /* .IP \fBMAIL_DEBUG\fR
87 /* After initialization, start a debugger as specified with the
88 /* \fBdebugger_command\fR configuration parameter in the \fBmain.cf\fR
89 /* configuration file.
90 /* .IP \fBMAIL_CONFIG\fR
91 /* Directory with Postfix configuration files.
92 /* CONFIGURATION PARAMETERS
93 /* .ad
94 /* .fi
95 /* Unlike most Postfix daemon processes, the \fBmaster\fR(8) server does
96 /* not automatically pick up changes to \fBmain.cf\fR. Changes
97 /* to \fBmaster.cf\fR are never picked up automatically.
98 /* Use the "\fBpostfix reload\fR" command after a configuration change.
99 /* RESOURCE AND RATE CONTROLS
100 /* .ad
101 /* .fi
102 /* .IP "\fBdefault_process_limit (100)\fR"
103 /* The default maximal number of Postfix child processes that provide
104 /* a given service.
105 /* .IP "\fBmax_idle (100s)\fR"
106 /* The maximum amount of time that an idle Postfix daemon process waits
107 /* for an incoming connection before terminating voluntarily.
108 /* .IP "\fBmax_use (100)\fR"
109 /* The maximal number of incoming connections that a Postfix daemon
110 /* process will service before terminating voluntarily.
111 /* .IP "\fBservice_throttle_time (60s)\fR"
112 /* How long the Postfix \fBmaster\fR(8) waits before forking a server that
113 /* appears to be malfunctioning.
114 /* .PP
115 /* Available in Postfix version 2.6 and later:
116 /* .IP "\fBmaster_service_disable (empty)\fR"
117 /* Selectively disable \fBmaster\fR(8) listener ports by service type
118 /* or by service name and type.
119 /* MISCELLANEOUS CONTROLS
120 /* .ad
121 /* .fi
122 /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
123 /* The default location of the Postfix main.cf and master.cf
124 /* configuration files.
125 /* .IP "\fBdaemon_directory (see 'postconf -d' output)\fR"
126 /* The directory with Postfix support programs and daemon programs.
127 /* .IP "\fBdebugger_command (empty)\fR"
128 /* The external command to execute when a Postfix daemon program is
129 /* invoked with the -D option.
130 /* .IP "\fBinet_interfaces (all)\fR"
131 /* The network interface addresses that this mail system receives
132 /* mail on.
133 /* .IP "\fBinet_protocols (all)\fR"
134 /* The Internet protocols Postfix will attempt to use when making
135 /* or accepting connections.
136 /* .IP "\fBimport_environment (see 'postconf -d' output)\fR"
137 /* The list of environment parameters that a privileged Postfix
138 /* process will import from a non-Postfix parent process, or name=value
139 /* environment overrides.
140 /* .IP "\fBmail_owner (postfix)\fR"
141 /* The UNIX system account that owns the Postfix queue and most Postfix
142 /* daemon processes.
143 /* .IP "\fBprocess_id (read-only)\fR"
144 /* The process ID of a Postfix command or daemon process.
145 /* .IP "\fBprocess_name (read-only)\fR"
146 /* The process name of a Postfix command or daemon process.
147 /* .IP "\fBqueue_directory (see 'postconf -d' output)\fR"
148 /* The location of the Postfix top-level queue directory.
149 /* .IP "\fBsyslog_facility (mail)\fR"
150 /* The syslog facility of Postfix logging.
151 /* .IP "\fBsyslog_name (see 'postconf -d' output)\fR"
152 /* A prefix that is prepended to the process name in syslog
153 /* records, so that, for example, "smtpd" becomes "prefix/smtpd".
154 /* .PP
155 /* Available in Postfix 3.3 and later:
156 /* .IP "\fBservice_name (read-only)\fR"
157 /* The master.cf service name of a Postfix daemon process.
158 /* FILES
159 /* .ad
160 /* .fi
161 /* To expand the directory names below into their actual values,
162 /* use the command "\fBpostconf config_directory\fR" etc.
163 /* .na
164 /* .nf
165 /*
166 /* $config_directory/main.cf, global configuration file.
167 /* $config_directory/master.cf, master server configuration file.
168 /* $queue_directory/pid/master.pid, master lock file.
169 /* $data_directory/master.lock, master lock file.
170 /* SEE ALSO
171 /* qmgr(8), queue manager
172 /* verify(8), address verification
173 /* master(5), master.cf configuration file syntax
174 /* postconf(5), main.cf configuration file syntax
175 /* syslogd(8), system logging
176 /* LICENSE
177 /* .ad
178 /* .fi
179 /* The Secure Mailer license must be distributed with this software.
180 /* AUTHOR(S)
181 /* Wietse Venema
182 /* IBM T.J. Watson Research
183 /* P.O. Box 704
184 /* Yorktown Heights, NY 10598, USA
185 /*
186 /* Wietse Venema
187 /* Google, Inc.
188 /* 111 8th Avenue
189 /* New York, NY 10011, USA
190 /*--*/
191 
192 /* System libraries. */
193 
194 #include <sys_defs.h>
195 #include <sys/stat.h>
196 #include <syslog.h>
197 #include <signal.h>
198 #include <stdlib.h>
199 #include <unistd.h>
200 #include <string.h>
201 #include <fcntl.h>
202 #include <limits.h>
203 
204 /* Utility library. */
205 
206 #include <events.h>
207 #include <msg.h>
208 #include <msg_syslog.h>
209 #include <vstring.h>
210 #include <mymalloc.h>
211 #include <iostuff.h>
212 #include <vstream.h>
213 #include <stringops.h>
214 #include <myflock.h>
215 #include <watchdog.h>
216 #include <clean_env.h>
217 #include <argv.h>
218 #include <safe.h>
219 #include <set_eugid.h>
220 #include <set_ugid.h>
221 
222 /* Global library. */
223 
224 #include <mail_params.h>
225 #include <mail_version.h>
226 #include <debug_process.h>
227 #include <mail_task.h>
228 #include <mail_conf.h>
229 #include <open_lock.h>
230 #include <inet_proto.h>
231 #include <mail_parm_split.h>
232 
233 /* Application-specific. */
234 
235 #include "master.h"
236 
238 int init_mode = 0;
239 
240 /* master_exit_event - exit for memory leak testing purposes */
241 
242 static void master_exit_event(int unused_event, void *unused_context)
243 {
244  msg_info("master exit time has arrived");
245  exit(0);
246 }
247 
248 /* usage - show hint and terminate */
249 
250 static NORETURN usage(const char *me)
251 {
252  msg_fatal("usage: %s [-c config_dir] [-D (debug)] [-d (don't detach from terminal)] [-e exit_time] [-t (test)] [-v] [-w (wait for initialization)]", me);
253 }
254 
256 
257 /* main - main program */
258 
259 int main(int argc, char **argv)
260 {
261  static VSTREAM *lock_fp;
262  static VSTREAM *data_lock_fp;
263  VSTRING *lock_path;
264  VSTRING *data_lock_path;
265  off_t inherited_limit;
266  int debug_me = 0;
267  int ch;
268  int fd;
269  int n;
270  int test_lock = 0;
271  VSTRING *why;
272  WATCHDOG *watchdog;
273  ARGV *import_env;
274  int wait_flag = 0;
275  int monitor_fd = -1;
276 
277  /*
278  * Fingerprint executables and core dumps.
279  */
281 
282  /*
283  * Initialize.
284  */
285  umask(077); /* never fails! */
286 
287  /*
288  * Process environment options as early as we can.
289  */
290  if (getenv(CONF_ENV_VERB))
291  msg_verbose = 1;
292  if (getenv(CONF_ENV_DEBUG))
293  debug_me = 1;
294 
295  /*
296  * Don't die when a process goes away unexpectedly.
297  */
298  signal(SIGPIPE, SIG_IGN);
299 
300  /*
301  * Strip and save the process name for diagnostics etc.
302  */
303  var_procname = mystrdup(basename(argv[0]));
304 
305  /*
306  * When running a child process, don't leak any open files that were
307  * leaked to us by our own (privileged) parent process. Descriptors 0-2
308  * are taken care of after we have initialized error logging.
309  *
310  * Some systems such as AIX have a huge per-process open file limit. In
311  * those cases, limit the search for potential file descriptor leaks to
312  * just the first couple hundred.
313  *
314  * The Debian post-installation script passes an open file descriptor into
315  * the master process and waits forever for someone to close it. Because
316  * of this we have to close descriptors > 2, and pray that doing so does
317  * not break things.
318  */
319  closefrom(3);
320 
321  /*
322  * Initialize logging and exit handler.
323  */
325 
326  /*
327  * Check the Postfix library version as soon as we enable logging.
328  */
330 
331  /*
332  * The mail system must be run by the superuser so it can revoke
333  * privileges for selected operations. That's right - it takes privileges
334  * to toss privileges.
335  */
336  if (getuid() != 0)
337  msg_fatal("the master command is reserved for the superuser");
338  if (unsafe() != 0)
339  msg_fatal("the master command must not run as a set-uid process");
340 
341  /*
342  * Process JCL.
343  */
344  while ((ch = GETOPT(argc, argv, "c:Dde:itvw")) > 0) {
345  switch (ch) {
346  case 'c':
347  if (setenv(CONF_ENV_PATH, optarg, 1) < 0)
348  msg_fatal("out of memory");
349  break;
350  case 'd':
351  master_detach = 0;
352  break;
353  case 'e':
354  event_request_timer(master_exit_event, (void *) 0, atoi(optarg));
355  break;
356  case 'i':
357  if (getpid() != 1)
358  msg_fatal("-i is allowed only for PID 1 process");
359  init_mode = 1;
360  break;
361  case 'D':
362  debug_me = 1;
363  break;
364  case 't':
365  test_lock = 1;
366  break;
367  case 'v':
368  msg_verbose++;
369  break;
370  case 'w':
371  wait_flag = 1;
372  break;
373  default:
374  usage(argv[0]);
375  /* NOTREACHED */
376  }
377  }
378 
379  /*
380  * This program takes no other arguments.
381  */
382  if (argc > optind)
383  usage(argv[0]);
384 
385  /*
386  * Sanity check.
387  */
388  if (test_lock && wait_flag)
389  msg_fatal("the -t and -w options cannot be used together");
390  if (init_mode && (debug_me || !master_detach || wait_flag))
391  msg_fatal("the -i option cannot be used with -D, -d, or -w");
392 
393  /*
394  * Run a foreground monitor process that returns an exit status of 0 when
395  * the child background process reports successful initialization as a
396  * daemon process. We use a generous limit in case main/master.cf specify
397  * symbolic hosts/ports and the naming service is slow.
398  */
399 #define MASTER_INIT_TIMEOUT 100 /* keep this limit generous */
400 
401  if (wait_flag)
402  monitor_fd = master_monitor(MASTER_INIT_TIMEOUT);
403 
404  /*
405  * If started from a terminal, get rid of any tty association. This also
406  * means that all errors and warnings must go to the syslog daemon.
407  */
408  if (master_detach)
409  for (fd = 0; fd < 3; fd++) {
410  (void) close(fd);
411  if (open("/dev/null", O_RDWR, 0) != fd)
412  msg_fatal("open /dev/null: %m");
413  }
414 
415  /*
416  * Run in a separate process group, so that "postfix stop" can terminate
417  * all MTA processes cleanly. Give up if we can't separate from our
418  * parent process. We're not supposed to blow away the parent.
419  */
420  if (init_mode == 0 && debug_me == 0 && master_detach != 0
421  && setsid() == -1 && getsid(0) != getpid())
422  msg_fatal("unable to set session and process group ID: %m");
423 
424  /*
425  * Make some room for plumbing with file descriptors. XXX This breaks
426  * when a service listens on many ports. In order to do this right we
427  * must change the master-child interface so that descriptors do not need
428  * to have fixed numbers.
429  *
430  * In a child we need two descriptors for the flow control pipe, one for
431  * child->master status updates and at least one for listening.
432  */
433  for (n = 0; n < 5; n++) {
434  if (close_on_exec(dup(0), CLOSE_ON_EXEC) < 0)
435  msg_fatal("dup(0): %m");
436  }
437 
438  /*
439  * Final initializations. Unfortunately, we must read the global Postfix
440  * configuration file after doing command-line processing, so that we get
441  * consistent results when we SIGHUP the server to reload configuration
442  * files.
443  */
445 
446  /*
447  * In case of multi-protocol support. This needs to be done because
448  * master does not invoke mail_params_init() (it was written before that
449  * code existed).
450  */
452 
453  /*
454  * Environment import filter, to enforce consistent behavior whether
455  * Postfix is started by hand, or at system boot time.
456  */
458  clean_env(import_env->argv);
459  argv_free(import_env);
460 
461  if ((inherited_limit = get_file_limit()) < 0)
463 
464  if (chdir(var_queue_dir))
465  msg_fatal("chdir %s: %m", var_queue_dir);
466 
467  /*
468  * Lock down the master.pid file. In test mode, no file means that it
469  * isn't locked.
470  */
471  lock_path = vstring_alloc(10);
472  data_lock_path = vstring_alloc(10);
473  why = vstring_alloc(10);
474 
475  vstring_sprintf(lock_path, "%s/%s.pid", DEF_PID_DIR, var_procname);
476  if (test_lock && access(vstring_str(lock_path), F_OK) < 0)
477  exit(0);
478  lock_fp = open_lock(vstring_str(lock_path), O_RDWR | O_CREAT, 0644, why);
479  if (test_lock)
480  exit(lock_fp ? 0 : 1);
481  if (lock_fp == 0)
482  msg_fatal("open lock file %s: %s",
483  vstring_str(lock_path), vstring_str(why));
484  vstream_fprintf(lock_fp, "%*lu\n", (int) sizeof(unsigned long) * 4,
485  (unsigned long) var_pid);
486  if (vstream_fflush(lock_fp))
487  msg_fatal("cannot update lock file %s: %m", vstring_str(lock_path));
489 
490  /*
491  * Lock down the Postfix-writable data directory.
492  */
493  vstring_sprintf(data_lock_path, "%s/%s.lock", var_data_dir, var_procname);
495  data_lock_fp =
496  open_lock(vstring_str(data_lock_path), O_RDWR | O_CREAT, 0644, why);
497  set_ugid(getuid(), getgid());
498  if (data_lock_fp == 0)
499  msg_fatal("open lock file %s: %s",
500  vstring_str(data_lock_path), vstring_str(why));
501  vstream_fprintf(data_lock_fp, "%*lu\n", (int) sizeof(unsigned long) * 4,
502  (unsigned long) var_pid);
503  if (vstream_fflush(data_lock_fp))
504  msg_fatal("cannot update lock file %s: %m", vstring_str(data_lock_path));
506 
507  /*
508  * Clean up.
509  */
510  vstring_free(why);
511  vstring_free(lock_path);
512  vstring_free(data_lock_path);
513 
514  /*
515  * Optionally start the debugger on ourself.
516  */
517  if (debug_me)
518  debug_process();
519 
520  /*
521  * Finish initialization, last part. We must process configuration files
522  * after processing command-line parameters, so that we get consistent
523  * results when we SIGHUP the server to reload configuration files.
524  */
525  master_config();
526  master_sigsetup();
528  msg_info("daemon started -- version %s, configuration %s",
530 
531  /*
532  * Report successful initialization to the foreground monitor process.
533  */
534  if (monitor_fd >= 0) {
535  write(monitor_fd, "", 1);
536  (void) close(monitor_fd);
537  }
538 
539  /*
540  * Process events. The event handler will execute the read/write/timer
541  * action routines. Whenever something has happened, see if we received
542  * any signal in the mean time. Although the master process appears to do
543  * multiple things at the same time, it really is all a single thread, so
544  * that there are no concurrency conflicts within the master process.
545  */
546 #define MASTER_WATCHDOG_TIME 1000
547 
548  watchdog = watchdog_create(MASTER_WATCHDOG_TIME, (WATCHDOG_FN) 0, (void *) 0);
549  for (;;) {
550 #ifdef HAS_VOLATILE_LOCKS
551  if (myflock(vstream_fileno(lock_fp), INTERNAL_LOCK,
553  msg_fatal("refresh exclusive lock: %m");
554  if (myflock(vstream_fileno(data_lock_fp), INTERNAL_LOCK,
556  msg_fatal("refresh exclusive lock: %m");
557 #endif
558  watchdog_start(watchdog); /* same as trigger servers */
560  if (master_gotsighup) {
561  msg_info("reload -- version %s, configuration %s",
563  master_gotsighup = 0; /* this first */
564  master_vars_init(); /* then this */
565  master_refresh(); /* then this */
566  }
567  if (master_gotsigchld) {
568  if (msg_verbose)
569  msg_info("got sigchld");
570  master_gotsigchld = 0; /* this first */
571  master_reap_child(); /* then this */
572  }
573  }
574 }
int msg_verbose
Definition: msg.c:177
#define MASTER_WATCHDOG_TIME
void master_reap_child(void)
Definition: master_spawn.c:288
int init_mode
Definition: master.c:238
const char * mail_task(const char *argv0)
Definition: mail_task.c:49
char * var_procname
Definition: mail_params.c:252
char * mystrdup(const char *str)
Definition: mymalloc.c:225
int master_monitor(int)
char * var_import_environ
Definition: mail_params.c:296
ARGV * argv_free(ARGV *argvp)
Definition: argv.c:136
int var_pid
Definition: mail_params.c:254
#define NORETURN
Definition: sys_defs.h:1583
Definition: argv.h:17
#define VAR_IMPORT_ENVIRON
Definition: mail_params.h:2506
#define vstring_str(vp)
Definition: vstring.h:71
void master_refresh(void)
Definition: master_conf.c:52
#define MYFLOCK_OP_EXCLUSIVE
Definition: myflock.h:30
#define LOG_FACILITY
Definition: mail_params.h:357
INET_PROTO_INFO * inet_proto_init(const char *context, const char *protocols)
Definition: inet_proto.c:180
int master_detach
Definition: master.c:237
VSTREAM * open_lock(const char *path, int flags, mode_t mode, VSTRING *why)
Definition: open_lock.c:58
char ** argv
Definition: argv.h:20
void set_file_limit(off_t limit)
Definition: file_limit.c:80
char * var_config_dir
Definition: mail_params.c:241
int main(int argc, char **argv)
Definition: master.c:259
void master_config(void)
Definition: master_conf.c:87
int unsafe(void)
Definition: unsafe.c:59
#define CONF_ENV_VERB
Definition: mail_conf.h:23
void master_flow_init(void)
Definition: master_flow.c:21
void watchdog_start(WATCHDOG *wp)
Definition: watchdog.c:251
void(* WATCHDOG_FN)(WATCHDOG *, char *)
Definition: watchdog.h:18
char * var_mail_version
Definition: mail_params.c:267
off_t get_file_limit(void)
Definition: file_limit.c:58
void clean_env(char **preserve_list)
Definition: clean_env.c:59
void master_sigsetup(void)
Definition: master_sig.c:226
#define CONF_ENV_DEBUG
Definition: mail_conf.h:24
#define CONF_ENV_PATH
Definition: mail_conf.h:22
#define MASTER_INIT_TIMEOUT
gid_t var_owner_gid
Definition: mail_params.c:235
ARGV * mail_parm_split(const char *name, const char *value)
uid_t var_owner_uid
Definition: mail_params.c:234
VSTREAM * vstream_fprintf(VSTREAM *stream, const char *fmt,...)
Definition: vstream.c:1348
#define OFF_T_MAX
Definition: sys_defs.h:1683
int closefrom(int lowfd)
Definition: sys_compat.c:289
void event_loop(int delay)
Definition: events.c:998
WATCHDOG * watchdog_create(unsigned timeout, WATCHDOG_FN action, char *context)
Definition: watchdog.c:189
VSTRING * vstring_alloc(ssize_t len)
Definition: vstring.c:353
int myflock(int fd, int lock_style, int operation)
Definition: myflock.c:87
int master_gotsigchld
Definition: master_sig.c:75
#define MAIL_VERSION_STAMP_ALLOCATE
Definition: mail_version.h:67
#define VAR_INET_PROTOCOLS
Definition: mail_params.h:994
VSTRING * vstring_sprintf(VSTRING *vp, const char *format,...)
Definition: vstring.c:602
void debug_process(void)
Definition: debug_process.c:50
MAIL_VERSION_STAMP_DECLARE
Definition: master.c:255
char * var_data_dir
Definition: mail_params.c:243
NORETURN msg_fatal(const char *fmt,...)
Definition: msg.c:249
#define MAIL_VERSION_CHECK
Definition: mail_version.h:90
int vstream_fflush(VSTREAM *stream)
Definition: vstream.c:1257
void set_eugid(uid_t euid, gid_t egid)
Definition: set_eugid.c:54
void master_vars_init(void)
Definition: master_vars.c:55
#define GETOPT(argc, argv, str)
Definition: sys_defs.h:1313
void msg_syslog_init(const char *name, int logopt, int facility)
Definition: msg_syslog.c:173
#define DEF_PID_DIR
Definition: mail_params.h:303
void set_ugid(uid_t uid, gid_t gid)
Definition: set_ugid.c:45
VSTRING * vstring_free(VSTRING *vp)
Definition: vstring.c:380
time_t event_request_timer(EVENT_NOTIFY_TIME_FN callback, void *context, int delay)
Definition: events.c:894
char * var_queue_dir
Definition: mail_params.c:246
#define vstream_fileno(vp)
Definition: vstream.h:115
char * var_inet_protocols
Definition: mail_params.c:260
#define CLOSE_ON_EXEC
Definition: iostuff.h:51
int master_gotsighup
Definition: master_sig.c:76
#define basename
Definition: stringops.h:36
int close_on_exec(int fd, int on)
Definition: close_on_exec.c:49
void msg_info(const char *fmt,...)
Definition: msg.c:199