Exemplo n.º 1
0
def uninstall_couchdb():
    '''
    Uninstall CouchDB 1.3.0 or 1.5.0
    '''
    version = get_couchdb_version()
    require.file(
        url='http://apache.crihan.fr/dist/couchdb/source/' +
        '%s/apache-couchdb-%s.tar.gz' % (version, version))
    run('tar -xzvf apache-couchdb-%s.tar.gz' % version)
    with cd('apache-couchdb-%s' % version):
        sudo('./configure')
        sudo('make uninstall')
        sudo('make distclean')
    su_delete('/usr/local/share/couchdb')
    su_delete('/usr/local/lib/couchdb')
    su_delete('/usr/local/var/lib/couchdb')
    su_delete('/usr/local/var/log/couchdb')
    su_delete('/usr/local/var/run/couchdb')
    su_delete('/usr/local/share/doc/couchdb')
    su_delete('/usr/local/bin/couchjs')
    su_delete('/usr/local/bin/couchdb')
    su_delete('apache-couchdb-%s' % version)
    su_delete('apache-couchdb-%s.tar.gz' % version)
    su_delete('/etc/supervisor/conf.d/couchdb.conf')
    su_delete('/etc/cozy/couchdb.login')
    supervisor.update_config()
    print(green('CouchDB %s successfully uninstalled' % version))
Exemplo n.º 2
0
def configure_supervisor():
    directory(remote_config_dir, use_sudo=True)
    if exists(os.path.join(remote_config_dir, "router_log_parser.conf")) is False:
        with lcd(local_config_dir):
            with cd(remote_config_dir):
                put("./router_log_parser.conf", "./", use_sudo=True)
                supervisor.update_config()
Exemplo n.º 3
0
def uninstall_couchdb():
    '''
    Install CouchDB 1.3.0
    '''
    require_file(
        url='http://apache.crihan.fr/dist/couchdb/source/' +
        '1.3.0/apache-couchdb-1.3.0.tar.gz')
    run('tar -xzvf apache-couchdb-1.3.0.tar.gz')
    with cd('apache-couchdb-1.3.0'):
        sudo('./configure')
        sudo('make uninstall')
        sudo('make distclean')
    su_delete('/usr/local/share/couchdb')
    su_delete('/usr/local/lib/couchdb')
    su_delete('/usr/local/var/lib/couchdb')
    su_delete('/usr/local/var/log/couchdb')
    su_delete('/usr/local/var/run/couchdb')
    su_delete('/usr/local/share/doc/couchdb')
    su_delete('/usr/local/bin/couchjs')
    su_delete('/usr/local/bin/couchdb')
    su_delete('apache-couchdb-1.3.0')
    su_delete('apache-couchdb-1.3.0.tar.gz')
    su_delete('/etc/supervisor/conf.d/couchdb.conf')
    su_delete('/etc/cozy/couchdb.login')
    supervisor.update_config()
    print(green('CouchDB 1.3.0 successfully uninstalled'))
Exemplo n.º 4
0
def uninstall_couchdb():
    '''
    Uninstall CouchDB 1.3.0 or 1.5.0
    '''
    version = get_couchdb_version()
    require.file(url='http://apache.crihan.fr/dist/couchdb/source/' +
                 '%s/apache-couchdb-%s.tar.gz' % (version, version))
    run('tar -xzvf apache-couchdb-%s.tar.gz' % version)
    with cd('apache-couchdb-%s' % version):
        sudo('./configure')
        sudo('make uninstall')
        sudo('make distclean')
    su_delete('/usr/local/share/couchdb')
    su_delete('/usr/local/lib/couchdb')
    su_delete('/usr/local/var/lib/couchdb')
    su_delete('/usr/local/var/log/couchdb')
    su_delete('/usr/local/var/run/couchdb')
    su_delete('/usr/local/share/doc/couchdb')
    su_delete('/usr/local/bin/couchjs')
    su_delete('/usr/local/bin/couchdb')
    su_delete('apache-couchdb-%s' % version)
    su_delete('apache-couchdb-%s.tar.gz' % version)
    su_delete('/etc/supervisor/conf.d/couchdb.conf')
    su_delete('/etc/cozy/couchdb.login')
    # removes dependency of CouchDB
    require.deb.uninstall('erlang', False, ['--auto-remove'])
    supervisor.update_config()
    print(green('CouchDB %s successfully uninstalled' % version))
