def workers(cmd):
    """
    start/stop/restart the workers, or return their status
    """
    if config.dbserver.multi_user and getpass.getuser() != 'openquake':
        sys.exit('oq workers only works in single user mode')

    master = workerpool.WorkerMaster(config.dbserver.host,
                                     **config.zworkers)
    print(getattr(master, cmd)())