service.py 598 B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. import os
  3. from comar.service import *
  4. serviceType = "server"
  5. serviceDesc = _({"en": "BIND Daemon",
  6. "tr": "BIND Servisi"})
  7. serviceConf = "named"
  8. PIDFILE = "/run/named/named.pid"
  9. @synchronized
  10. def start():
  11. startService(command="/usr/sbin/named",
  12. args="-u named -n %s %s" % (config.get("CPU", "1"), config.get("OPTIONS", "")),
  13. pidfile=PIDFILE,
  14. donotify=True)
  15. @synchronized
  16. def stop():
  17. stopService(pidfile=PIDFILE,
  18. donotify=True)
  19. def status():
  20. return isServiceRunning(PIDFILE)