def METHOD_NAME(client, cmd):
    home = os.environ.get("CIVET_HOME", os.path.join(os.environ["HOME"], "civet"))
    pfile = os.path.join(home, 'civet_client_%s.pid' % client.client_info["client_name"])
    client_daemon = ClientDaemon(pfile, stdout=client.client_info["log_file"], stderr=client.client_info["log_file"])
    client_daemon.set_client(client)
    if cmd == 'restart':
        client_daemon.restart()
    elif cmd == 'stop':
        client_daemon.stop()
    elif cmd == 'start':
        client_daemon.start()
        print('started')
    elif cmd == 'none':
        client.run()