Rearrange main() for python-daemon

This commit is contained in:
Eric Torres 2022-04-14 14:03:17 -07:00
parent 4df3814b72
commit 0804292610

View File

@ -43,7 +43,7 @@ syslog.setLevel(logging.DEBUG)
# ========== Main Program ==========
if __name__ == "__main__":
def main():
args = parse_cmdline_arguments()
stdout_handler, stderr_handler = rbackup.logging.retrieve_console_handlers(
@ -52,5 +52,7 @@ if __name__ == "__main__":
syslog.addHandler(stdout_handler)
syslog.addHandler(stderr_handler)
if __name__ == "__main__":
with daemon.DaemonContext():
pass
main()