[platform] fixes for Linux restarter

- correct launcher script name
- correct parent process termination condition on systemd-based systems
This commit is contained in:
Roman Shevchenko
2016-09-26 16:02:43 +02:00
parent 136bb52aae
commit e4082dec4f
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -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:
@@ -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() {