From e4082dec4fd3fede3f1ec8e554f98f55b3340cb7 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 26 Sep 2016 16:02:22 +0200 Subject: [PATCH] [platform] fixes for Linux restarter - correct launcher script name - correct parent process termination condition on systemd-based systems --- bin/linux/restart.py | 3 ++- platform/platform-impl/src/com/intellij/util/Restarter.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/linux/restart.py b/bin/linux/restart.py index 9055b0308259..93bf229db65e 100755 --- a/bin/linux/restart.py +++ b/bin/linux/restart.py @@ -9,7 +9,8 @@ import time if len(sys.argv) < 2: raise Exception('At least one argument expected') -while os.getppid() != 1: +pid = os.getppid() +while os.getppid() == pid: time.sleep(0.5) if len(sys.argv) > 2: diff --git a/platform/platform-impl/src/com/intellij/util/Restarter.java b/platform/platform-impl/src/com/intellij/util/Restarter.java index 459085867850..7c932ba8f1bd 100644 --- a/platform/platform-impl/src/com/intellij/util/Restarter.java +++ b/platform/platform-impl/src/com/intellij/util/Restarter.java @@ -34,12 +34,14 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Locale; public class Restarter { private Restarter() { } private static File getLauncherScript() { - return new File(PathManager.getBinPath(), ApplicationNamesInfo.getInstance().getLowercaseProductName() + ".sh"); + String name = ApplicationNamesInfo.getInstance().getProductName().toLowerCase(Locale.US); + return new File(PathManager.getBinPath(), name + ".sh"); } public static boolean isSupported() {