Exemplo n.º 5
0
def uninstall_couchdb():
    """
    Install CouchDB 1.3.0
    """
    require_file(url='http://apache.crihan.fr/dist/couchdb/source/' +
                 '1.3.0/apache-couchdb-1.3.0.tar.gz')
    run('tar -xzvf apache-couchdb-1.3.0.tar.gz')
    with cd('apache-couchdb-1.3.0'):
        sudo('./configure')
        sudo('make uninstall')
        sudo('make distclean')
    su_delete('/usr/local/share/couchdb')
    su_delete('/usr/local/lib/couchdb')
    su_delete('/usr/local/var/lib/couchdb')
    su_delete('/usr/local/var/log/couchdb')
    su_delete('/usr/local/var/run/couchdb')
    su_delete('/usr/local/share/doc/couchdb')
    su_delete('/usr/local/bin/couchjs')
    su_delete('/usr/local/bin/couchdb')
    su_delete('apache-couchdb-1.3.0')
    su_delete('apache-couchdb-1.3.0.tar.gz')
    su_delete('/etc/supervisor/conf.d/couchdb.conf')
    su_delete('/etc/cozy/couchdb.login')
    supervisor.update_config()
    print(green("CouchDB 1.3.0 successfully uninstalled"))
Exemplo n.º 6
0
def setup_supervisor():
    site_root = join(home_directory(SITE_USER), 'site')
    upload_template('researchcompendia.conf',
                    '/etc/supervisor/conf.d/researchcompendia_web.conf',
                    context={
                        'command':
                        join(site_root, 'bin', 'runserver.sh'),
                        'user':
                        SITE_USER,
                        'group':
                        SITE_GROUP,
                        'logfile':
                        join(site_root, 'logs', 'gunicorn_supervisor.log'),
                    },
                    use_jinja=True,
                    use_sudo=True,
                    template_dir=TEMPLATE_DIR)
    upload_template('celeryd.conf',
                    '/etc/supervisor/conf.d/celeryd.conf',
                    context={
                        'command': join(site_root, 'bin', 'celeryworker.sh'),
                        'user': SITE_USER,
                        'group': SITE_GROUP,
                        'logfile': join(site_root, 'logs',
                                        'celery_worker.log'),
                    },
                    use_jinja=True,
                    use_sudo=True,
                    template_dir=TEMPLATE_DIR)
    supervisor.update_config()
Exemplo n.º 7
0
def install_services():
    install_redis()
    run('rm -rf /tmp/redis')
    require.file('/etc/redis.conf', source='files/redis.conf', use_sudo=True)
    require.file('/etc/redis_cache.conf', source='files/redis_cache.conf', use_sudo=True)
    if not files.exists('/var/run/supervisor.sock'):
        sudo('supervisord -c /etc/supervisor/supervisord.conf')
    supervisor.update_config()
    install_fluentd()
Exemplo n.º 8
0
def deploy():
    info('[deploy] Starting Deploy: %s -> %s' % (env.app, env.host_string))
    git_push()
    with cd(env.app_path), shell_env(**env.shell_envs_dict):
        ensure_packages()
        one_offs()
    supervisor.update_config()
    supervisor.restart_process('all')
    ft_service.restart('nginx')
    success('[deploy] Finished Deploy: %s -> %s' % (env.app, env.host_string))
Exemplo n.º 9
0
def uninstall_cozy():
    '''
    Uninstall postfix.
    '''
    supervisor.stop_process('cozy-controller')
    supervisor.stop_process('cozy-indexer')
    su_delete('/usr/local/var/cozy-indexer')
    su_delete('/etc/supervisor/conf.d/cozy-controller.conf')
    su_delete('/etc/supervisor/conf.d/cozy-indexer.conf')
    supervisor.update_config()
    print(green('Cozy successfully uninstalled'))
Exemplo n.º 10
0
def uninstall_cozy():
    '''
    Uninstall postfix.
    '''
    supervisor.stop_process('cozy-controller')
    supervisor.stop_process('cozy-indexer')
    su_delete('/usr/local/var/cozy-indexer')
    su_delete('/etc/supervisor/conf.d/cozy-controller.conf')
    su_delete('/etc/supervisor/conf.d/cozy-indexer.conf')
    supervisor.update_config()
    print(green('Cozy successfully uninstalled'))
