Skip to content

Systemd watcher: Python wrapper for services based on dbus systemd and session manager interfaces

License

Notifications You must be signed in to change notification settings

soltanoff/systemd_watcher

Repository files navigation

systemd service watcher

systemd is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system.

systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, maintains mount and automount points, and implements an elaborate transactional dependency-based service control logic.

systemd supports SysV and LSB init scripts and works as a replacement for sysvinit. Other parts include a logging daemon, utilities to control basic system configuration like the hostname, date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution.

Config

Config examples here .env.default.

How to run

Fill your database and run Django development server:

sudo apt-get install libdbus-glib-1-dev libdbus-1-dev
pip3 install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic

To run with a docker compose:

docker-compose up

To run as systemctl unit:

sudo systemctl enable systemd_watcher.service
sudo systemctl daemon-reload
sudo systemctl start systemd_watcher.service

The note

Due to the simplicity of authorization and authentication, use this service only at stages and preprod. If you still use it on production, then you need to deny access to the service outside, only for local use on production.

Screens

Example #1: Main page

Main page

Example #2: Inactive services

Main page

Example #3: Failed services

Main page

Example #4: Failed services

Failed services