Skip to main content

YAML-driven ROS2 systemd service manager

Project description

ROS2 Systemd Manager

ROS2 Systemd Manager is a YAML-driven tool to manage ROS2 launch tasks as systemd services.

What It Does

  • Bootstrap local files with ros2-systemd-manager init
  • Install units with install
  • Install + start + enable with apply
  • Remove units with uninstall
  • Run synchronized update flow with stale-unit cleanup via update
  • Regenerate Makefile only with makefile
  • Upgrade tool to latest version via upgrade

Installation

Note: This tool is designed for Linux systems with systemd. Ensure you have Python 3 and pip installed. It is recommended to use sudo for installation to allow systemd unit management.

sudo pip install ros2-systemd-manager

CLI

ros2-systemd-manager [action] [--config PATH] [--workspace-key KEY]

Supported actions:

  • init
  • install
  • apply
  • uninstall
  • update
  • makefile
  • upgrade

Init Output

Run in an empty directory:

ros2-systemd-manager init

Generated files:

  • ./ros2_services.yaml (default configuration)
  • ./ros2-systemd-manager.mk (generated makefile targets fragment)
  • ./Makefile (entrypoint that includes the .mk file)

Note: The tool places generated makefile targets into ros2-systemd-manager.mk to keep your root Makefile clean. The root Makefile will automatically include the .mk fragment.

YAML Keys

Required:

  • systemd
  • runtime
  • workspaces

Optional:

  • actions (default action is apply)
  • makefile

Generated Makefile

Primary targets:

make upgrade                  # self-upgrade ros2-systemd-manager via pip
make install                  # install unit files only
make apply                    # install + start + enable
make start                    # systemctl start all configured units
make stop                     # systemctl stop all configured units
make restart                  # systemctl restart all configured units
make status                   # systemctl status all configured units
make status-long              # systemctl status with 100 log lines
make enable                   # systemctl enable all configured units
make disable                  # systemctl disable all configured units
make logs                     # follow logs for all configured units
make logs-recent              # show last 200 log lines for all configured units
make <op>-<service>           # op in start/stop/restart/status/enable/disable/logs
make <op>-<service>-<sfx>     # e.g., logs-<svc>-recent, status-<svc>-long (100 lines)
make uninstall                # uninstall all configured units
make update                   # stop old + uninstall + install/start/enable + refresh mk
make makefile                 # refresh generated mk only (no systemd changes)

Config behavior:

  • No hardcoded absolute config path.
  • Default auto-discovery strictly looks for ./ros2_services.yaml in the current running directory.
  • Override manually via CONFIG environment variable or --config parameter:
make apply CONFIG=./my_services.yaml

File Tracking & Safety

  • Automatic Backups: Whenever files in /etc/systemd/system/ are modified (via update, install, or uninstall), a copy of the exact deployed file along with its MD5 hash (and a global hash) is stored in ~/.config/ros2-systemd-manager/previous-update/.
  • Modification Detection: During update or uninstall operations, the manager uses filecmp and diff to check if you have manually modified the systemd service file. If modifications are detected, it presents a diff in the terminal and asks if you want to archive your manual changes to ~/.config/ros2-systemd-manager/archive/ before proceeding with the overwrite/deletion.

Safety

  • Use trusted launch commands only.
  • Validate workspace paths and setup scripts before apply or update.
  • Prefer install first for new services.

Project details


Download files

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

Source Distribution

ros2_systemd_manager-0.1.3.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ros2_systemd_manager-0.1.3-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file ros2_systemd_manager-0.1.3.tar.gz.

File metadata

  • Download URL: ros2_systemd_manager-0.1.3.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ros2_systemd_manager-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fd8fe479cf6461dd3d4b5b503ca2fe3380d473382f1fc94d7c67e9a2721c5e9c
MD5 ed08be57f3792d46407ff71c559cdf29
BLAKE2b-256 a4dcf2d7ffd4fee7a55d2cad6f40745bcfa991e79bce032b67050094ae9ad36d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2_systemd_manager-0.1.3.tar.gz:

Publisher: release-pypi.yml on hnrobert/ros2-systemd-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ros2_systemd_manager-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ros2_systemd_manager-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9885bdeeb883e170713ac042bdd70b8e2105601645002835f560b2ea5fc92f7c
MD5 eff4fbcc22a746c15cfb0dba72bda2ec
BLAKE2b-256 2b259d3e8d487d8d8d3fbd25f14aad30bf7ab917f64cd912f34b808833e40f7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2_systemd_manager-0.1.3-py3-none-any.whl:

Publisher: release-pypi.yml on hnrobert/ros2-systemd-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page