Remove daemon helper from analyzer

Let the system daemonize the process.
This commit is contained in:
jo 2021-06-05 16:28:37 +02:00
parent e8d5481422
commit ce976743e7
2 changed files with 5 additions and 17 deletions

View file

@ -6,7 +6,6 @@ import argparse
import os import os
import airtime_analyzer.airtime_analyzer as aa import airtime_analyzer.airtime_analyzer as aa
import daemon
VERSION = "1.0" VERSION = "1.0"
LIBRETIME_CONF_DIR = os.getenv("LIBRETIME_CONF_DIR", "/etc/airtime") LIBRETIME_CONF_DIR = os.getenv("LIBRETIME_CONF_DIR", "/etc/airtime")
@ -18,7 +17,6 @@ def main():
"""Entry-point for this application""" """Entry-point for this application"""
print("LibreTime Analyzer {}".format(VERSION)) print("LibreTime Analyzer {}".format(VERSION))
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("-d", "--daemon", help="run as a daemon", action="store_true")
parser.add_argument( parser.add_argument(
"--debug", help="log full debugging output", action="store_true" "--debug", help="log full debugging output", action="store_true"
) )
@ -42,20 +40,11 @@ def main():
if args.http_retry_queue_file: if args.http_retry_queue_file:
http_retry_queue_path = args.http_retry_queue_file http_retry_queue_path = args.http_retry_queue_file
if args.daemon: aa.AirtimeAnalyzerServer(
with daemon.DaemonContext(): rmq_config_path=rmq_config_path,
aa.AirtimeAnalyzerServer( http_retry_queue_path=http_retry_queue_path,
rmq_config_path=rmq_config_path, debug=args.debug,
http_retry_queue_path=http_retry_queue_path, )
debug=args.debug,
)
else:
# Run without daemonizing
aa.AirtimeAnalyzerServer(
rmq_config_path=rmq_config_path,
http_retry_queue_path=http_retry_queue_path,
debug=args.debug,
)
if __name__ == "__main__": if __name__ == "__main__":

View file

@ -22,7 +22,6 @@ setup(
"mutagen==1.42.0", "mutagen==1.42.0",
"pika~=1.1.0", "pika~=1.1.0",
"file-magic", "file-magic",
"python-daemon",
"requests>=2.7.0", "requests>=2.7.0",
"rgain3==1.0.0", "rgain3==1.0.0",
"pycairo==1.19.1", "pycairo==1.19.1",