def run():
# we don't care to be notified of our childrens' exit statuses.
# this prevents zombie processes from cluttering up the process
# table when zopectl start/stop is used interactively.
# DM 2004-11-26: from the Linux "execve(2)" manual page:
# Any signals set to be caught by the calling process are reset
# to their default behaviour.
# The SIGCHLD signal (when set to SIG_IGN) may or may not be reset
# to SIG_DFL.
# If it is not reset, 'os.wait[pid]' can non-deterministically fail.
# Thus, use a way such that "SIGCHLD" is definitely reset in children.
# signal.signal(signal.SIGCHLD, signal.SIG_IGN)
if not WIN and os.uname()[0] != 'Darwin':
# On Windows the os.uname method does not exist.
# On Mac OS X, setting up a signal handler causes waitpid to
# raise EINTR, which is not preventable via the Python signal
# handler API and can't be dealt with properly as we can't pass
# the SA_RESTART to the signal API. Since Mac OS X doesn't
# appear to clutter up the process table with zombies if
# SIGCHILD is unset, just don't bother registering a SIGCHILD
# signal handler at all.
signal.signal(signal.SIGCHLD, _ignoreSIGCHLD)
exitstatus = main()
sys.exit(exitstatus)
评论列表
文章目录