make sure we have the right daemon

This commit is contained in:
Andreas Wrede
2015-11-29 15:16:39 -05:00
parent 721fea5723
commit 993b42b339
+6 -1
View File
@@ -20,7 +20,11 @@ import errno
import traceback
import lockfile
import daemon
try:
import daemon.pidfile
except:
print "need version 2.1 or higer of python-daemon"
sys.exit(1)
import syslog
@@ -51,7 +55,7 @@ def getsock(host):
logm = '%s hbc died: \n%s' % ('getsock', traceback.format_exc())
if DBG: print logm
return None
if r[0][0] in [28, 30]:
if r[0][0] in [10, 28, 30]:
af_type=socket.AF_INET6
elif r[0][0] == 2:
af_type=socket.AF_INET
@@ -296,6 +300,7 @@ if fdaemon:
working_directory='/tmp',
umask=0o002,
pidfile=pidfile,
initgroups=False,
)
context.signal_map = {