log.info("Install EPEL") pkg.install( "https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm" ) # # Postgre SQL # log.info("Install PostgreSQL Server") pkg.install("postgresql-server") sql.init_db() log.info("Modify PostgreSQL initscript") with cfg.mod_text("/etc/init.d/postgresql") as p: # Can't write to /proc/self/oom_adj in docker, causes error message on start, so disable index = p.index("PG_OOM_ADJ=-17\n") p[index] = "PG_OOM_ADJ=\n" log.info("Start PostgreSQL Server") postgresql_service = "postgresql" system.service(postgresql_service, "start") log.info("Create koji user") koji_user = "******" koji_db_name = "koji" system.add_system_user(koji_user) log.info("Setup PostgreSQL Koji DB") postgres_user = "******"
from os import rename # # Setup # log.info("General update") pkg.clean() pkg.update() log.info("Install EPEL") pkg.install("https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm") log.info("Modify initscripts' checkpid") # checkpid doesn't handle defunct processes, alter so it does with cfg.mod_text("/etc/init.d/functions") as f: checkpid_start = f.index("checkpid() {\n") checkpid_end = f.index("}\n", checkpid_start) test_index = f.index('\t\t[ -d "/proc/$i" ] && return 0\n', checkpid_start, checkpid_end) f[test_index] = '\t\t[ -e "/proc/$i/exe" ] && return 0\n' # Note that the /etc/hosts file is not writable in docker images/containers # Use this instead: https://docs.docker.com/userguide/dockerlinks/#container-linking # # Koji-Hub # log.info("Install Koji-Hub") pkg.install(["koji-hub", "httpd", "mod_ssl", "mod_wsgi"])
# # Setup # log.info("General update") pkg.clean() pkg.update() log.info("Install EPEL") pkg.install( "https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm" ) log.info("Modify initscripts' checkpid") # checkpid doesn't handle defunct processes, alter so it does with cfg.mod_text("/etc/init.d/functions") as f: checkpid_start = f.index("checkpid() {\n") checkpid_end = f.index("}\n", checkpid_start) test_index = f.index('\t\t[ -d "/proc/$i" ] && return 0\n', checkpid_start, checkpid_end) f[test_index] = '\t\t[ -e "/proc/$i/exe" ] && return 0\n' # Note that the /etc/hosts file is not writable in docker images/containers # Use this instead: https://docs.docker.com/userguide/dockerlinks/#container-linking # # Koji-Hub # log.info("Install Koji-Hub") pkg.install(["koji-hub", "httpd", "mod_ssl", "mod_wsgi"])
pkg.clean() pkg.update() log.info("Install EPEL") pkg.install("https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm") # # Postgre SQL # log.info("Install PostgreSQL Server") pkg.install("postgresql-server") sql.init_db() log.info("Modify PostgreSQL initscript") with cfg.mod_text("/etc/init.d/postgresql") as p: # Can't write to /proc/self/oom_adj in docker, causes error message on start, so disable index = p.index("PG_OOM_ADJ=-17\n") p[index] = "PG_OOM_ADJ=\n" log.info("Start PostgreSQL Server") postgresql_service = "postgresql" system.service(postgresql_service, "start") log.info("Create koji user") koji_user = "******" koji_db_name = "koji" system.add_system_user(koji_user) log.info("Setup PostgreSQL Koji DB") postgres_user = "******"