main.c revision 2a50e379e26c99b3f2a7a4d66644e5c1f5126ca0
8b1e748505dcb1a559dba0100df7b45b8c27dc08Tim Reddehase/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
#include "service-monitor.h"
#include "service-log.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <pwd.h>
#include <grp.h>
bool auth_success_written;
bool core_dumps_disabled;
int null_fd;
static char *pidfile_path;
const char **new_argv;
sizeof(const char *) * count2);
const char **error_r)
int fd;
const char *path;
int fd;
if (ret < 0)
unsigned int i, count;
for (i = 0; i < count; i++) {
return TRUE;
return FALSE;
unsigned int i, count;
for (i = 0; i < count; i++) {
return TRUE;
return FALSE;
unsigned int i, count;
return FALSE;
for (i = 0; i < count; i++) {
return TRUE;
return FALSE;
int fd;
if (ret <= 0) {
if (ret == 0)
ret--;
const char *pid;
int fd;
const char *error;
hostpid_init();
static void main_log_startup(void)
core_limit == 0;
if (core_dumps_disabled)
if (log_error) {
static void main_deinit(void)
const char *path;
return path;
static void daemonize(void)
if (pid < 0)
if (pid != 0)
_exit(0);
if (setsid() < 0)
hostpid_init();
static void print_help(void)
static void print_build_options(void)
#ifdef IOLOOP_EPOLL
#ifdef IOLOOP_KQUEUE
#ifdef IOLOOP_POLL
#ifdef IOLOOP_SELECT
#ifdef IOLOOP_NOTIFY_DNOTIFY
#ifdef IOLOOP_NOTIFY_INOTIFY
#ifdef IOLOOP_NOTIFY_KQUEUE
#ifdef HAVE_IPV6
#ifdef HAVE_GNUTLS
#ifdef HAVE_OPENSSL
#ifdef BUILD_MYSQL
#ifdef BUILD_PGSQL
#ifdef BUILD_SQLITE
#ifdef PASSDB_BSDAUTH
#ifdef PASSDB_CHECKPASSWORD
#ifdef PASSDB_LDAP
#ifdef PASSDB_PAM
#ifdef PASSDB_PASSWD
#ifdef PASSDB_PASSWD_FILE
#ifdef PASSDB_SHADOW
#ifdef PASSDB_SQL
#ifdef PASSDB_VPOPMAIL
#ifdef USERDB_CHECKPASSWORD
#ifdef USERDB_LDAP
#ifdef USERDB_PASSWD
#ifdef USERDB_PREFETCH
#ifdef USERDB_PASSWD_FILE
#ifdef USERDB_SQL
#ifdef USERDB_STATIC
#ifdef USERDB_VPOPMAIL
unsigned int child_process_env_idx = 0;
void **sets;
#ifdef DEBUG
c, optarg)) {
print_help();
const char **args;
print_help();
&error) < 0)
if (!log_error) {
if (ask_key_pass) {
const char *prompt;
sizeof(ssl_manual_key_password));
env_clean();
return FATAL_DEFAULT;
if (!foreground)
daemonize();
main_deinit();