123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- # Important Note:
- this project has been archived and migrated to codeberg. To access the project on codeberg,
- [visit this Link](https://codeberg.org/alimiracle/pysystemd)
- ##pysystemd
- a systemd binding Library in python
- its Support python 2.7, python3
- ### install
- to install pysystemd use pip install pysystemd
- ### How to use
- this library contains 4 classes
- 1- status
- this class Contain Methods to query the status of the services
- it take the service name as Parameter
- to check if the service running or not you can use()
- is_running
- """ if the service running return 0. """
- to check if the service enable or not you can use
- is_enable()
- """ if the service enabled return 0. """
- 2- services
- this class use to """manage the services like running and stop and reboot."""
- it take the service name as Parameter
- to run service use
- start()
- return 0 if Succeed.
- to stop service use
- stop()
- return 0 if Succeed.
- to restart service use restart()
- to relode service
- use relode()
- 3- list_services
- this class use to list services
- to list all services
- use list_all()
- its return services names as list
- to list all running services
- use list_running()
- its return running services as list
- to list all not running services
- use
- list_dont_running()
- its return dont running services as list
- to list all enable services
- use()
- list_enable
- its return all enabled services as list
- to list all disable services
- use
- list_disable()
- its return all disabled services as list
- 4- power
- this class use to manage the power in the system
- to poweroff
- to poweroff the system use
- poweroff()
- the reboot the system use
- reboot()
- to boot to rescue mode use
- rescue()
- to suspend the system use
- suspend()
|