From 4c47182a3e6c7d9e09042e6d60f7578f52339a8a Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 14 May 2019 18:37:54 +0200 Subject: #908: Fix bug when killing the old browser before launching the new one. --- .../src/opengnsys/modules/server/OpenGnSys/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py index fd6c1cba..04c7ebc5 100644 --- a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py +++ b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py @@ -118,9 +118,14 @@ class OpenGnSysWorker(ServerWorker): :param url: URL to show """ logger.debug('Launching browser with URL: {}'.format(url)) - if hasattr(self.browser, 'process'): - self.browser['process'].kill() - os.kill(self.browser['process'].pid, signal.SIGINT) + # Trying to kill an old browser + try: + os.kill(self.browser['process'].pid, signal.SIGKILL) + except OSError: + logger.warn('Cannot kill the old browser process') + except KeyError: + # There is no previous browser + pass self.browser['url'] = url self.browser['process'] = subprocess.Popen(['browser', '-qws', url]) -- cgit v1.2.3-18-g5258