service.py 699 B

12345678910111213141516171819202122232425262728293031323334
  1. # -*- coding: utf-8 -*-
  2. import os
  3. from comar.service import *
  4. serviceType = "server"
  5. serviceDesc = _({"en": "RPCbind Daemon",
  6. "tr": "RPCbind Servisi"})
  7. serviceConf = "rpcbind"
  8. PIDFILE = "/var/run/rpcbind.pid"
  9. @synchronized
  10. def start():
  11. startService(command="/sbin/rpcbind",
  12. args="-f %s" % config.get("RPCBIND_OPTS"),
  13. makepid=True,
  14. detach=True,
  15. pidfile=PIDFILE,
  16. donotify=True)
  17. @synchronized
  18. def stop():
  19. stopService(pidfile=PIDFILE,
  20. donotify=True)
  21. try:
  22. os.unlink(PIDFILE)
  23. except OSError:
  24. pass
  25. def status():
  26. return isServiceRunning(PIDFILE)