Browse Source

Daemonize cleanup

pull/778/merge
Ruud 12 years ago
parent
commit
52371b7705
  1. 2
      couchpotato/core/_base/_core/main.py
  2. 2
      couchpotato/environment.py
  3. 2
      libs/daemon.py

2
couchpotato/core/_base/_core/main.py

@ -179,7 +179,7 @@ class Core(Plugin):
if Env.get('daemonized'): return if Env.get('daemonized'): return
def signal_handler(signal, frame): def signal_handler(signal, frame):
fireEvent('app.shutdown') fireEvent('app.shutdown', single = True)
signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler) signal.signal(signal.SIGTERM, signal_handler)

2
couchpotato/environment.py

@ -20,7 +20,7 @@ class Env(object):
_options = None _options = None
_args = None _args = None
_quiet = False _quiet = False
_deamonize = False _daemonized = False
_desktop = None _desktop = None
_session = None _session = None

2
libs/daemon.py

@ -92,6 +92,7 @@ class Daemon():
""" """
Stop the daemon Stop the daemon
""" """
# Get the pid from the pidfile # Get the pid from the pidfile
try: try:
pf = file(self.pidfile, 'r') pf = file(self.pidfile, 'r')
@ -115,7 +116,6 @@ class Daemon():
if err.find("No such process") > 0: if err.find("No such process") > 0:
self.delpid() self.delpid()
else: else:
print str(err)
sys.exit(1) sys.exit(1)
def restart(self): def restart(self):

Loading…
Cancel
Save