service.py 734 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. from comar.service import *
  4. serviceType = "server"
  5. serviceDesc = _({"en": "Spam detection daemon",
  6. "tr": "Spam algılama servisi"})
  7. serviceDefault="on"
  8. serviceConf = "spamd"
  9. @synchronized
  10. def start():
  11. startService(command="/usr/bin/spamd",
  12. args="-d -r %s %s %s" % (config.get("PIDFILE", "/run/spamd.pid"), config.get("PARAMS", ""), config.get("EXTRA", "")),
  13. nice = int(config.get("NICELEVEL", "-0")),
  14. donotify=True)
  15. @synchronized
  16. def stop():
  17. stopService(config.get("PIDFILE", "/run/spamd.pid"),
  18. donotify=True)
  19. def status():
  20. return isServiceRunning(config.get("PIDFILE", "/run/spamd.pid"))