Esempio n. 1
0
def main():
	pids = status.getServerPids()
	if ( len(pids) ):
		plural = "s" if len(pids) > 1 else ''
		pids = " ".join(pids)
		cmd = "kill %s >/dev/null 2>&1; kill -9 %s >/dev/null 2>&1" % (pids, pids)
		output = os.popen(cmd)
		check = status.getServerPids()
		if len(check): check = status.getServerPids() # extra check, just to be sure
		if len(check):
			print "\nUnable to stop Redis Server with PID%s \033[0;31m%s\033[0m\n" % (plural, pids)
		else:
			print "\n\033[0;31mRedis Server stopped\033[0m\n"
	else:
		print "\n\033[0;31mRedis Server is not running\033[0m\n"
Esempio n. 2
0
def main():
	pids = status.getServerPids()
	if len(pids):
		status.serverAlreadyRunning(pids, 'Unable to start server. It is already running')
	else:
		cmd = 'nohup coffee production.coffee > server.log 2>&1&'
		os.popen(cmd)
		time.sleep(0.5)
		buf = open('server.log','r').read()
		print buf
Esempio n. 3
0
def main():
	pids = status.getServerPids()
	if len(pids):
		status.serverAlreadyRunning(pids, 'Unable to start Redis Server. It is already running')
	else:
		cmd = 'redis-server config/redis.conf'
		buf = os.popen(cmd).read();
		if ( len(buf) == 0 ):
			print '\nRedis Server started\n'
		else:
			print buf
Esempio n. 4
0
def main():
    pids = status.getServerPids()
    if len(pids):
        status.serverAlreadyRunning(
            pids, 'Unable to start server. It is already running')
    else:
        cmd = 'nohup coffee production.coffee > server.log 2>&1&'
        os.popen(cmd)
        time.sleep(0.5)
        buf = open('server.log', 'r').read()
        print buf
Esempio n. 5
0
def main():
    pids = status.getServerPids()
    if len(pids):
        status.serverAlreadyRunning(
            pids, 'Unable to start Redis Server. It is already running')
    else:
        cmd = 'redis-server config/redis.conf'
        buf = os.popen(cmd).read()
        if (len(buf) == 0):
            print '\nRedis Server started\n'
        else:
            print buf