Skip to main content
Manage upstart services.

Functions

upstart.service

Manage the state of upstart managed services.
upstart.service(
    service,
    running=True,
    restarted=False,
    reloaded=False,
    command=None,
    enabled=None,
)
Enabling/disabling services: Upstart jobs define runlevels in their config files - as such there is no way to edit/list these without fiddling with the config. So pyinfra simply manages the existence of a /etc/init/<service>.override file, and sets its content to “manual” to disable automatic start of services.

Examples

from pyinfra.operations import upstart

# Manage an Upstart service
upstart.service(
    name="Ensure nginx is running",
    service="nginx",
    running=True,
    enabled=True,
)

Build docs developers (and LLMs) love