summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar therazer <devnull@localhost> 2010-11-12 21:56:03 +0100
committerGravatar therazer <devnull@localhost> 2010-11-12 21:56:03 +0100
commitb3a96985d579d6bb1318bbe873af1a7a1a04921f (patch)
tree1b80aa180386e75fb25ed6c53acb6d54092cf4dd /pyLoadCore.py
parentadding pidfile support (diff)
downloadpyload-b3a96985d579d6bb1318bbe873af1a7a1a04921f.tar.xz
small fixes to pidfile
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 9cf51e100..de0781b5a 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -79,8 +79,8 @@ class Core(object):
def __init__(self):
self.doDebug = False
+ self.daemon = False
self.arg_links = []
-
self.pidfile = "./pyload.pid"
if len(argv) > 1:
@@ -92,6 +92,8 @@ class Core(object):
if option in ("-v", "--version"):
print "pyLoad", CURRENT_VERSION
exit()
+ elif option in ("--daemon"):
+ self.daemon = True
elif option in ("-c", "--clear"):
try:
remove("files.db")
@@ -343,7 +345,7 @@ class Core(object):
if self.do_restart:
self.log.info(_("restarting pyLoad"))
self.restart()
- if self.do_kill or not self.checkPidFile():
+ if self.do_kill or (not self.checkPidFile() and not self.daemon):
self.shutdown()
self.log.info(_("pyLoad quits"))
self.removeLogger()
@@ -501,6 +503,8 @@ class Core(object):
self.files.syncSave()
self.threadManager.cleanup()
self.shuttedDown = True
+
+ self.deletePidFile()
def path(self, * args):