run script

fix server restart
This commit is contained in:
breakwa11 2015-06-15 12:00:00 +08:00
parent 9b7dab692b
commit 99db626225
4 changed files with 13 additions and 1 deletions

View file

@ -118,7 +118,7 @@ class DbTransfer(object):
logging.info('db stop server at port [%s] reason: password changed' % (port,))
ServerPool.get_instance().del_server(port)
if allow and ServerPool.get_instance().server_is_run(port) == 0:
elif allow and ServerPool.get_instance().server_run_status(port) is False:
logging.info('db start server at port [%s] pass [%s]' % (port, passwd))
ServerPool.get_instance().new_server(port, passwd)

6
run.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/bash
eval $(ps -ef | grep "[0-9] python server\\.py" | awk '{print "kill "$2}')
nohup python server.py >> ssserver.log 2>&1 &
tail -f ssserver.log

3
stop.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
eval $(ps -ef | grep "[0-9] python server\\.py" | awk '{print "kill "$2}')

3
tail.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
tail -f ssserver.log