Use the argument handler specified by twistd, if any.

This commit is contained in:
Soren Hansen
2010-08-17 16:46:19 +02:00
parent 2bdc03dd8f
commit fa7a91f25e
3 changed files with 19 additions and 2 deletions

View File

@@ -44,6 +44,8 @@ flags.DEFINE_bool('use_syslog', True, 'output to syslog when daemonizing')
flags.DEFINE_string('logfile', None, 'log file to output to')
flags.DEFINE_string('pidfile', None, 'pid file to output to')
flags.DEFINE_string('working_directory', './', 'working directory...')
flags.DEFINE_integer('uid', os.getuid(), 'uid under which to run')
flags.DEFINE_integer('gid', os.getgid(), 'gid under which to run')
def stop(pidfile):
@@ -135,6 +137,8 @@ def daemonize(args, name, main):
threaded=False),
stdin=stdin,
stdout=stdout,
stderr=stderr
stderr=stderr,
uid=FLAGS.uid,
gid=FLAGS.gid
):
main(args)