Browse Source

18938 Fixed bugs / rerouting stderr/out

Gemini had an improperly named 'out' file instead of 'logfile'.

php-silex required stderr/stdout rerouting to the logfile.
play-activate-mysql required stderr/stdout rerououng to the logfile.
play-slick was not properly killing its process on call to stop.
Mike Smith 11 years ago
parent
commit
c1d18e4ccd
4 changed files with 16 additions and 14 deletions
  1. 1 1
      gemini/setup.py
  2. 5 5
      php-silex/setup_raw.py
  3. 1 1
      play-activate-mysql/setup.py
  4. 9 7
      play-slick/setup.py

+ 1 - 1
gemini/setup.py

@@ -13,7 +13,7 @@ def start(args, logfile):
   try:
     subprocess.call("mkdir classes", shell=True, cwd="gemini/Docroot/WEB-INF", stderr=logfile, stdout=logfile)
     subprocess.check_call("ant compile", shell=True, cwd="gemini", stderr=logfile, stdout=logfile)
-    subprocess.check_call("$RESIN_HOME/bin/resinctl -conf $HOME/FrameworkBenchmarks/gemini/Docroot/WEB-INF/resin.xml start", shell=True, stderr=out, stdout=out)
+    subprocess.check_call("$RESIN_HOME/bin/resinctl -conf $HOME/FrameworkBenchmarks/gemini/Docroot/WEB-INF/resin.xml start", shell=True, stderr=logfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1

+ 5 - 5
php-silex/setup_raw.py

@@ -12,17 +12,17 @@ def start(args, logfile):
   setup_util.replace_text("php-silex/deploy/nginx_raw.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
 
   try:
-    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-silex")
-    subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-silex/deploy/php-fpm.pid", shell=True)
-    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-silex/deploy/nginx_raw.conf", shell=True)
+    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-silex", stderr=logfile, stdout=logfile)
+    subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-silex/deploy/php-fpm.pid", shell=True, stderr=logfile, stdout=logfile)
+    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-silex/deploy/nginx_raw.conf", shell=True, stderr=logfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1
 
 def stop(logfile):
   try:
-    subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True)
-    subprocess.call("sudo kill -QUIT $( cat php-silex/deploy/php-fpm.pid )", shell=True)
+    subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True, stderr=logfile, stdout=logfile)
+    subprocess.call("sudo kill -QUIT $( cat php-silex/deploy/php-fpm.pid )", shell=True, stderr=logfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1

+ 1 - 1
play-activate-mysql/setup.py

@@ -8,7 +8,7 @@ from zipfile import ZipFile
 def start(args, logfile):
   setup_util.replace_text("play-activate-mysql/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
 
-  subprocess.check_call("play clean dist", shell=True, cwd="play-activate-mysql")
+  subprocess.check_call("play clean dist", shell=True, cwd="play-activate-mysql", stderr=logfile, stdout=logfile)
 
   if os.name == 'nt':
     ZipFile("./play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT.zip").extractall("./play-activate-mysql/target/universal")

+ 9 - 7
play-slick/setup.py

@@ -27,15 +27,17 @@ def stop(logfile):
       pid = int(f.read())
       os.kill(pid, 9)
   else:
-    p = subprocess.Popen(['ps', 'ef'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'NettyServer' in line:
-        pid = int(line.split(None, 2)[1])
-        os.kill(pid, 9)
+    #p = subprocess.Popen(['ps', 'ef'], stdout=subprocess.PIPE)
+    #out, err = p.communicate()
+    #for line in out.splitlines():
+    #  if 'NettyServer' in line:
+    #    pid = int(line.split(None, 2)[1])
+    #    os.kill(pid, 9)
+    with open("./play-slick/target/universal/play-slick-1.0-SNAPSHOT/play-slick-1.0-SNAPSHOT/RUNNING_PID")
 
   try:
-    os.remove("play-slick/target/universal/play-slick-1.0-SNAPSHOT/RUNNING_PID")
+    #os.remove("play-slick/target/universal/play-slick-1.0-SNAPSHOT/RUNNING_PID")
+    os.remove("play-slick/target/universal/play-slick-1.0-SNAPSHOT/play-slick-1.0-SNAPSHOT/RUNNING_PID")
   except OSError:
     pass