service.py 724 B

1234567891011121314151617181920212223242526272829
  1. from comar.service import *
  2. import os
  3. serviceType = "local"
  4. serviceDefault = "off"
  5. serviceDesc = _({"en": "Docker Management Service",
  6. "tr": "Docker Yönetim Hizmeti"})
  7. pidfile = "/var/run/docker.pid"
  8. logfile = "/var/log/docker.log"
  9. @synchronized
  10. def start():
  11. os.environ["PATH"] = "/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin"
  12. os.system("/sbin/modprobe -va bridge nf_nat br_netfilter")
  13. startService(command="/usr/bin/dockerd",
  14. detach=True,
  15. pidfile=pidfile,
  16. donotify=True)
  17. @synchronized
  18. def stop():
  19. stopService(command="/usr/bin/dockerd",
  20. donotify=True)
  21. def status():
  22. return isServiceRunning(pidfile)