/usr/bin/jsb-stop is in jsonbot 0.84.4-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #!/usr/bin/python
#
#
""" stop a running bot """
## jsb imports
import os, sys
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.getcwd() + os.sep + "..")
os.environ['PATH'] = os.getcwd() + os.sep + 'bin:' + os.environ['PATH']
from jsb.utils.popen import gozerpopen
from jsb.lib.datadir import getdatadir
from jsb.version import getversion
print getversion("STOP")
## basic imports
from subprocess import Popen, PIPE
import os
import sys
## options parser
from optparse import OptionParser
parser = OptionParser(usage='usage: %prog [options] [list of appids]', version='%prog ' + getversion())
parser.add_option('-d', '--datadir', type='string', default=False, dest='datadir', help="datadir to use")
opts, args = parser.parse_args()
opts.args = args
if opts.datadir and not os.path.isdir(opts.datadir): os.mkdir(opts.datadir)
ddir = opts.datadir or getdatadir()
PID = open("%s/run/jsb.pid" % ddir, 'r').read()
print "PID is %s" % PID
execstring = "kill -s TERM %s" % PID
print execstring
proc = Popen(execstring.split())
proc.wait()
|