Browse Source

run script

fix server restart
dev
breakwa11 10 years ago
parent
commit
99db626225
  1. 2
      db_transfer.py
  2. 6
      run.sh
  3. 3
      stop.sh
  4. 3
      tail.sh

2
db_transfer.py

@ -118,7 +118,7 @@ class DbTransfer(object):
logging.info('db stop server at port [%s] reason: password changed' % (port,)) logging.info('db stop server at port [%s] reason: password changed' % (port,))
ServerPool.get_instance().del_server(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)) logging.info('db start server at port [%s] pass [%s]' % (port, passwd))
ServerPool.get_instance().new_server(port, passwd) ServerPool.get_instance().new_server(port, passwd)

6
run.sh

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

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

3
tail.sh

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