setup.py 458 B

1234567891011121314151617
  1. import subprocess
  2. import sys
  3. import os
  4. import setup_util
  5. def start(args, logfile, errfile):
  6. subprocess.Popen("dudac -w $TROOT/webservice -p 2001", shell=True, stderr=errfile, stdout=logfile);
  7. return 0
  8. def stop(logfile, errfile):
  9. p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
  10. out, err = p.communicate()
  11. for line in out.splitlines():
  12. if 'monkey' in line:
  13. pid = int(line.split(None, 2)[1])
  14. os.kill(pid, 15)
  15. return 0