Skip to content

Repository files navigation

remote-svc-ctrl CI

An EPICS IOC that monitors and controls systemd services, exposing their status as Process Variables (PVs). Supports both local and remote (via SSH) service management.

This can be particularly useful for managing acquisition/control services on vendor provided systems, such as the Dectris camserver service for Pilatus3 detectors, or the xspd remote control service from X-Spectrum.

Features

  • Poll systemctl status parse its output, and publish relevant information as PVs
  • Start, stop, and restart services via CA/PVA
  • Monitor over SSH for services running on remote hosts
  • Also supports legacy init.d (SysV) services via --initd
  • Phoebus operator screen included

Usage

# Monitor a local service
remote-svc-ctrl "XF:28ID1-CT{SVC-MyApp:1}" my-app.service

# Monitor a service on a remote host via SSH
remote-svc-ctrl "XF:28ID1-CT{SVC-MyApp:1}" my-app.service --host user@server

# Monitor a legacy init.d (SysV) service
remote-svc-ctrl "XF:28ID1-CT{SVC-MyApp:1}" my-app --initd

Operator Screen

A Phoebus .bob screen is provided in op/service_ctrl.bob. Open it with the macro PREFIX set to your IOC's PV prefix.

Operator Screen

Documentation

Development

The project uses uv for dependency management and task running. To set up the development environment, run:

uv sync                             # Install dependencies
uv run pytest                       # Unit tests
uv run pre-commit run --all-files   # Linting and formatting

Requirements

  • Python >= 3.11
  • pythonSoftIOC >= 4.7.0
  • systemctl available on the target host
  • For non-root service control: appropriate polkit rules configured on the target host
  • For init.d services (--initd): service and chkconfig on the target host, and sudoers rules for non-root control (see docs/initd.md)
  • SSH key-based auth configured for remote hosts

About

A python based IOC for remotely managing systemd services

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages