From 143038cf992d8e8aa980f470c0f5d254530e251e Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 3 Sep 2015 14:34:24 +0300 Subject: [PATCH] Improve Linux scripts --- .gdbinit | 10 ++++++++++ salome_pid.py | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .gdbinit create mode 100755 salome_pid.py diff --git a/.gdbinit b/.gdbinit new file mode 100644 index 000000000..a90a4d59d --- /dev/null +++ b/.gdbinit @@ -0,0 +1,10 @@ +set pagination off +set logging file gdb.txt +set logging redirect on +set logging on +catch throw +echo Run application in GDB +continue +backtrace full +set logging off +quit diff --git a/salome_pid.py b/salome_pid.py new file mode 100755 index 000000000..6a32bf4ba --- /dev/null +++ b/salome_pid.py @@ -0,0 +1,18 @@ +#!/bin/env python + +import sys, pickle +from killSalome import * + +process = sys.argv[2] #SALOME_Session_Server" + +salome_port = sys.argv[1] +filedict = getPiDict(salome_port) +process_ids = pickle.load(open(filedict, 'r')) + +pid = -1 +for list_item in process_ids: + for _pid, name_list in list_item.items(): + if process in name_list: + pid = _pid + +print pid -- 2.39.2