Script execution

This commit is contained in:
sfop
2017-03-30 09:27:07 +02:00
parent 830f71f437
commit aa90b8009c

View File

@@ -308,7 +308,7 @@ if get_context().isServerEnabled():
CAMTOOL_SERVER_SCRIPT = "cc" #"cam_server"
def _get_camtool_port():
return camtool.url[camtool.url.rfind(":")+1:]
return camtool.url[camtool.url.rfind(":")+1:]
def is_camtool_running():
return int(exec_cmd("pgrep " + CAMTOOL_SERVER_SCRIPT + " | wc -l")) > 0
@@ -316,12 +316,11 @@ def is_camtool_running():
def kill_camtool():
ret = exec_cmd("killall -9 " + CAMTOOL_SERVER_SCRIPT)
ret += exec_cmd('pkill -f " \-p ' + _get_camtool_port())
return ret
def _run_camtool():
try:
cmd = "source /opt/gfa/python\n"
cmd = cmd + CAMTOOL_SERVER_SCRIPT + " -p " + _get_camtool_port() + " -b /afs/psi.ch/intranet/SF/Applications/config/camtool_n > /dev/null &"
cmd = cmd + CAMTOOL_SERVER_SCRIPT + " -p " + port + " -b /afs/psi.ch/intranet/SF/Applications/config/camtool_n > /dev/null &"
print exec_cmd(cmd)
except:
import traceback