service.py 600 B

12345678910111213141516171819202122232425262728
  1. # -*- coding: utf-8 -*-
  2. from comar.service import *
  3. import os
  4. serviceType = "server"
  5. serviceDesc = _({"en": "GNU Krell Monitor Daemon",
  6. "tr": "GNU Krell Sistem Takip Servisi"})
  7. PIDFILE = "/run/gkrellmd.pid"
  8. @synchronized
  9. def start():
  10. startService(command="/usr/bin/gkrellmd",
  11. pidfile=PIDFILE,
  12. makepid=True,
  13. donotify=True)
  14. @synchronized
  15. def stop():
  16. stopService(pidfile=PIDFILE,
  17. donotify=True)
  18. if os.path.exists(PIDFILE):
  19. os.unlink(PIDFILE)
  20. def status():
  21. return isServiceRunning(PIDFILE)