Manage OpenRC init services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pyinfra-dev/pyinfra/llms.txt
Use this file to discover all available pages before exploring further.
Powered by Mintlify
Auto-generate your docs
Manage OpenRC init services
Manage OpenRC init services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pyinfra-dev/pyinfra/llms.txt
Use this file to discover all available pages before exploring further.
openrc.serviceopenrc.service(
service,
running=True,
restarted=False,
reloaded=False,
command=None,
enabled=None,
runlevel="default",
)
from pyinfra.operations import openrc
# Manage an OpenRC service
openrc.service(
name="Ensure nginx is running",
service="nginx",
running=True,
enabled=True,
)
# Enable a service for a specific runlevel
openrc.service(
name="Enable sshd on boot runlevel",
service="sshd",
enabled=True,
runlevel="boot",
)