diff options
author | Adrian Likins <alikins@redhat.com> | 2007-09-25 18:14:18 -0400 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2007-09-25 18:14:18 -0400 |
commit | 14fd0d98b171169e58acf62c86ef1f3a5d5128ee (patch) | |
tree | 58e05c896d45db420ce4d8f46a62c6879e02663c /func | |
parent | 6c38c3128afd8542d086ba998494e02872781b77 (diff) | |
download | third_party-func-14fd0d98b171169e58acf62c86ef1f3a5d5128ee.tar.gz third_party-func-14fd0d98b171169e58acf62c86ef1f3a5d5128ee.tar.xz third_party-func-14fd0d98b171169e58acf62c86ef1f3a5d5128ee.zip |
fix up the wrapper scripts so that --daemon works correctly, and so
the init scripts also work correctly
Diffstat (limited to 'func')
-rwxr-xr-x | func/certmaster.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/func/certmaster.py b/func/certmaster.py index b12ecdb..5305b68 100755 --- a/func/certmaster.py +++ b/func/certmaster.py @@ -28,7 +28,7 @@ import sha #from func.server import codes import func import func.certs - +import func.minion.utils class SimpleConfigFile(object): """simple config file object: @@ -176,3 +176,33 @@ def serve(xmlrpcinstance): server.logRequests = 0 # don't print stuff to console server.register_instance(xmlrpcinstance) server.serve_forever() + + +def main(argv): + + defaults = { 'listen_addr': 'localhost', + 'listen_port': '51235', + 'cadir': '/etc/pki/func/ca', + 'certroot': '/var/lib/func/certmaster/certs', + 'csrroot': '/var/lib/func/certmaster/csrs', + 'autosign': 'false' + } + + + cm = CertMaster('/etc/func/certmaster.conf', defaults) + + if "daemon" in argv or "--daemon" in argv: + func.minion.utils.daemonize("/var/run/certmaster.pid") + else: + print "serving...\n" + + + # just let exceptions bubble up for now + serve(cm) + + + +if __name__ == "__main__": + textdomain(I18N_DOMAIN) + main(sys.argv) + |