Exemplo n.º 11
0
def uninstall_cozy():
    """
    Uninstall postfix.
    """
    supervisor.stop_process("cozy-controller")
    supervisor.stop_process("cozy-indexer")
    su_delete("/usr/local/var/cozy-indexer")
    su_delete('/etc/supervisor/conf.d/cozy-controller.conf')
    su_delete('/etc/supervisor/conf.d/cozy-indexer.conf')
    supervisor.update_config()
    print(green("Cozy successfully uninstalled"))
Exemplo n.º 12
0
def uninstall_cozy():
    """
    Uninstall postfix.
    """
    supervisor.stop_process("cozy-controller")
    supervisor.stop_process("cozy-indexer")
    su_delete("/usr/local/var/cozy-indexer")
    su_delete('/etc/supervisor/conf.d/cozy-controller.conf')
    su_delete('/etc/supervisor/conf.d/cozy-indexer.conf')
    supervisor.update_config()
    print(green("Cozy successfully uninstalled"))
Exemplo n.º 13
0
def uninstall_redis():
    '''
    Uninstall Redis 2.4.14
    '''
    su_delete('/var/lib/redis')
    su_delete('/var/db/redis')
    su_delete('/var/log/redis')
    su_delete('/var/run/redis')
    su_delete('/opt/redis-2.4.14')
    su_delete('/etc/redis')
    su_delete('/etc/supervisor/conf.d/redis_cozy.conf')
    supervisor.update_config()
    print(green("Redis 2.4.14 successfully uninstalled"))
Exemplo n.º 14
0
def uninstall_redis():
    '''
    Uninstall Redis 2.4.14
    '''
    su_delete('/var/lib/redis')
    su_delete('/var/db/redis')
    su_delete('/var/log/redis')
    su_delete('/var/run/redis')
    su_delete('/opt/redis-2.4.14')
    su_delete('/etc/redis')
    su_delete('/etc/supervisor/conf.d/redis_cozy.conf')
    supervisor.update_config()
    print(green('Redis 2.4.14 successfully uninstalled'))
Exemplo n.º 15
0
def deploy_supervisor():
    upload_template('supervised_process.conf.j2',
                    '/etc/supervisor/conf.d/%s.conf' % SITE_NAME,
                    context={
                        'supervised_process': SITE_NAME,
                        'site_dir': SITE_DIR,
                        'site_user': SITE_USER,
                        'group': SITE_USER,
                    },
                    template_dir=TEMPLATE_DIR,
                    use_jinja=True,
                    use_sudo=True)
    supervisor.update_config()
Exemplo n.º 16
0
def setup_supervisor():
    site_root = join(home_directory(SITE_USER), 'site')
    upload_template('veyepar.conf', 
        '/etc/supervisor/conf.d/veyepar.conf',
        context={
            'command': join(site_root, 'bin', 'runserver.sh'),
            'user': SITE_USER,
            'group': SITE_GROUP,
            'logfile': join(site_root, 'logs', 'gunicorn_supervisor.log'),

        },
        use_jinja=True, use_sudo=True)
    supervisor.update_config()
Exemplo n.º 17
0
def deploy_supervisor():
    upload_template('supervised_process.conf.j2',
                    '/etc/supervisor/conf.d/%s.conf' % SITE_NAME,
                    context={
                        'supervised_process': SITE_NAME,
                        'site_dir': SITE_DIR,
                        'site_user': SITE_USER,
                        'group': SITE_USER,
                    },
                    template_dir=TEMPLATE_DIR,
                    use_jinja=True,
                    use_sudo=True)
    supervisor.update_config()
Exemplo n.º 18
0
def stop(app, maintenance_hours=1):
    """pause app by changing the supervisord config

    create a maintenance page giving a date when we expect the service will be back
    :param maintenance_hours: Number of hours we expect the downtime to last.
    """
    if maintenance_hours is not None:
        require.directory(str(app.www_dir), use_sudo=True)
        timestamp = helpers.strfnow(add_hours=maintenance_hours)
        sudo_upload_template('503.html', dest=str(app.www_dir / '503.html'),
                             app_name=app.name, timestamp=timestamp)

    require_supervisor(app.supervisor, app, pause=True)
    supervisor.update_config()
    service.reload('nginx')
