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"
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
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
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
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