service.py 646 B

123456789101112131415161718192021222324252627282930
  1. from comar.service import *
  2. import os
  3. serviceType = "server"
  4. serviceDesc = _({"en": "The PHP FastCGI Process Manager",
  5. "tr": "The PHP FastCGI Süreç Yöneticisi"})
  6. PIDFILE = "/run/php-fpm.pid"
  7. CONFIG = "/etc/php/ext/php-fpm.conf"
  8. @synchronized
  9. def start():
  10. startService(command="/usr/sbin/php-fpm",
  11. args="-D -y %s" % CONFIG,
  12. pidfile=PIDFILE,
  13. donotify=True)
  14. @synchronized
  15. def stop():
  16. stopService(pidfile=PIDFILE,
  17. donotify=True)
  18. try:
  19. os.unlink(PIDFILE)
  20. except OSError:
  21. pass
  22. def status():
  23. return isServiceRunning(PIDFILE)