You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -527,8 +552,37 @@
args=IB_WEB_API_PROC,
cwd=self.client_portal_folder
).pid
-
- return self.server_process
+
+ elif self._operating_system == 'linux':
+ IB_WEB_API_PROC = [self.client_portal_folder+r"/bin/run.sh",r"root/conf.yaml"]
+ process = subprocess.Popen(
+ args=IB_WEB_API_PROC,
+ cwd=self.client_portal_folder,
+ stdout=subprocess.PIPE, universal_newlines=True
+ ).pid
+ time.sleep(2)
+ # get the right process by psutil, the above process takes the pid from run.sh, not the java one
+ for proc in psutil.process_iter():
+ try:
+ processID = proc.pid
+ # processName = proc.name()
+ cmd = proc.cmdline()
+ if any(r"root/conf.yaml" in s for s in cmd) and not any('run.sh' in s for s in cmd):
+ self.server_process = processID
+ break
+ except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
+ pass
+ # keep alive process
+ IB_WEB_ALIVE = r'while true; do /usr/bin/sleep 300; /usr/bin/curl -ks '+self.ib_gateway_path+'/v1/portal/tickle; done'
+ self.server_alive = subprocess.Popen(args=[IB_WEB_ALIVE], shell=True).pid
+
+ return self.server_process,self.server_alive
The text was updated successfully, but these errors were encountered:
client.py
The text was updated successfully, but these errors were encountered: