diff options
-rw-r--r-- | admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py | 11 |
1 files 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]) |