remove ci/mastersrever|roomserver
This commit is contained in:
parent
cc6c4ffa5e
commit
704016d190
@ -1,14 +0,0 @@
|
||||
cd third_party/matchvs/server/masterserver
|
||||
python ../tools/scripts/construct/build_pb.py
|
||||
cmake .
|
||||
make clean
|
||||
make
|
||||
cp ../bin/masterserver ../../../../bin/
|
||||
|
||||
cd ../../../../
|
||||
|
||||
tag_name=`git status |grep '# On branch '|sed 's/# On branch //g'`
|
||||
dir_name=`basename $PWD`
|
||||
package_name=${dir_name}.tar.gz
|
||||
|
||||
tar --exclude=*.git -chzf target/${package_name} bin reload.sh restart.sh start_instance.sh manage.py config
|
@ -1,74 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
#coding utf8
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
def getRuningProgramPids(progname):
|
||||
pids = []
|
||||
lines = os.popen('ps -ef | grep %s' % progname).readlines()
|
||||
for l in lines:
|
||||
line = ''
|
||||
oldc = ''
|
||||
for c in l.strip():
|
||||
if c in [' ', '\t'] and c == oldc:
|
||||
continue
|
||||
oldc = c
|
||||
line += c
|
||||
line = line.split(' ')
|
||||
|
||||
if line[7] == './%s' % progname:
|
||||
pids.append(line[1])
|
||||
return pids
|
||||
|
||||
def getExePath(pid):
|
||||
return os.popen('ls -l /proc/%d | grep "exe ->" | cut -d " " -f 7-' % int(pid)).read()
|
||||
|
||||
def getExeCmdLine(pid):
|
||||
return os.popen('cat /proc/%d/cmdline' % int(pid)).read()
|
||||
|
||||
def stop(instance_id):
|
||||
masterserver_ids = getRuningProgramPids('masterserver')
|
||||
pids = masterserver_ids
|
||||
for pid in pids:
|
||||
exepath = getExePath(pid)
|
||||
cmdline = getExeCmdLine(pid)
|
||||
if cmdline == ("./masterserver\0-i\0%d\0" % instance_id):
|
||||
os.popen('kill -9 %d' % int(pid))
|
||||
|
||||
def listserver():
|
||||
masterserver_ids = getRuningProgramPids('masterserver')
|
||||
pids = masterserver_ids
|
||||
for pid in pids:
|
||||
exepath = getExePath(pid)
|
||||
cmdline = getExeCmdLine(pid)
|
||||
print pid, exepath, cmdline
|
||||
|
||||
def restartServer(str_instance_ids):
|
||||
instance_ids = str_instance_ids.split(',')
|
||||
for instance_id in instance_ids:
|
||||
instance_id = int(instance_id)
|
||||
stop(instance_id)
|
||||
time.sleep(0.5)
|
||||
print 'masterserver %d starting......' % instance_id
|
||||
cmd = 'sh start_instance.sh %d' % (instance_id)
|
||||
os.popen(cmd)
|
||||
time.sleep(0.5)
|
||||
|
||||
def printHelp():
|
||||
print 'usuage: [restart]'
|
||||
|
||||
def main(argv):
|
||||
if len(argv) == 1:
|
||||
printHelp()
|
||||
else:
|
||||
if argv[1] == 'restart':
|
||||
restartServer(argv[2])
|
||||
elif argv[1] == 'stop':
|
||||
stop()
|
||||
elif argv[1] == 'list':
|
||||
listserver()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
python manage.py restart $1
|
||||
|
||||
echo 'success'
|
@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd bin
|
||||
`nohup ./masterserver -i $1 >> masterserver$1.out 2>&1 &`
|
@ -1,14 +0,0 @@
|
||||
cd third_party/matchvs/server/roomserver
|
||||
python ../tools/scripts/construct/build_pb.py
|
||||
cmake .
|
||||
make clean
|
||||
make
|
||||
cp ../bin/roomserver ../../../../bin/
|
||||
|
||||
cd ../../../../
|
||||
|
||||
tag_name=`git status |grep '# On branch '|sed 's/# On branch //g'`
|
||||
dir_name=`basename $PWD`
|
||||
package_name=${dir_name}.tar.gz
|
||||
|
||||
tar --exclude=*.git -chzf target/${package_name} bin reload.sh restart.sh start_instance.sh manage.py config
|
@ -1,74 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
#coding utf8
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
def getRuningProgramPids(progname):
|
||||
pids = []
|
||||
lines = os.popen('ps -ef | grep %s' % progname).readlines()
|
||||
for l in lines:
|
||||
line = ''
|
||||
oldc = ''
|
||||
for c in l.strip():
|
||||
if c in [' ', '\t'] and c == oldc:
|
||||
continue
|
||||
oldc = c
|
||||
line += c
|
||||
line = line.split(' ')
|
||||
|
||||
if line[7] == './%s' % progname:
|
||||
pids.append(line[1])
|
||||
return pids
|
||||
|
||||
def getExePath(pid):
|
||||
return os.popen('ls -l /proc/%d | grep "exe ->" | cut -d " " -f 7-' % int(pid)).read()
|
||||
|
||||
def getExeCmdLine(pid):
|
||||
return os.popen('cat /proc/%d/cmdline' % int(pid)).read()
|
||||
|
||||
def stop(instance_id):
|
||||
roomserver_ids = getRuningProgramPids('roomserver')
|
||||
pids = roomserver_ids
|
||||
for pid in pids:
|
||||
exepath = getExePath(pid)
|
||||
cmdline = getExeCmdLine(pid)
|
||||
if cmdline == ("./roomserver\0-i\0%d\0" % instance_id):
|
||||
os.popen('kill -9 %d' % int(pid))
|
||||
|
||||
def listserver():
|
||||
roomserver_ids = getRuningProgramPids('roomserver')
|
||||
pids = roomserver_ids
|
||||
for pid in pids:
|
||||
exepath = getExePath(pid)
|
||||
cmdline = getExeCmdLine(pid)
|
||||
print pid, exepath, cmdline
|
||||
|
||||
def restartServer(str_instance_ids):
|
||||
instance_ids = str_instance_ids.split(',')
|
||||
for instance_id in instance_ids:
|
||||
instance_id = int(instance_id)
|
||||
stop(instance_id)
|
||||
time.sleep(0.5)
|
||||
print 'roomserver %d starting......' % instance_id
|
||||
cmd = 'sh start_instance.sh %d' % (instance_id)
|
||||
os.popen(cmd)
|
||||
time.sleep(0.5)
|
||||
|
||||
def printHelp():
|
||||
print 'usuage: [restart]'
|
||||
|
||||
def main(argv):
|
||||
if len(argv) == 1:
|
||||
printHelp()
|
||||
else:
|
||||
if argv[1] == 'restart':
|
||||
restartServer(argv[2])
|
||||
elif argv[1] == 'stop':
|
||||
stop()
|
||||
elif argv[1] == 'list':
|
||||
listserver()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
python manage.py restart $1
|
||||
|
||||
echo 'success'
|
@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd bin
|
||||
nohup ./roomserver -i $1 >> roomserver$1.out 2>&1 &
|
Loading…
x
Reference in New Issue
Block a user