skillfed

sdnotify

A pure Python implementation of systemd's service notification protocol (sd_notify)

sdnotify v0.3.2 191.1K downloads/30d#9,888 on PyPI123
Permissive license Abandoned released

What it is and what it does

sdnotify is a pure Python implementation of systemd's sd_notify protocol, allowing Python services to communicate their state to systemd. It lets you signal when your service has finished startup, send periodic status updates, and report watchdog events—all of which systemd can monitor and act upon. The package is designed to be silent by default on non-systemd systems, so it won't break applications running elsewhere.

The library provides a single main class, SystemdNotifier, with a notify() method that sends protocol messages to systemd's notification socket. It has no runtime dependencies and works by directly writing to the socket that systemd creates for each service. However, the project is no longer maintained: the last release was in 2017, and there have been no commits since early 2022.

Use it for:

  • Inform systemd when a Python daemon has completed its startup sequence, allowing systemd to mark the service as ready.
  • Send periodic status messages to systemd that appear in systemctl status output for operational visibility.
  • Implement watchdog heartbeat notifications to tell systemd the service is still alive and responsive.
  • Build Python-based system services that integrate cleanly with systemd's service lifecycle and monitoring.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Sends systemd service notifications (startup completion, status updates, watchdog events) from Python applications to inform systemd about service state changes.

Yes, if you are writing a Python systemd service on a modern Linux system and need basic sd_notify support. The code is simple and stable for its narrow purpose. However, be aware that the package is abandoned—no updates since 2017—so if systemd's protocol or your Python version diverges significantly, you may need to fork or patch it yourself. For new projects, verify that it still works with your target Python and systemd versions before committing to it.

Install

sdnotify on PyPI

pip

pip install sdnotify

uv

uv add sdnotify

poetry

poetry add sdnotify

Installing sdnotify

Before you install

High install friction due to source distribution. Maintenance is abandoned—last release was 2017-08-02, with no commits since 2022-02-28. The package is stable for its narrow use case but receives no active support or updates.

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute freely without significant legal restrictions.

Quickstart

pip install sdnotify

import sdnotify
n = sdnotify.SystemdNotifier()
n.notify("READY=1")
n.notify("STATUS=Running")

Requires a systemd-based Linux system with the systemd notification socket available; will silently fail on non-systemd systems unless debug=True is set.

Verify before relying

  • Whether the package works reliably with modern Python 3 versions (last tested/released in 2017).
  • Current compatibility with recent systemd versions and their sd_notify protocol changes.

Package facts

License not declared (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,299 days since the last release
Last repo commit
First released
Downloads 191,134/month — #9,888 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sdnotify-0.3.2.tar.gz

Keywords: systemd

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

systemd service notificationsd_notify protocol pythonsystemd ready signalservice status updates systemdpython systemd integrationwatchdog notification systemd
systemd-integrationservice-lifecycle

More Python Modules packages