#!/usr/bin/env python2 import util.cleanup as cleanup import util.system as system import util.cfg as cfg import util.cred as cred import util.openssl as openssl import util.remote as remote from util.log import log import sys import subprocess import os kojihub_name = "koji" remote.require_container(kojihub_name) koji_ca = openssl.CA(cred.ca_key, cred.ca_crt, cred.ca_serial) builder_name = system.hostname() builder_user = cred.make_user(builder_name) if not os.path.exists(builder_user.key): log.info("Creating builder credentials") openssl.make_user_certificate(builder_user, koji_ca) log.info("Configure Koji Builder") with cfg.mod_ini("/etc/kojid/kojid.conf") as i: i.kojid.cert = builder_user.pem else: log.info("Builder credentials already exist") def shutdown(*args):
#!/usr/bin/env python2 import util.cleanup as cleanup import util.tail as tail import util.system as system import util.remote as remote from util.log import log import sys kojidatabase_name = "kojidatabase" remote.require_container(kojidatabase_name) remote.wait_if_not_up(kojidatabase_name, 5432) services = ["httpd"] if not "nokojira" in sys.argv: services.append("kojira") def shutdown(*args): for service in reversed(services): log.info("Stopping {0}".format(service)) system.service(service, "stop") cleanup.register_excepthook(shutdown) cleanup.register_sig_handler(shutdown) for service in services: log.info("Starting {0}".format(service)) system.service(service, "start") log.info("Monitoring httpd log")
#!/usr/bin/env python2 import util.cleanup as cleanup import util.tail as tail import util.system as system import util.remote as remote from util.log import log import sys kojidatabase_name = "kojidatabase" remote.require_container(kojidatabase_name) remote.wait_if_not_up(kojidatabase_name, 5432) services = ["httpd"] if not "nokojira" in sys.argv: services.append("kojira") def shutdown(*args): for service in reversed(services): log.info("Stopping {0}".format(service)) system.service(service, "stop") cleanup.register_excepthook(shutdown) cleanup.register_sig_handler(shutdown) for service in services: log.info("Starting {0}".format(service)) system.service(service, "start")
#!/usr/bin/env python2 import util.cleanup as cleanup import util.system as system import util.cfg as cfg import util.cred as cred import util.openssl as openssl import util.remote as remote from util.log import log import sys import subprocess import os kojihub_name = "koji" remote.require_container(kojihub_name) koji_ca = openssl.CA(cred.ca_key, cred.ca_crt, cred.ca_serial) builder_name = system.hostname() builder_user = cred.make_user(builder_name) if not os.path.exists(builder_user.key): log.info("Creating builder credentials") openssl.make_user_certificate(builder_user, koji_ca) log.info("Configure Koji Builder") with cfg.mod_ini("/etc/kojid/kojid.conf") as i: i.kojid.cert = builder_user.pem else: log.info("Builder credentials already exist") def shutdown(*args): log.info("Stopping")