/*++ /* NAME /* master_monitor 3 /* SUMMARY /* Postfix master - start-up monitoring /* SYNOPSIS /* #include "master.h" /* /* int master_monitor(time_limit) /* int time_limit; /* DESCRIPTION /* master_monitor() forks off a background child process, and /* returns in the child. The result value is the file descriptor /* on which the child process must write one byte after it /* completes successful initialization as a daemon process. /* /* The foreground process waits for the child's completion for /* a limited amount of time. It terminates with exit status 0 /* in case of success, non-zero otherwise. /* DIAGNOSTICS /* Fatal errors: system call failure. /* BUGS /* SEE ALSO /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
/* *Forkthechild,andwaitforittoreportsuccessfulinitialization.
*/ switch (pid = fork()) { case -1: /* Error. */
msg_fatal("fork: %m"); case0: /* Child. Initialize as daemon in the background. */
close(pipes[0]); return (pipes[1]); default: /* Parent. Monitor the child in the foreground. */
close(pipes[1]); switch (timed_read(pipes[0], buf, 1, time_limit, (void *) 0)) { default:
msg_warn("%m while waiting for daemon initialization"); /* The child process still runs, but something is wrong. */
(void) kill(pid, SIGKILL); /* FALLTHROUGH */ case0: /* The child process exited prematurely. */
msg_fatal("daemon initialization failure -- see logs for details"); case1: /* The child process initialized successfully. */ exit(0);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.