From 08042926107fe87381edbe8aa095c21feab9b3da Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Thu, 14 Apr 2022 14:03:17 -0700 Subject: [PATCH] Rearrange main() for python-daemon --- bin/backupd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/backupd b/bin/backupd index 17f283f..20b756b 100644 --- a/bin/backupd +++ b/bin/backupd @@ -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()