service.py 642 B

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. from comar.service import *
  3. serviceType = "server"
  4. serviceDesc = _({"en": "AUDIT Daemon",
  5. "tr": "AUDIT Servisi"})
  6. serviceDefault = "on"
  7. @synchronized
  8. def start():
  9. reply = startService(command="/usr/sbin/auditd",
  10. pidfile="/run/auditd.pid",
  11. donotify=True)
  12. if reply == 0:
  13. run("/usr/sbin/auditctl -R /etc/audit/rules.d/audit.rules")
  14. @synchronized
  15. def stop():
  16. stopService(pidfile="/run/auditd.pid",
  17. donotify=True)
  18. run("/usr/sbin/auditctl -D")
  19. def status():
  20. return isServiceRunning("/run/auditd.pid")