Exemplo n.º 19
0
def supervisor_setup():
    upload_template(
        filename='conf/supervisor.conf',
        destination='%(deploy_path)s/supervisor_%(project_name)s.conf' % env,
        context={
            'project_name': env.project_name,
            'deploy_path': env.deploy_path,
            'log_path': env.log_path,
        },
        use_jinja=True
    )

    sudo('ln -s -f %(deploy_path)s/supervisor_%(project_name)s.conf '
         '/etc/supervisor/conf.d/%(project_name)s.conf' % env)
    supervisor.update_config()
    supervisor.restart_process('all')
Exemplo n.º 20
0
def uninstall_cozy():
    """
    Uninstall postfix.
    """
    # TODO : modify for arch
    supervisor.stop_process("cozy-controller")
    supervisor.stop_process("cozy-indexer")
    su_delete("/usr/local/var/cozy-indexer")
    su_delete("/usr/local/cozy-indexer")
    su_delete("/usr/local/cozy")
    su_delete("/home/cozy*")
    su_delete("/etc/cozy")
    su_delete("/etc/nginx/conf.d/cozy.conf")
    su_delete("/etc/supervisor/conf.d/cozy-controller.conf")
    su_delete("/etc/supervisor/conf.d/cozy-indexer.conf")
    supervisor.update_config()
    print(green("Cozy successfully uninstalled"))
Exemplo n.º 21
0
def setup_supervisor():
    site_root = join(home_directory(SITE_USER), 'site')
    upload_template('veyepar.conf',
                    '/etc/supervisor/conf.d/veyepar.conf',
                    context={
                        'command':
                        join(site_root, 'bin', 'runserver.sh'),
                        'user':
                        SITE_USER,
                        'group':
                        SITE_GROUP,
                        'logfile':
                        join(site_root, 'logs', 'gunicorn_supervisor.log'),
                    },
                    use_jinja=True,
                    use_sudo=True)
    supervisor.update_config()
Exemplo n.º 22
0
def setup_supervisor():
    supervised_process = SITE_SETTINGS['supervised_process']
    bindir = join(SITE_DIR, 'bin')
    logdir = join(SITE_DIR, 'logs')
    upload_template('supervised_site.conf',
                    '/etc/supervisor/conf.d/%s.conf' % supervised_process,
                    context={
                        'supervised_process': supervised_process,
                        'command': join(bindir, 'gunicorn.sh'),
                        'user': SITE_SETTINGS['user'],
                        'group': SITE_SETTINGS['group'],
                        'logfile': join(logdir, 'gunicorn.log'),
                        'site_dir': bindir,
                    },
                    use_jinja=True,
                    use_sudo=True,
                    template_dir=TEMPLATE_DIR)
    supervisor.update_config()
Exemplo n.º 23
0
def setup_supervisor():

    # hacky workaround to ???
    sudo('touch /var/run/supervisor.sock')
    sudo('chmod 777 /var/run/supervisor.sock')
    sudo('service supervisor restart')

    site_root = join(home_directory(SITE_USER), 'site')
    upload_template('veyepar.conf', 
        '/etc/supervisor/conf.d/veyepar.conf',
        context={
            'command': join(site_root, 'bin', 'runserver.sh'),
            'user': SITE_USER,
            'group': SITE_GROUP,
            'logfile': join(site_root, 'logs', 'gunicorn_supervisor.log'),

        },
        use_jinja=True, use_sudo=True)
    supervisor.update_config()
Exemplo n.º 24
0
def setup_supervisor():
    supervised_process = SITE_SETTINGS["supervised_process"]
    bindir = join(SITE_DIR, "bin")
    logdir = join(SITE_DIR, "logs")
    upload_template(
        "supervised_site.conf",
        "/etc/supervisor/conf.d/%s.conf" % supervised_process,
        context={
            "supervised_process": supervised_process,
            "command": join(bindir, "gunicorn.sh"),
            "user": SITE_SETTINGS["user"],
            "group": SITE_SETTINGS["group"],
            "logfile": join(logdir, "gunicorn.log"),
            "site_dir": bindir,
        },
        use_jinja=True,
        use_sudo=True,
        template_dir=TEMPLATE_DIR,
    )
    supervisor.update_config()
