service.py 622 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/python
  2. #-*- coding: UTF-8 -*-
  3. from comar.service import *
  4. import os
  5. serviceType = "server"
  6. serviceDesc = _({
  7. "en": "GNOME Desktop",
  8. "tr": "GNOME Masaüstü",
  9. })
  10. serviceDefault="on"
  11. PIDFILE="/run/gdm/gdm.pid"
  12. DAEMON="/usr/sbin/gdm"
  13. @synchronized
  14. def start():
  15. startService(command=DAEMON,
  16. pidfile=PIDFILE,
  17. detach=True,
  18. donotify=True)
  19. @synchronized
  20. def stop():
  21. stopService(pidfile=PIDFILE,
  22. donotify=True)
  23. try:
  24. os.unlink(PIDFILE)
  25. except OSError:
  26. pass
  27. def status():
  28. return isServiceRunning(PIDFILE)