service.py 662 B

123456789101112131415161718192021222324252627282930
  1. from comar.service import *
  2. serviceType = "local"
  3. serviceDefault = "on"
  4. serviceDesc = _({"en": "PC/SC SmartCard Reader Service",
  5. "tr": "PC/SC Akıllı Kart Okuyucu Servisi"})
  6. PIDFILE = "/run/pcscd/pcscd.pid"
  7. @synchronized
  8. def start():
  9. # pcscd wont start if these exist
  10. import os
  11. try:
  12. os.unlink("/run/pcscd/pcscd.comm")
  13. os.unlink("/run/pcscd/pcscd.pub")
  14. except OSError:
  15. pass
  16. startService(command="/usr/sbin/pcscd",
  17. donotify=True)
  18. @synchronized
  19. def stop():
  20. stopService(pidfile=PIDFILE,
  21. donotify=True)
  22. def status():
  23. return isServiceRunning(pidfile=PIDFILE)