Exemplo n.º 25
0
def uninstall(app):  # pragma: no cover
    """uninstall the app"""
    for path in (app.nginx_location, app.nginx_site, app.venv_dir):
        if exists(str(path)):
            if path == app.nginx_site:
                nginx.disable(app.nginx_site.name)
            files.remove(str(path), recursive=True, use_sudo=True)

    stop.execute_inner(app)
    if user.exists(app.name):
        if app.stack != 'soundcomparisons':
            sudo('dropdb --if-exists %s' % app.name, user='******')
        else:
            sudo('echo "drop database {0};" | mysql'.format(app.name))
        sudo('userdel -rf %s' % app.name)

    if exists(str(app.supervisor)):
        files.remove(str(app.supervisor), recursive=True, use_sudo=True)

    supervisor.update_config()
    service.reload('nginx')
    systemd.uninstall(app, pathlib.Path(os.getcwd()) / 'systemd')
Exemplo n.º 26
0
def deploy_supervisor():
    """ ensure that our supervisor is configured and enabled """
    require('environment')
    django_settings = 'DJANGO_SETTINGS_MODULE="conf_site.settings.{}"'.format(
        env.environment)
    fabtools.require.supervisor.process(
        'gunicorn',
        command=('/www/conf_site/env/bin/gunicorn conf_site.wsgi:application '
                 '--bind=0.0.0.0:8001 --workers=3 --timeout=180'),
        directory='/www/conf_site/source',
        user=env.webuser,
        stdout_logfile='/www/conf_site/log/gunicorn.log',
        redirect_stderr=True,
        stderr_logfile='/www/conf_site/log/gunicorn.error.log',
        autostart=True,
        autorestart=True,
        stopasgroup=True,
        killasgroup=True,
        stopwaitsecs=60,
        environment=django_settings,
    )
    supervisor.update_config()
    restart_supervisor()
def setup_supervisor():
    site_root = join(home_directory(SITE_USER), 'site')
    upload_template('researchcompendia.conf', 
        '/etc/supervisor/conf.d/researchcompendia_web.conf',
        context={
            'command': join(site_root, 'bin', 'runserver.sh'),
            'user': SITE_USER,
            'group': SITE_GROUP,
            'logfile': join(site_root, 'logs', 'gunicorn_supervisor.log'),

        },
        use_jinja=True, use_sudo=True, template_dir=TEMPLATE_DIR)
    upload_template('celeryd.conf', 
        '/etc/supervisor/conf.d/celeryd.conf',
        context={
            'command': join(site_root, 'bin', 'celeryworker.sh'),
            'user': SITE_USER,
            'group': SITE_GROUP,
            'logfile': join(site_root, 'logs', 'celery_worker.log'),

        },
        use_jinja=True, use_sudo=True, template_dir=TEMPLATE_DIR)
    supervisor.update_config()
Exemplo n.º 28
0
def deploy_supervisor():
    upload_template('deployment/scipyla2016.conf',
                    '/etc/supervisor/conf.d/scipyla2016.conf',
                    use_sudo=True)
    supervisor.update_config()
Exemplo n.º 29
0
def start(app):
    """start app by changing the supervisord config"""
    require_supervisor(app.supervisor, app)
    supervisor.update_config()
    service.reload('nginx')
Exemplo n.º 30
0
def restart_supervisor():
    print(green("Restating Supervisor"))
    supervisor.update_config()
    supervisor.restart_process(settings.PROJECT_NAME)
Exemplo n.º 31
0
def update_config():
    supervisor.update_config()
Exemplo n.º 32
0
def restart_geotaxi():
    supervisor.update_config()
    supervisor.restart_process('geotaxi')
Exemplo n.º 33
0
def deploy_supervisor():
    upload_template('deployment/scipy2014.conf',
                    '/etc/supervisor/conf.d/scipy2014.conf',
                    use_sudo=True)
    supervisor.update_config()
Exemplo n.º 34
-1
def deploy():
    load_config()
    install_machine()
    deploy_geoserver()
    supervisor.update_config()
    restart_services()
    restart_geotaxi()
    deploy_api()