Skip to main content

a systemd binding Library in python

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pysystemd, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size pysystemd-1.0.3.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page