[platform] logs optional command exit code in Unix restarter
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 5 Apr 2018 17:42:37 +0000 (19:42 +0200)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 5 Apr 2018 17:42:37 +0000 (19:42 +0200)
bin/linux/restart.py

index 241e5a187cde2c64a0c883bae05c32c3a8c9447a..57f0b1d1f11a56161883f6a69055047c30675233 100755 (executable)
@@ -20,7 +20,9 @@ try:
 
     if len(sys.argv) > 3:
         to_launch = sys.argv[3:]
-        os.spawnv(os.P_WAIT, to_launch[0], to_launch)
+        ec = os.spawnv(os.P_WAIT, to_launch[0], to_launch)
+        if ec != 0:
+            syslog.syslog(syslog.LOG_ERR, str(to_launch) + ': ' + str(ec))
 
     to_launch = ['/usr/bin/open', sys.argv[2]] if sys.platform == 'darwin' else [sys.argv[2]]
     os.execv(to_launch[0], to_launch)