README 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ##pysystemd
  2. a systemd binding Library in python
  3. its Support python 2.7, python3
  4. ### install
  5. to install pysystemd use pip install pysystemd
  6. ### How to use
  7. this library contains 3 classes
  8. 1- status
  9. this class Contain Methods to query the status of the services
  10. it take the service name as Parameter
  11. to check if the service running or not you can use()
  12. is_running
  13. """ if the service running return 0. """
  14. to check if the service enable or not you can use
  15. is_enable()
  16. """ if the service enabled return 0. """
  17. 2- services
  18. this class use to """manage the services like running and stop and reboot."""
  19. it take the service name as Parameter
  20. to run service use
  21. start()
  22. return 0 if Succeed.
  23. to stop service use
  24. stop()
  25. return 0 if Succeed.
  26. to restart service use restart()
  27. to relode service
  28. use relode()
  29. 3- list_services
  30. this class use to list services
  31. to list all services
  32. use list_all()
  33. its return services names as list
  34. to list all running services
  35. use list_running()
  36. its return running services as list
  37. to list all not running services
  38. use
  39. list_dont_running()
  40. its return dont running services as list
  41. to list all enable services
  42. use()
  43. list_enable
  44. its return all enabled services as list
  45. to list all disable services
  46. use
  47. list_disable()
  48. its return all disabled services as list