Commit 88c9fb48 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2447] catch failure on initial log, which is most likely a permission issue.

so, it now just prints some hints to stderr and exits.
parent 0590b6d3
......@@ -1145,6 +1145,21 @@ def main():
options = parse_args()
# Announce startup. Making this is the first log message.
try:
logger.info(BIND10_STARTING, VERSION)
except RuntimeError as e:
sys.stderr.write('ERROR: failed to write the initial log: %s\n' %
str(e))
sys.stderr.write("""\
TIP: if this is about permission error for a lock file, check if the directory
of the file is writable for the user of the bind10 process; often you need
to start bind10 as a super user. Also, if you specify the -u option to
change the user and group, the directory must be writable for the group,
and the created lock file must be writabel for that user.
""")
sys.exit(1)
# Check user ID.
setuid = None
setgid = None
......@@ -1177,9 +1192,6 @@ def main():
logger.fatal(BIND10_INVALID_USER, options.user)
sys.exit(1)
# Announce startup.
logger.info(BIND10_STARTING, VERSION)
# Create wakeup pipe for signal handlers
wakeup_pipe = os.pipe()
signal.set_wakeup_fd(wakeup_pipe[1])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment