From 2f0683ec1e452848eaaac15de9a2f9064a8a4e16 Mon Sep 17 00:00:00 2001 From: echel0n Date: Fri, 11 Jul 2014 16:37:09 -0700 Subject: [PATCH] Fixed restart/updating issues for synology/qnap devices, may also resolve other OS related simular issues. --- SickBeard.py | 94 +++++++++++++++++++++++++++------------ sickbeard/__init__.py | 4 +- sickbeard/event_queue.py | 6 +-- sickbeard/webserveInit.py | 4 +- 4 files changed, 73 insertions(+), 35 deletions(-) diff --git a/SickBeard.py b/SickBeard.py index a12d5459..031b5725 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -53,20 +53,16 @@ if sys.hexversion >= 0x020600F0: import locale import datetime import threading -import traceback import getopt import sickbeard - -from sickbeard.event_queue import Events from sickbeard import db from sickbeard.tv import TVShow from sickbeard import logger, network_timezones, failed_history, name_cache from sickbeard.webserveInit import SRWebServer from sickbeard.version import SICKBEARD_VERSION -from sickbeard.databases.mainDB import MIN_DB_VERSION -from sickbeard.databases.mainDB import MAX_DB_VERSION -from sickbeard import exceptions +from sickbeard.databases.mainDB import MIN_DB_VERSION, MAX_DB_VERSION +from sickbeard.event_queue import Events from lib.configobj import ConfigObj @@ -76,18 +72,53 @@ signal.signal(signal.SIGINT, sickbeard.sig_handler) signal.signal(signal.SIGTERM, sickbeard.sig_handler) class SickRage(object): - def __init__(self): + # system event callback for shutdown/restart sickbeard.events = Events(self.shutdown) - self.webserver = None + # daemon constants self.runAsDaemon = False self.CREATEPID = False - self.PIDFILE = None + self.PIDFILE = '' + + # webserver constants + self.webserver = None self.forceUpdate = False self.forcedPort = None self.noLaunch = False + def help_message(self): + """ + print help message for commandline options + """ + help_msg = "\n" + help_msg += "Usage: " + sickbeard.MY_FULLNAME + "