mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-09 05:14:22 +00:00
py-i2phosts-master: unify import
This commit is contained in:
parent
99bcf464bc
commit
285ca6d4f9
@ -13,9 +13,9 @@ import threading
|
|||||||
import daemon
|
import daemon
|
||||||
# workaround for python-daemon >= 1.6
|
# workaround for python-daemon >= 1.6
|
||||||
try:
|
try:
|
||||||
import daemon.pidlockfile
|
import daemon.pidlockfile as pidfile
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import daemon.pidfile
|
import daemon.pidfile as pidfile
|
||||||
|
|
||||||
class Thread(threading.Thread):
|
class Thread(threading.Thread):
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ else:
|
|||||||
|
|
||||||
if not args.debug and not args.verbose:
|
if not args.debug and not args.verbose:
|
||||||
# get pid object for daemon
|
# get pid object for daemon
|
||||||
pid = daemon.pidlockfile.TimeoutPIDLockFile(config['pid_file'], 10)
|
pid = pidfile.TimeoutPIDLockFile(config['pid_file'], 10)
|
||||||
# create daemon context
|
# create daemon context
|
||||||
d = daemon.DaemonContext(pidfile=pid, umask=077)
|
d = daemon.DaemonContext(pidfile=pid, umask=077)
|
||||||
# write stderr to logfile # FIXME: and how we will deal with log rotation?
|
# write stderr to logfile # FIXME: and how we will deal with log rotation?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user