service.py 811 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. from comar.service import *
  2. serviceType = "local"
  3. serviceDesc = _({
  4. "en": "Display Manager",
  5. "tr": "Görüntü Yöneticisi",
  6. })
  7. serviceDefault = "on"
  8. pidFile = "/run/dm.pid"
  9. @synchronized
  10. def start(boot=False):
  11. if status():
  12. return
  13. #startDependencies("acpid")
  14. startService(command="/usr/bin/start-dm",
  15. args="--boot" if boot else None,
  16. detach=True,
  17. pidfile=pidFile,
  18. makepid=True,
  19. donotify=True)
  20. @synchronized
  21. def stop():
  22. stopService(pidfile=pidFile,
  23. donotify=True)
  24. def status():
  25. return isServiceRunning(pidFile)
  26. def ready():
  27. from pardus.sysutils import get_kernel_option
  28. if is_on() == "on" and "off" not in get_kernel_option("xorg"):
  29. start(boot=True)