Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

emlid/systemd-manager

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple python D-Bus API to control systemd services

Prerequisities

This packages uses D-Bus to control systemd. You need to have D-Bus itself and its python bindings in order to use this library. For example, on Ubuntu you need to install the following packages:

sudo apt install dbus libdbus-glib-1-dev libdbus-1-dev python-dbus

The setup.py does not contain the python-dbus dependency and you have to install it manually.

Example
from sysdmanager import SystemdManager

manager = SystemdManager()
if not manager.is_active("bluetooth.service"):
    manager.start_unit("bluetooth.service")

API
  • SystemdManager().start_unit(unit_name, mode="replace")
    • unit_name - a string in form of '*.service'
    • mode - start mode. One of replace, fail, isolate, ignore-dependencies, ignore-requirements. Details here
    • returns bool representing operation success
  • SystemdManager().stop_unit(unit_name, mode="replace")
    • unit_name - a string in form of '*.service'
    • mode - start mode. One of replace, fail, isolate, ignore-dependencies, ignore-requirements. Details here
    • returns bool representing operation success
  • SystemdManager().enable_unit(unit_name)
    • unit_name - a string in form of '*.service'
    • returns bool representing operation success
  • SystemdManager().disable_unit(unit_name)
    • unit_name - a string in form of '*.service'
    • returns bool representing operation success
  • SystemdManager().is_active(unit_name)
    • unit_name - a string in form of '*.service'
    • returns bool representing unit state
Credits

This package was written by Aleksandr Aleksandrov and is used in Emlid's products, such as Reach and Reach RS.

About

Simple python API to control systemd services

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.