a systemd binding Library in python

alimiracle 3e1299ca85 move to codeberg 6 months ago
pysystemd 6cb3758e49 clene 1.0.2 6 years ago
MANIFEST d1cdb173cd 1.0.3 6 years ago
README 3e1299ca85 move to codeberg 6 months ago
setup.cfg d1cdb173cd 1.0.3 6 years ago
setup.py d1cdb173cd 1.0.3 6 years ago

README

# 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()